mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
	paulus@samba.org, cjashfor@linux.vnet.ibm.com,
	fweisbec@gmail.com, linux-kernel@vger.kernel.org,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 5/8] perf, tool: Add pmu event parse support for branch_sample_type values
Date: Thu, 5 Apr 2012 10:59:11 +0200	[thread overview]
Message-ID: <20120405085911.GC1624@m.brq.redhat.com> (raw)
In-Reply-To: <CABPqkBRyEmouSfJC=PYzgC8hTPmSzODVC81swnZvLPm3EG2vcQ@mail.gmail.com>

On Wed, Apr 04, 2012 at 09:50:12PM -0700, Stephane Eranian wrote:
> On Wed, Apr 4, 2012 at 1:21 PM, Jiri Olsa <jolsa@redhat.com> wrote:
> > Adding a support to specify branch_type as a hardcoded term
> > inside the pmu event definition.
> >
> > It is possible to specify pmu event like:
> >  "cpu/config=1,branch_type=hv|any_ret|1,config2=2/u"
> >
> > Following string values could be used as value for branch_type:
> >  u (PERF_SAMPLE_BRANCH_USER)
> >  k (PERF_SAMPLE_BRANCH_KERNEL)
> >  hv (PERF_SAMPLE_BRANCH_HV)
> >  any (PERF_SAMPLE_BRANCH_ANY)
> >  any_call (PERF_SAMPLE_BRANCH_ANY_CALL)
> >  any_ret (PERF_SAMPLE_BRANCH_ANY_RETURN)
> >  ind_call (PERF_SAMPLE_BRANCH_IND_CALL)
> >
> > Also a number could be specified as value.
> >
> Although it would be nice to have, the current kernel sampling
> buffer layout + perf would not be able to parse the RECORD_SAMPLE
> if you were to sample different things for different events:
> 
>  perf record -e
> cpu/event=0xc0,umask=1:branch_type=any/,cpu/event=0x3c,umask=0x1/
hi,
for some reason I thought there might be sense to have multiple branch
types enabled in a single event.. I misread the code probably

> 
> Perf report/annotate would not be able to distinguish a RECORD_SAMPLE
> generated by the first or the second event. That's because the RECORD_SAMPLE
> fixed header does not contain enough info to determine which event caused the
> record to be generated. You need to event ID to decode the sample. The event ID
> gives you the attr struct which gives you the attr->sample_type which drives the
> layout of the RECORD_SAMPLE variable size body. The event ID is currently
> saved "somewhere" in the variable-size body of the sample. You have  a chicken
> and egg problem here.

yep, I'm aware of this.. cool you're preparing fix

thanks,
jirka

  reply	other threads:[~2012-04-05  8:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 20:21 [PATCH 0/8] perf tool: event parsing enhancements/fixes Jiri Olsa
2012-04-04 20:21 ` [PATCH 1/8] perf, tool: Fix NULL deref in hists browsing code Jiri Olsa
2012-04-13 18:04   ` [tip:perf/core] perf hists browser: " tip-bot for Jiri Olsa
2012-04-04 20:21 ` [PATCH 2/8] perf, tool: Split term type into value type and term type Jiri Olsa
2012-04-04 20:21 ` [PATCH 3/8] perf, tool: Add list type for event term parsing Jiri Olsa
2012-04-04 20:21 ` [PATCH 4/8] perf, tool: Add hardcoded name term for pmu events Jiri Olsa
2012-04-04 20:21 ` [PATCH 5/8] perf, tool: Add pmu event parse support for branch_sample_type values Jiri Olsa
2012-04-05  4:50   ` Stephane Eranian
2012-04-05  8:59     ` Jiri Olsa [this message]
2012-04-05 17:06       ` Stephane Eranian
2012-04-04 20:21 ` [PATCH 6/8] perf, tool: Move parse event automated tests to separated object Jiri Olsa
2012-04-04 20:21 ` [PATCH 7/8] perf, tool: Add support for displaying event parser debug info Jiri Olsa
2012-04-04 20:21 ` [PATCH 8/8] perf, tool: Use allocated list for each parsed event Jiri Olsa

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=20120405085911.GC1624@m.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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

Powered by JetHome