mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>,
	jolsa@kernel.org, mingo@kernel.org, kan.liang@intel.com,
	linux-kernel@vger.kernel.org, acme@kernel.org
Subject: Re: [PATCH] perf tools: Fix gaps propagating maps
Date: Fri, 4 Sep 2015 11:48:15 -0300	[thread overview]
Message-ID: <20150904144815.GD2570@redhat.com> (raw)
In-Reply-To: <55E99FC6.5060807@intel.com>

Em Fri, Sep 04, 2015 at 04:42:30PM +0300, Adrian Hunter escreveu:
> On 04/09/15 16:28, Arnaldo Carvalho de Melo wrote:
> > Em Fri, Sep 04, 2015 at 03:15:54PM +0300, Adrian Hunter escreveu:
> >> A perf_evsel is a selected event containing the perf_event_attr
> >> that is passed to perf_event_open().  A perf_evlist is a collection
> >> of perf_evsel's.  A perf_evlist also has lists of cpus and threads
> >> (pids) on which to open the event.  These lists are called 'maps'
> >> and this patch is about how those 'maps' are propagated from the
> >>> perf_evlist to the perf_evsels.
> > 
> > Can't this be broken up in multiple patches, for instance this:
> 
> Ok, might not be until next week though.

Take your time, it seems that so far the only problem is with Intel PT,
with adding that sched_switch after the propagation was done, no?

And with kernel with PERF_RECORD_SWITCH, that I am pushing that other
patch from you, to the support using it replacing sched:sched_Switch in
the tooling side reduces the impact of this problem, right?
 
> >  int perf_evlist__create_maps(struct perf_evlist *evlist, struct
> >  target *target)
> >  {
> > +     if (evlist->threads || evlist->cpus)
> > +             return -1;
> > +
 
> Or you could just drop that chunk.
 
> > Looks like a fix that could be separated. Also FOO__propagate(.., false)
> > to do the opposite of propagate seems confusing, how about
> > FOO__unpropagate() if that verb exists? :-)
 
> Ok

> > Also, when unpropagating, you do:
> > 
> >              if (evsel->cpus == evlist->cpus) {
> >                      cpu_map__put(evsel->cpus);
> >                      evsel->cpus = NULL;
> >              }
> > 
> > What if the PMU code _set_ it to the same cpus as in evlist->cpus, but
> > now we're unpropagating to set to another CPU, in this case we will be
> > changing the PMU setting with a new one. I.e. when a PMU sets it it
> > should be sticky, no?
> 
> We are comparing the pointer, so that won't happen unless the PMU actually
> does evsel->cpus = evlist->cpus which seems unlikely.

> > I.e. we would have to know, in the evsel, if evsel->cpus was set by the
> > PMU or any other future entity expecting this behaviour, so that we
> > don't touch it, i.e. testing (evsel->cpus != evlist->cpus) when
> > unpropagating doesn't seem to cut, right?
> 
> I think the pointer comparison covers that. i.e. the pointers won't be the
> same even if the cpus are.

It makes it more unlikely, yes.

I think that to be safe we should have a evsel->sticky_{cpu,threads}, well, at
least the evsel->sticky_cpus seems needed due to the PMU usecase.

- Arnaldo

      reply	other threads:[~2015-09-04 14:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  6:23 [PATCH 1/1] perf,tools: open event on evsel cpus and threads kan.liang
2015-08-21 13:54 ` Jiri Olsa
2015-08-31 20:31   ` Arnaldo Carvalho de Melo
2015-08-31 21:06     ` Liang, Kan
2015-08-31 21:14       ` Arnaldo Carvalho de Melo
2015-08-31 21:28         ` Liang, Kan
2015-08-31 21:34           ` Arnaldo Carvalho de Melo
2015-09-01  8:31 ` [tip:perf/urgent] perf evlist: Open " tip-bot for Kan Liang
2015-09-03 13:34   ` Adrian Hunter
2015-09-03 15:27     ` Arnaldo Carvalho de Melo
2015-09-03 16:23       ` Adrian Hunter
2015-09-03 16:41         ` Arnaldo Carvalho de Melo
2015-09-03 18:19           ` Jiri Olsa
2015-09-03 18:38             ` Adrian Hunter
2015-09-03 19:04               ` Jiri Olsa
2015-09-03 20:41             ` Arnaldo Carvalho de Melo
2015-09-04  7:05               ` Jiri Olsa
2015-09-04  7:09                 ` Adrian Hunter
2015-09-04 12:15                   ` [PATCH] perf tools: Fix gaps propagating maps Adrian Hunter
2015-09-04 13:28                     ` Arnaldo Carvalho de Melo
2015-09-04 13:42                       ` Adrian Hunter
2015-09-04 14:48                         ` 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=20150904144815.GD2570@redhat.com \
    --to=acme@redhat.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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

Powered by JetHome