Lines Matching +full:sub +full:- +full:spaces

2 # SPDX-License-Identifier: GPL-2.0
12 while [ $# -gt 0 ] ; do
13 if [ $1 == "--all" ]; then
16 elif [ $1 == "--unpack" ]; then
19 elif [ $1 == "--exclude-buildids" ]; then
21 if [ ! -e "$EXCLUDE_BUILDIDS" ]; then
22 echo "Provided exclude-buildids file $EXCLUDE_BUILDIDS does not exist"
33 if [ $UNPACK -eq 1 ]; then
34 if [ ! -z "$UNPACK_TAR" ]; then # tar given as an argument
35 if [ ! -e "$UNPACK_TAR" ]; then
41 TARGET=`find . -regex "\./perf.*\.tar\.bz2"`
42 TARGET_NUM=`echo -n "$TARGET" | grep -c '^'`
44 if [ -z "$TARGET" ] || [ $TARGET_NUM -gt 1 ]; then
45 echo -e "Error: $TARGET_NUM files found for unpacking:\n$TARGET"
53 if [[ "$TARGET" =~ (\./)?$PERF_ALL.*.tar.bz2 ]]; then # perf tar generated by --all option
54 TAR_CONTENTS=`tar tvf "$TARGET" | tr -s " " | cut -d " " -f 6`
55 …=`echo "$TAR_CONTENTS" | grep "$PERF_SYMBOLS.tar.bz2" | wc -l` # check if it contains a sub-tar p…
56 if [ $VALID_TAR -ne 1 ]; then
57 …echo "Error: $TARGET file is not valid (contains zero or multiple sub-tar files with debug symbols…
61 INTERSECT=`comm -12 <(ls) <(echo "$TAR_CONTENTS") | tr "\n" " "` # check for overwriting
62 if [ ! -z "$INTERSECT" ]; then # prompt if file(s) already exist in the current directory
63 echo "File(s) ${INTERSECT::-1} already exist in the current directory."
65 read -p 'Do you wish to overwrite them? ' yn
75 tar xvf $TARGET && tar xvf $PERF_SYMBOLS.tar.bz2 -C ~/.debug
78 tar xvf $TARGET -C ~/.debug
87 if [ -z $PERF_BUILDID_DIR ]; then
94 BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX)
97 # EXCLUDE_BUILDIDS is an optional file that contains build-ids to be excluded from the
98 # archive. It is a list of build-ids, one per line, without any leading or trailing spaces.
99 # If the file is empty, all build-ids will be included in the archive. To create a exclude-
101 # perf buildid-list -i perf.data --with-hits | grep -v "^ " > exclude_buildids.txt
103 # perf archive --exclude-buildids exclude_buildids.txt
105 if [ -s "$EXCLUDE_BUILDIDS" ]; then
106 …perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " | grep -Fv -f $EXCLUDE_BUILDIDS > $BUIL…
107 if [ ! -s "$BUILDIDS" ] ; then
108 echo "perf archive: no build-ids found after applying exclude-buildids file"
113 perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS
114 if [ ! -s "$BUILDIDS" ] ; then
115 echo "perf archive: no build-ids found"
121 MANIFEST=$(mktemp /tmp/perf-archive-manifest.XXXXXX)
122 PERF_BUILDID_LINKDIR=$(readlink -f $PERF_BUILDID_DIR)/
124 cut -d ' ' -f 1 $BUILDIDS | \
126 linkname=$PERF_BUILDID_DIR.build-id/${build_id:0:2}/${build_id:2}
127 filename=$(readlink -f $linkname)
132 if [ $ALL -eq 1 ]; then # pack perf.data file together with tar containing debug symbols
134 DATE=$(date '+%Y%m%d-%H%M%S')
135 tar cjf $PERF_SYMBOLS.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
136 tar cjf $PERF_ALL-$HOSTNAME-$DATE.tar.bz2 $PERF_DATA $PERF_SYMBOLS.tar.bz2
139 tar cjf $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
143 echo -e "Now please run:\n"
144 echo -e "$ perf archive --unpack\n"