linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: zhengjun.xing@linux.intel.com, acme@kernel.org,
	peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@intel.com, jolsa@kernel.org,
	namhyung@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	irogers@google.com, ak@linux.intel.com,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH 1/2] perf record: Fix "--per-thread" option for hybrid machines
Date: Mon, 4 Jul 2022 09:22:06 -0400	[thread overview]
Message-ID: <9fde1c3a-3fdb-b2b7-7448-8de608853bd2@linux.intel.com> (raw)
In-Reply-To: <20220702023536.2661899-1-zhengjun.xing@linux.intel.com>



On 7/1/2022 10:35 PM, zhengjun.xing@linux.intel.com wrote:
> From: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> 
> Commit b91e5492f9d7 ("perf record: Add a dummy event on hybrid systems to
> collect metadata records") adds a dummy event on hybrid systems to fix the
> symbol "unknown" issue when the workload is created in a P-core but runs
> on an E-core. When "--per-thread" is enabled, the nr_cpus is reduced to 1,
>   adding a dummy event is useless for this issue, and it will also cause

A dummy event is required since a mmap event may be loaded at runtime on 
any CPU. Thanks Adrian to point it out.

Thanks,
Kan

> "failed to mmap with 22 (Invalid argument)". This patch stops adding dummy
> events when the option "--per-thread" is enabled, then the option can work
> on hybrid machines.
> 
> Before:
> 
>   # ./perf record -e cycles:u --per-thread  sleep 1
>   failed to mmap with 22 (Invalid argument)
> 
> After:
> 
>   # ./perf record -e cycles:u --per-thread  sleep 1
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.002 MB perf.data (6 samples) ]
> 
> Fixes: b91e5492f9d7 ("perf record: Add a dummy event on hybrid systems to collect metadata records")
> Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
> ---
>   tools/perf/builtin-record.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index e1edd4e98358..44ea2dd424fe 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1223,7 +1223,7 @@ static int record__open(struct record *rec)
>   	 * of waiting or event synthesis.
>   	 */
>   	if (opts->initial_delay || target__has_cpu(&opts->target) ||
> -	    perf_pmu__has_hybrid()) {
> +	    (perf_pmu__has_hybrid() && !opts->target.per_thread)) {
>   		pos = evlist__get_tracking_event(evlist);
>   		if (!evsel__is_dummy_event(pos)) {
>   			/* Set up dummy event. */

  parent reply	other threads:[~2022-07-04 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02  2:35 [PATCH 1/2] perf record: Fix "--per-thread" option for hybrid machines zhengjun.xing
2022-07-02  2:35 ` [PATCH 2/2] perf test: Fix test case 87 ("perf record tests") for hybrid systems zhengjun.xing
2022-07-04 13:22 ` Liang, Kan [this message]
2022-07-06 12:00   ` [PATCH 1/2] perf record: Fix "--per-thread" option for hybrid machines Xing Zhengjun

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=9fde1c3a-3fdb-b2b7-7448-8de608853bd2@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhengjun.xing@linux.intel.com \
    /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).