Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219098

Re: [PATCH] perf tools: Fix gaps propagating maps

From Arnaldo Carvalho de Melo <acme@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf tools: Fix gaps propagating maps
Date 2015-09-04 16:50 +0200
Message-ID <q50ts-53u-15@gated-at.bofh.it> (permalink)
References <q4TrX-3vn-7@gated-at.bofh.it> <q4Y8i-1MD-7@gated-at.bofh.it> <q4Ze4-3lc-53@gated-at.bofh.it> <q4Zxp-3Iu-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] perf,tools: open event on evsel cpus and threads kan.liang@intel.com - 2015-08-21 15:40 +0200
  Re: [PATCH 1/1] perf,tools: open event on evsel cpus and threads Jiri Olsa <jolsa@redhat.com> - 2015-08-21 16:00 +0200
    Re: [PATCH 1/1] perf,tools: open event on evsel cpus and threads Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 22:40 +0200
      RE: [PATCH 1/1] perf,tools: open event on evsel cpus and threads "Liang, Kan" <kan.liang@intel.com> - 2015-08-31 23:10 +0200
        Re: [PATCH 1/1] perf,tools: open event on evsel cpus and threads Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:20 +0200
          RE: [PATCH 1/1] perf,tools: open event on evsel cpus and threads "Liang, Kan" <kan.liang@intel.com> - 2015-08-31 23:30 +0200
            Re: [PATCH 1/1] perf,tools: open event on evsel cpus and threads Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200
  [tip:perf/urgent] perf evlist:   Open event on evsel cpus and threads tip-bot for Kan Liang <tipbot@zytor.com> - 2015-09-01 10:40 +0200
    Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Adrian Hunter <adrian.hunter@intel.com> - 2015-09-03 15:40 +0200
      Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-03 17:30 +0200
        Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Adrian Hunter <adrian.hunter@intel.com> - 2015-09-03 18:30 +0200
          Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-03 18:50 +0200
            Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Jiri Olsa <jolsa@redhat.com> - 2015-09-03 20:20 +0200
              Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Adrian Hunter <adrian.hunter@intel.com> - 2015-09-03 20:40 +0200
                Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Jiri Olsa <jolsa@redhat.com> - 2015-09-03 21:10 +0200
              Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-03 22:50 +0200
                Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Jiri Olsa <jolsa@redhat.com> - 2015-09-04 09:10 +0200
                Re: [tip:perf/urgent] perf evlist: Open event on evsel cpus and  threads Adrian Hunter <adrian.hunter@intel.com> - 2015-09-04 09:20 +0200
                [PATCH] perf tools: Fix gaps propagating maps Adrian Hunter <adrian.hunter@intel.com> - 2015-09-04 14:20 +0200
                Re: [PATCH] perf tools: Fix gaps propagating maps Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-04 15:30 +0200
                Re: [PATCH] perf tools: Fix gaps propagating maps Adrian Hunter <adrian.hunter@intel.com> - 2015-09-04 15:50 +0200
                Re: [PATCH] perf tools: Fix gaps propagating maps Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-04 16:50 +0200

csiph-web