linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Petlan <mpetlan@redhat.com>
To: Ian Rogers <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org, acme@redhat.com,
	ravi.bangoria@amd.com, peterz@infradead.org, namhyung@kernel.org,
	sandipan.das@amd.com
Subject: Re: [PATCH] perf/x86/amd/core: Rename branch-brs event to not break the parser
Date: Thu, 14 Sep 2023 11:36:03 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LRH.2.20.2309141135360.3810@Diego> (raw)
In-Reply-To: <CAP-5=fU5aofaXOtR=5JU2BocrjZVDRkm9uSqe_fyjOeoQRmQYQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2277 bytes --]

On Tue, 12 Sep 2023, Ian Rogers wrote:
> On Tue, Sep 12, 2023 at 6:35 AM Michael Petlan <mpetlan@redhat.com> wrote:
> >
> > The problem is described in detail in 146edff3d7ed ("perf test: Parse
> > events workaround for dash/minus"). In short, although perf-list offers
> > "branch-brs" event to be used, when used with "-e" switch, the parser
> > does not accept it and needs to be enclosed to "cpu//", such as:
> >
> > ```
> >   $ perf stat -e branch-brs true
> >   event syntax error: 'branch-brs'
> >                              \___ parser error
> >
> >   $ perf stat -e cpu/branch-brs/ true
> >
> >    Performance counter stats for 'true':
> >
> >               46,179      cpu/branch-brs/
> > ```
> >
> > This is confusing for the users.
> >
> > Rename the event using underscore instead of dash to avoid the problem.
> >
> > Signed-off-by: Michael Petlan <mpetlan@redhat.com>
> 
> I rewrote the event parsing and this was fixed in 70c90e4a6b2f ("perf
> parse-events: Avoid scanning PMUs before parsing"):
> https://lore.kernel.org/r/20230502223851.2234828-19-irogers@google.com
> which was included in the perf tool in Linux 6.5.
> 
> Thanks,
> Ian

OK, great to know, thanks!
Michael

> 
> > ---
> >  arch/x86/events/amd/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
> > index abadd5f23425..f4c5d4100035 100644
> > --- a/arch/x86/events/amd/core.c
> > +++ b/arch/x86/events/amd/core.c
> > @@ -1286,21 +1286,21 @@ amd_branches_is_visible(struct kobject *kobj, struct attribute *attr, int i)
> >  }
> >
> >  static struct attribute_group group_caps_amd_branches = {
> >         .name  = "caps",
> >         .attrs = amd_pmu_branches_attrs,
> >         .is_visible = amd_branches_is_visible,
> >  };
> >
> >  #ifdef CONFIG_PERF_EVENTS_AMD_BRS
> >
> > -EVENT_ATTR_STR(branch-brs, amd_branch_brs,
> > +EVENT_ATTR_STR(branch_brs, amd_branch_brs,
> >                "event=" __stringify(AMD_FAM19H_BRS_EVENT)"\n");
> >
> >  static struct attribute *amd_brs_events_attrs[] = {
> >         EVENT_PTR(amd_branch_brs),
> >         NULL,
> >  };
> >
> >  static umode_t
> >  amd_brs_is_visible(struct kobject *kobj, struct attribute *attr, int i)
> >  {
> > --
> > 2.18.4
> >
> 
> 

      reply	other threads:[~2023-09-14  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 13:33 [PATCH] perf/x86/amd/core: Rename branch-brs event to not break the parser Michael Petlan
2023-09-12 17:53 ` Ian Rogers
2023-09-14  9:36   ` Michael Petlan [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=alpine.LRH.2.20.2309141135360.3810@Diego \
    --to=mpetlan@redhat.com \
    --cc=acme@redhat.com \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.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).