linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: John Garry <john.garry@huawei.com>
Cc: Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Kajol Jain <kjain@linux.ibm.com>,
	"Paul A . Clarke" <pc@us.ibm.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Riccardo Mancini <rickyman7@gmail.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vineet Singh <vineet.singh@intel.com>,
	eranian@google.com
Subject: Re: [PATCH v2 2/2] perf parse-events: Architecture specific leader override
Date: Fri, 19 Nov 2021 09:11:43 -0800	[thread overview]
Message-ID: <CAP-5=fWh6bQ1vgzk-kK1Q0rcysXPHtbagBASgcQQ2dVgANG8Mw@mail.gmail.com> (raw)
In-Reply-To: <17f31c73-052d-ef15-879a-c6a224977e8d@huawei.com>

On Fri, Nov 19, 2021 at 6:47 AM John Garry <john.garry@huawei.com> wrote:
>
> On 18/11/2021 22:06, Ian Rogers wrote:
> > Currently topdown events must appear after a slots event:
> >
> > $ perf stat -e '{slots,topdown-fe-bound}' /bin/true
> >
> >   Performance counter stats for '/bin/true':
> >
> >           3,183,090      slots
> >             986,133      topdown-fe-bound
> >
> > Reversing the events yields:
> >
> > $ perf stat -e '{topdown-fe-bound,slots}' /bin/true
> > Error:
> > The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (topdown-fe-bound).
> >
> > For metrics the order of events is determined by iterating over a
> > hashmap, and so slots isn't guaranteed to be first which can yield this
> > error.
> >
> > Change the set_leader in parse-events, called when a group is closed, so
> > that rather than always making the first event the leader, if the slots
> > event exists then it is made the leader. It is then moved to the head of
> > the evlist otherwise it won't be opened in the correct order.
> >
> > The result is:
> >
> > $ perf stat -e '{topdown-fe-bound,slots}' /bin/true
>
> Just curious - does this just affect topdown events? I think x86 is the
> only arch which has them.

The change is specific to x86 as the weak symbol override only happens
on x86. For x86 it only applies if the cpu/slots/ event exists. In the
future it may be used for more than just this - Kajol Jain mentioned a
similar problem for powerpc:
https://lore.kernel.org/lkml/6d1fcb97-223d-7d8e-b5cb-0f10dbc62880@linux.ibm.com/

Thanks,
Ian

> Thanks,
> John

  reply	other threads:[~2021-11-19 17:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 22:06 [PATCH v2 1/2] perf evlist: Allow setting arbitrary leader Ian Rogers
2021-11-18 22:06 ` [PATCH v2 2/2] perf parse-events: Architecture specific leader override Ian Rogers
2021-11-19 14:47   ` John Garry
2021-11-19 17:11     ` Ian Rogers [this message]
2021-11-30 15:05   ` Arnaldo Carvalho de Melo
2021-11-28 15:28 ` [PATCH v2 1/2] perf evlist: Allow setting arbitrary leader Jiri Olsa
2021-11-30 15:04 ` Arnaldo Carvalho de Melo

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='CAP-5=fWh6bQ1vgzk-kK1Q0rcysXPHtbagBASgcQQ2dVgANG8Mw@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=pc@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rickyman7@gmail.com \
    --cc=vineet.singh@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).