perf stat: Pass 'evlist' to aggr_update_shadow()
authorJiri Olsa <jolsa@kernel.org>
Thu, 30 Aug 2018 06:32:39 +0000 (08:32 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 30 Aug 2018 18:52:24 +0000 (15:52 -0300)
Pass a 'evlist' argument to aggr_update_shadow(), to get rid of the
global 'evsel_list' variable dependency.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180830063252.23729-31-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c

index f5ac6545af343fdbf6b716f893102330c63b3407..2711d8f6e4b8f5708ec44e5a323805744eab1c28 100644 (file)
@@ -1099,7 +1099,8 @@ static void printout(struct perf_stat_config *config, int id, int nr,
        }
 }
 
-static void aggr_update_shadow(struct perf_stat_config *config)
+static void aggr_update_shadow(struct perf_stat_config *config,
+                              struct perf_evlist *evlist)
 {
        int cpu, s2, id, s;
        u64 val;
@@ -1107,7 +1108,7 @@ static void aggr_update_shadow(struct perf_stat_config *config)
 
        for (s = 0; s < aggr_map->nr; s++) {
                id = aggr_map->map[s];
-               evlist__for_each_entry(evsel_list, counter) {
+               evlist__for_each_entry(evlist, counter) {
                        val = 0;
                        for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
                                s2 = aggr_get_id(evsel_list->cpus, cpu);
@@ -1238,7 +1239,7 @@ static void print_aggr(struct perf_stat_config *config,
        if (!(aggr_map || aggr_get_id))
                return;
 
-       aggr_update_shadow(config);
+       aggr_update_shadow(config, evlist);
 
        /*
         * With metric_only everything is on a single line.