linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jean-Philippe Romain <jean-philippe.romain@foss.st.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] perf pfm: Don't force loading of all PMUs
Date: Thu, 24 Jul 2025 13:28:27 -0700	[thread overview]
Message-ID: <aIKXa4LOIq5MyuS7@google.com> (raw)
In-Reply-To: <20250722013449.146233-1-irogers@google.com>

On Mon, Jul 21, 2025 at 06:34:49PM -0700, Ian Rogers wrote:
> 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.

I've also checked it with timing.  I'll add this to the commit message.

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

Tested-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/util/pfm.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
> index 0dacc133ed39..e89395814e88 100644
> --- a/tools/perf/util/pfm.c
> +++ b/tools/perf/util/pfm.c
> @@ -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) : "";
> -- 
> 2.50.0.727.gbf7dc18ff4-goog
> 

  reply	other threads:[~2025-07-24 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  1:34 [PATCH v1] perf pfm: Don't force loading of all PMUs Ian Rogers
2025-07-24 20:28 ` Namhyung Kim [this message]
2025-07-25 18:48 ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aIKXa4LOIq5MyuS7@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jean-philippe.romain@foss.st.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).