perf archive: Fix filtering of empty build-ids
PATCH 1/2 perf archive: Fix filtering of empty build-ids
A non-existent build-id used to be treated as all-zero SHA-1 hash. Build-ids are now variable width. A non-existent build-id is an empty string and "perf buildid-list" pads this with spaces. This is true even when using old perf.data files recorded from older versions of perf; "perf buildid-list" never reports an all-zero hash anymore.
This fixes "perf-archive" to skip missing build-ids by skipping lines that start with a padding space rather than with zeroes.
--- tools/perf/perf-archive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/perf-archive.sh +1 -2
@@ -20,9 +20,8 @@ else fi BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX) -NOBUILDID=0000000000000000000000000000000000000000 -perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDS +perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS if [ ! -s $BUILDIDS ] ; then echo "perf archive: no build-ids found" rm $BUILDIDS || true
Signature · 1 line
2.30.1
Quoted 10 lines · Nicholas Fraser
A non-existent build-id used to be treated as all-zero SHA-1 hash. Build-ids are now variable width. A non-existent build-id is an empty string and "perf buildid-list" pads this with spaces. This is true even when using old perf.data files recorded from older versions of perf; "perf buildid-list" never reports an all-zero hash anymore.
This fixes "perf-archive" to skip missing build-ids by skipping lines that start with a padding space rather than with zeroes.
Signed-off-by Nicholas Fraser <[email protected]>
thanks,
jirka
Quoted 22 lines
--- tools/perf/perf-archive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tools/perf/perf-archive.sh +1
-2@@ -20,9 +20,8 @@ else fi BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX) -NOBUILDID=0000000000000000000000000000000000000000 -perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDS +perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS if [ ! -s $BUILDIDS ] ; then echo "perf archive: no build-ids found" rm $BUILDIDS || trueSignature · 1 line
2.30.1
Em Wed, Feb 24, 2021 at 02:50:20PM +0100, Jiri Olsa escreveu:
Quoted 7 lines · Nicholas Fraser
Quoted 6 lines
A non-existent build-id used to be treated as all-zero SHA-1 hash. Build-ids are now variable width. A non-existent build-id is an empty string and "perf buildid-list" pads this with spaces. This is true even when using old perf.data files recorded from older versions of perf; "perf buildid-list" never reports an all-zero hash anymore.
Quoted 6 lines
Quoted 4 lines
This fixes "perf-archive" to skip missing build-ids by skipping lines that start with a padding space rather than with zeroes.
Signed-off-by Nicholas Fraser <[email protected]>Acked-by Jiri Olsa <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 26 lines
thanks,
jirkaQuoted 22 lines
--- tools/perf/perf-archive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tools/perf/perf-archive.sh +1
-2@@ -20,9 +20,8 @@ else fi BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX) -NOBUILDID=0000000000000000000000000000000000000000 -perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDS +perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS if [ ! -s $BUILDIDS ] ; then echo "perf archive: no build-ids found" rm $BUILDIDS || trueSignature · 1 line
2.30.1
Signature · 1 line
- Arnaldo