• Namhyung Kim's avatar
    perf pmu: Add perf_pmu__{open,scan}_file_at() · 3a69672e
    Namhyung Kim authored
    These two helpers will also use openat() to reduce the overhead with
    relative pathnames.  Convert other functions in pmu_lookup() to use
    the new helpers.
    
    Committer testing:
    
    Before:
    
      ⬢[acme@toolbox perf-tools-next]$ perf bench internals pmu-scan
      # Running 'internals/pmu-scan' benchmark:
      Computing performance of sysfs PMU event scan for 100 times
        Average PMU scanning took: 2729.040 usec (+- 7.117 usec)
      ⬢[acme@toolbox perf-tools-next]$
    
    After:
    
      ⬢[acme@toolbox perf-tools-next]$ perf bench internals pmu-scan
      # Running 'internals/pmu-scan' benchmark:
      Computing performance of sysfs PMU event scan for 100 times
        Average PMU scanning took: 2419.870 usec (+- 9.057 usec)
      ⬢[acme@toolbox perf-tools-next]$
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20230331202949.810326-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3a69672e
pmu.h 8.33 KB