]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf pfm: Don't force loading of all PMUs
authorIan Rogers <irogers@google.com>
Tue, 22 Jul 2025 01:34:49 +0000 (18:34 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 24 Jul 2025 20:28:31 +0000 (13:28 -0700)
Force loading all PMUs adds significant cost because DRM and other
PMUs are loaded, it should also not be required if the pmus__
functions are used.

Tested by run perf test, in particular the pfm related tests. Also
`perf list` is identical before and after.

Before:
  $ time ./perf test pfm
   54: Test libpfm4 support                                            :
   54.1: test of individual --pfm-events                               : Ok
   54.2: test groups of --pfm-events                                   : Ok
  103: perf all libpfm4 events test                                    : Ok

  real 0m8.933s
  user 0m1.824s
  sys 0m7.122s

After:
  $ time ./perf test pfm
   54: Test libpfm4 support                                            :
   54.1: test of individual --pfm-events                               : Ok
   54.2: test groups of --pfm-events                                   : Ok
  103: perf all libpfm4 events test                                    : Ok

  real 0m5.259s
  user 0m1.793s
  sys 0m3.570s

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20250722013449.146233-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/pfm.c

index 0dacc133ed39605284fc8b0a977080291cd4a7c6..e89395814e88be92066012fa08f4939376533d66 100644 (file)
@@ -47,10 +47,6 @@ int parse_libpfm_events_option(const struct option *opt, const char *str,
        p_orig = p = strdup(str);
        if (!p)
                return -1;
-       /*
-        * force loading of the PMU list
-        */
-       perf_pmus__scan(NULL);
 
        for (q = p; strsep(&p, ",{}"); q = p) {
                sep = p ? str + (p - p_orig - 1) : "";