For some reason libpmc_events.c is generated with structs in a different order: On my laptop: % wc obj/libpmc_events.c 68563 386042 2990918 obj/libpmc_events.c % head -n 5 obj/libpmc_events.c #include "pmu-events/pmu-events.h" static struct pmu_event pme_ivybridge[] = { { .name = "cpl_cycles.ring0", .event = "umask=0x1,period=2000003,event=0x5c", % sort obj/libpmc_events.c | sha256 3766feb36fbb923f620e95034a75c3a333072dd06b1516d3d987209413e4c268 On universe11b: % wc ./lib/libpmc/libpmc_events.c 68563 386042 2990918 ./lib/libpmc/libpmc_events.c % head -n 5 ./lib/libpmc/libpmc_events.c #include "pmu-events/pmu-events.h" static struct pmu_event pme_westmereep_dp[] = { { .name = "dtlb_load_misses.any", .event = "umask=0x1,period=200000,event=0x8", % sort ./lib/libpmc/libpmc_events.c | sha256 3766feb36fbb923f620e95034a75c3a333072dd06b1516d3d987209413e4c268
mmacy tracked this to jevents.c's use of nftw(3) which traverses in filesystem order. nftw uses fts(3) internally but there is unfortunately no way to have it sort entries. There was a suggestion of a flag extension to POSIX (e.g. FTW_SORT) to have nftw pass a comparison function to fts_open.
commit 334fd3dabc9e8f913e7b509e9ccdcb835fbf43f0 Refs: vendor/tzdata/tzdata2018i-239257-g334fd3dabc9e Author: Matt Macy <mmacy@FreeBSD.org> AuthorDate: Tue Feb 5 00:31:25 2019 +0000 Commit: Matt Macy <mmacy@FreeBSD.org> CommitDate: Tue Feb 5 00:31:25 2019 +0000 Fix deterministic builds by sorting input to fts in jevents Reported by: emaste@ Notes: svn path=/head/; revision=343758
openSUSE also found this issue: https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/BUEX2ZEIAXECXFIN4KRBZBHJF3FVGZZ2/ > perf > random filesys order > from nftw call in ./linux-*/tools/perf/pmu-events/jevents.c