tools/perf: pmu-events: Fix reproducibility
authorBen Hutchings <ben@decadent.org.uk>
Sun, 25 Aug 2019 12:49:41 +0000 (13:49 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 1 Dec 2022 06:42:33 +0000 (06:42 +0000)
commitf1438d61b9ca62705ea87431f3d9e7d68f162232
tree2b843ef04c44d12959ce72c134b53ce4922c0f75
parentc5c583eb2f7600340523edd075e21d90f0754fab
tools/perf: pmu-events: Fix reproducibility

Forwarded: https://lore.kernel.org/lkml/20190825131329.naqzd5kwg7mw5d3f@decadent.org.uk/T/#u

jevents.py enumerates files and outputs the corresponding C structs in
the order they are found.  This makes it sensitive to directory
ordering, so that the perf executable is not reproducible.

To avoid this, sort the entries returned by os.scandir() before
processing them.

References: https://tests.reproducible-builds.org/debian/dbdtxt/bullseye/i386/linux_4.19.37-6.diffoscope.txt.gz
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-perf-pmu-events-fix-reproducibility.patch
tools/perf/pmu-events/jevents.py