linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: zhengjun.xing@linux.intel.com
Cc: peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@intel.com, jolsa@redhat.com,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	irogers@google.com, adrian.hunter@intel.com, ak@linux.intel.com,
	kan.liang@linux.intel.com
Subject: Re: [PATCH] perf parse: Fix event parser error for hybrid systems
Date: Sat, 12 Mar 2022 10:54:57 -0300	[thread overview]
Message-ID: <YiymMXe5Wdj9rJzP@kernel.org> (raw)
In-Reply-To: <20220307151627.30049-1-zhengjun.xing@linux.intel.com>

Em Mon, Mar 07, 2022 at 11:16:27PM +0800, zhengjun.xing@linux.intel.com escreveu:
> From: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> 
> This bug happened on hybrid systems when both cpu_core and cpu_atom
> have the same event name such as "UOPS_RETIRED.MS" while their event
> terms are different, then during perf stat, the event for cpu_atom
> will parse fail and then no output for cpu_atom.
> 
> UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/
> UOPS_RETIRED.MS -> cpu_atom/period=0x1e8483,umask=0x1,event=0xc2/
> 
> It is because event terms in the "head" of parse_events_multi_pmu_add
> will be changed to event terms for cpu_core after parsing UOPS_RETIRED.MS
> for cpu_core, then when parsing the same event for cpu_atom, it still
> uses the event terms for cpu_core, but event terms for cpu_atom are
> different with cpu_core, the event parses for cpu_atom will fail. This
> patch fixes it, the event terms should be parsed from the original
> event.
> 
> This patch can work for the hybrid systems that have the same event
> in more than 2 PMUs. It also can work in non-hybrid systems.
> 
> Before:
> 
>  #perf stat -v  -e  UOPS_RETIRED.MS  -a sleep 1
> 
> Using CPUID GenuineIntel-6-97-1
> UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/
> Control descriptor is not initialized
> UOPS_RETIRED.MS: 2737845 16068518485 16068518485
> 
>  Performance counter stats for 'system wide':
> 
>          2,737,845      cpu_core/UOPS_RETIRED.MS/
> 
>        1.002553850 seconds time elapsed
> 
> After:
> 
>  #perf stat -v  -e  UOPS_RETIRED.MS  -a sleep 1
> 
> Using CPUID GenuineIntel-6-97-1
> UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/
> UOPS_RETIRED.MS -> cpu_atom/period=0x1e8483,umask=0x1,event=0xc2/
> Control descriptor is not initialized
> UOPS_RETIRED.MS: 1977555 16076950711 16076950711
> UOPS_RETIRED.MS: 568684 8038694234 8038694234

Thanks, applied.

- Arnaldo


      parent reply	other threads:[~2022-03-12 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 15:16 [PATCH] perf parse: Fix event parser error for hybrid systems zhengjun.xing
2022-03-07 16:39 ` Arnaldo Carvalho de Melo
2022-03-12 13:54 ` Arnaldo Carvalho de Melo [this message]

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=YiymMXe5Wdj9rJzP@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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).