linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Stephane Eranian <eranian@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <ak@linux.intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup
Date: Fri, 2 Feb 2018 17:28:49 -0300	[thread overview]
Message-ID: <20180202202849.GA8297@kernel.org> (raw)
In-Reply-To: <CABPqkBSkbq9NnufY1k2de-Fa-Qb0vhN_MGu6mhqNOV-p3CaVLQ@mail.gmail.com>

Em Fri, Feb 02, 2018 at 10:45:46AM -0800, Stephane Eranian escreveu:
> Jiri,
> 
> On Thu, Feb 1, 2018 at 12:38 AM, Jiri Olsa <jolsa@kernel.org> wrote:
> > Stephane reported that we don't set properly PERIOD
> > sample type for events with period term defined.
> >
> > Before:
> >   $ perf record -e cpu/cpu-cycles,period=1000/u ls
> >   $ perf evlist -v
> >   cpu/cpu-cycles,period=1000/u: ... sample_type: IP|TID|TIME|PERIOD, ...
> >
> > After:
> >   $ perf record -e cpu/cpu-cycles,period=1000/u ls
> >   $ perf evlist -v
> >   cpu/cpu-cycles,period=1000/u: ... sample_type: IP|TID|TIME, ...
> >
> > Setting PERIOD sample type based on period term setup.
> >
> there is still one problem remaining here. It has to do with the handling
> of cycles:pp or :p or :ppp. Suppose I want to set a period for it while I am
> also sampling on other events: Something like:
> 
> $ perf record -e
> cycles:pp,instructions,cpu/event=0xd0,umaks=0x81,period=100000/ .....
> 
> I want to set the period for cycles:pp, but not for instructions. I
> cannot use -c because
> it would also force a period on instructions. I could use the raw hw
> raw event code for cycles:pp.
> But that does not work because recent kernels prevent use of hw
> filters on events programmed
> for PEBS, e.g., cpu/event=0xc2,umask=0x1,cmask=16,inv/pp is rejected.
> PEBS does not support filters.
> It works in the case of cycles:pp simply by the nature on the
> underlying event and the stalls.
> 
> To get precise cycles, the only event syntax you can use is cycles:pp,
> but then you cannot specify
> an event-specific period. This needs to be fixed as well.
> 
> I'd like to be able to say:
> 
> $ perf record -e
> cycles:pp:period=10000001,cpu/event=0xd0,umaks=0x81,period=100000/
> 
> Or something equivalent.
> 
> Otherwise, I tested what you have written so far and it works.

So I take that as a Tested-by: Stephane and will apply the patches, Jiri
can continue working on these other aspects, right?

- Arnaldo
 
> Thanks.
> 
> 
> > Reported-by: Stephane Eranian <eranian@google.com>
> > Link: http://lkml.kernel.org/n/tip-anrtntkwfto5rqulegfwitn5@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/perf/util/evsel.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> > index 66fa45198a11..f2f2eaafde6d 100644
> > --- a/tools/perf/util/evsel.c
> > +++ b/tools/perf/util/evsel.c
> > @@ -745,12 +745,14 @@ static void apply_config_terms(struct perf_evsel *evsel,
> >                         if (!(term->weak && opts->user_interval != ULLONG_MAX)) {
> >                                 attr->sample_period = term->val.period;
> >                                 attr->freq = 0;
> > +                               perf_evsel__reset_sample_bit(evsel, PERIOD);
> >                         }
> >                         break;
> >                 case PERF_EVSEL__CONFIG_TERM_FREQ:
> >                         if (!(term->weak && opts->user_freq != UINT_MAX)) {
> >                                 attr->sample_freq = term->val.freq;
> >                                 attr->freq = 1;
> > +                               perf_evsel__set_sample_bit(evsel, PERIOD);
> >                         }
> >                         break;
> >                 case PERF_EVSEL__CONFIG_TERM_TIME:
> > --
> > 2.13.6
> >

  reply	other threads:[~2018-02-02 20:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  8:38 [PATCH 0/3] perf: PEBS/period freerunning fixes Jiri Olsa
2018-02-01  8:38 ` [PATCH 1/3] perf tools: Fix period/freq terms setup Jiri Olsa
2018-02-02 18:45   ` Stephane Eranian
2018-02-02 20:28     ` Arnaldo Carvalho de Melo [this message]
2018-02-02 20:40       ` Arnaldo Carvalho de Melo
2018-02-02 21:04         ` Stephane Eranian
2018-02-05 15:17           ` Jiri Olsa
2018-02-05 20:58             ` Stephane Eranian
2018-02-05 21:13               ` Arnaldo Carvalho de Melo
2018-02-06  2:51                 ` Stephane Eranian
2018-02-06  9:35                   ` Jiri Olsa
2018-02-07 18:52                     ` Stephane Eranian
2018-02-09  9:27                       ` [PATCH] perf report: Add support to display group output for non group events Jiri Olsa
2018-02-09 18:37                         ` Arnaldo Carvalho de Melo
2018-02-09 18:43                           ` Arnaldo Carvalho de Melo
2018-02-09 19:10                           ` Jiri Olsa
2018-02-09 19:12                             ` Arnaldo Carvalho de Melo
2018-02-17 11:23                         ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-02-03 15:30     ` [PATCH 1/3] perf tools: Fix period/freq terms setup Jiri Olsa
2018-02-04  0:19       ` Stephane Eranian
2018-02-05 21:35   ` [tip:perf/urgent] perf evsel: " tip-bot for Jiri Olsa
2018-02-01  8:38 ` [PATCH 2/3] perf record: Fix period option handling Jiri Olsa
2018-02-05 21:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2018-02-01  8:38 ` [PATCH 3/3] x86/events/intel/ds: Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS Jiri Olsa
2018-02-05 21:36   ` [tip:perf/urgent] " tip-bot for 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=20180202202849.GA8297@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).