diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-10-16 06:41:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-10-19 17:04:01 -0400 |
commit | 1fe7a30028eeccd92e6fccfbeb8c5c3811b11b64 (patch) | |
tree | 8e2a4a120cd27dfb35084e9514bacec97bc2351a /tools/perf/builtin-stat.c | |
parent | f1cbb8f35719e36803f226d1bbf08ac12cedcd76 (diff) |
perf cpu_map: Add data arg to cpu_map__build_map callback
Adding data arg to cpu_map__build_map callback, so we could pass data
along to the callback. It'll be needed in following patches to retrieve
topology info from perf.data.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Kan Liang <kan.liang@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444992092-17897-41-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index abeb15aebd12..91e793a76929 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -944,6 +944,16 @@ static int stat__set_big_num(const struct option *opt __maybe_unused, | |||
944 | return 0; | 944 | return 0; |
945 | } | 945 | } |
946 | 946 | ||
947 | static int perf_stat__get_socket(struct cpu_map *map, int cpu) | ||
948 | { | ||
949 | return cpu_map__get_socket(map, cpu, NULL); | ||
950 | } | ||
951 | |||
952 | static int perf_stat__get_core(struct cpu_map *map, int cpu) | ||
953 | { | ||
954 | return cpu_map__get_core(map, cpu, NULL); | ||
955 | } | ||
956 | |||
947 | static int perf_stat_init_aggr_mode(void) | 957 | static int perf_stat_init_aggr_mode(void) |
948 | { | 958 | { |
949 | switch (stat_config.aggr_mode) { | 959 | switch (stat_config.aggr_mode) { |
@@ -952,14 +962,14 @@ static int perf_stat_init_aggr_mode(void) | |||
952 | perror("cannot build socket map"); | 962 | perror("cannot build socket map"); |
953 | return -1; | 963 | return -1; |
954 | } | 964 | } |
955 | aggr_get_id = cpu_map__get_socket; | 965 | aggr_get_id = perf_stat__get_socket; |
956 | break; | 966 | break; |
957 | case AGGR_CORE: | 967 | case AGGR_CORE: |
958 | if (cpu_map__build_core_map(evsel_list->cpus, &aggr_map)) { | 968 | if (cpu_map__build_core_map(evsel_list->cpus, &aggr_map)) { |
959 | perror("cannot build core map"); | 969 | perror("cannot build core map"); |
960 | return -1; | 970 | return -1; |
961 | } | 971 | } |
962 | aggr_get_id = cpu_map__get_core; | 972 | aggr_get_id = perf_stat__get_core; |
963 | break; | 973 | break; |
964 | case AGGR_NONE: | 974 | case AGGR_NONE: |
965 | case AGGR_GLOBAL: | 975 | case AGGR_GLOBAL: |