lkml.org 
[lkml]   [2015]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH V2 07/14] perf tools: Add evsel->own_cpus
    On Mon, Sep 07, 2015 at 05:27:49PM +0300, Adrian Hunter wrote:
    > perf_evlist__propagate_maps() cannot easily tell if an evsel
    > has its own cpu map. To make that simpler, keep a copy of
    > the PMU cpu map and adjust the propagation logic accordingly.
    >
    > Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    > ---
    > tools/perf/util/evlist.c | 5 ++++-
    > tools/perf/util/evsel.c | 1 +
    > tools/perf/util/evsel.h | 1 +
    > tools/perf/util/parse-events.c | 4 ++--
    > 4 files changed, 8 insertions(+), 3 deletions(-)
    >
    > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
    > index c959c42080e3..6764e0eff849 100644
    > --- a/tools/perf/util/evlist.c
    > +++ b/tools/perf/util/evlist.c
    > @@ -1111,9 +1111,12 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
    > * We already have cpus for evsel (via PMU sysfs) so
    > * keep it, if there's no target cpu list defined.
    > */
    > - if (!evsel->cpus || evlist->has_user_cpus) {
    > + if (!evsel->own_cpus || evlist->has_user_cpus) {
    > cpu_map__put(evsel->cpus);
    > evsel->cpus = cpu_map__get(evlist->cpus);
    > + } else if (evsel->cpus != evsel->own_cpus) {
    > + cpu_map__put(evsel->cpus);
    > + evsel->cpus = cpu_map__get(evsel->own_cpus);

    hum, so (evsel->cpus != evsel->own_cpus) could happen only when:
    - evsel->own_cpus != NULL
    - we overloaded evsel->cpus with evlist->cpus via perf_evlist__propagate_maps
    - we changed evlist->has_user_cpus = false
    - we recall perf_evlist__propagate_maps

    I'm missing usecase for that, or something else ;-)

    thanks,
    jirka


    \
     
     \ /
      Last update: 2015-09-08 09:01    [W:3.471 / U:0.588 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site