summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-c2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-c2c.c')
-rw-r--r--tools/perf/builtin-c2c.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index e3776f5c2e01..b09b12e0976b 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -20,12 +20,15 @@
20#include <sys/param.h> 20#include <sys/param.h>
21#include "debug.h" 21#include "debug.h"
22#include "builtin.h" 22#include "builtin.h"
23#include <subcmd/pager.h>
23#include <subcmd/parse-options.h> 24#include <subcmd/parse-options.h>
25#include "map_symbol.h"
24#include "mem-events.h" 26#include "mem-events.h"
25#include "session.h" 27#include "session.h"
26#include "hist.h" 28#include "hist.h"
27#include "sort.h" 29#include "sort.h"
28#include "tool.h" 30#include "tool.h"
31#include "cacheline.h"
29#include "data.h" 32#include "data.h"
30#include "event.h" 33#include "event.h"
31#include "evlist.h" 34#include "evlist.h"
@@ -34,6 +37,9 @@
34#include "thread.h" 37#include "thread.h"
35#include "mem2node.h" 38#include "mem2node.h"
36#include "symbol.h" 39#include "symbol.h"
40#include "ui/ui.h"
41#include "ui/progress.h"
42#include "../perf.h"
37 43
38struct c2c_hists { 44struct c2c_hists {
39 struct hists hists; 45 struct hists hists;
@@ -248,7 +254,7 @@ static void compute_stats(struct c2c_hist_entry *c2c_he,
248static int process_sample_event(struct perf_tool *tool __maybe_unused, 254static int process_sample_event(struct perf_tool *tool __maybe_unused,
249 union perf_event *event, 255 union perf_event *event,
250 struct perf_sample *sample, 256 struct perf_sample *sample,
251 struct perf_evsel *evsel, 257 struct evsel *evsel,
252 struct machine *machine) 258 struct machine *machine)
253{ 259{
254 struct c2c_hists *c2c_hists = &c2c.hists; 260 struct c2c_hists *c2c_hists = &c2c.hists;
@@ -1106,7 +1112,7 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
1106 break; 1112 break;
1107 case 1: 1113 case 1:
1108 { 1114 {
1109 int num = bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt); 1115 int num = bitmap_weight(set, c2c.cpus_cnt);
1110 struct c2c_stats *stats = &c2c_he->node_stats[node]; 1116 struct c2c_stats *stats = &c2c_he->node_stats[node];
1111 1117
1112 ret = scnprintf(hpp->buf, hpp->size, "%2d{%2d ", node, num); 1118 ret = scnprintf(hpp->buf, hpp->size, "%2d{%2d ", node, num);
@@ -2027,7 +2033,7 @@ static int setup_nodes(struct perf_session *session)
2027 c2c.node_info = 2; 2033 c2c.node_info = 2;
2028 2034
2029 c2c.nodes_cnt = session->header.env.nr_numa_nodes; 2035 c2c.nodes_cnt = session->header.env.nr_numa_nodes;
2030 c2c.cpus_cnt = session->header.env.nr_cpus_online; 2036 c2c.cpus_cnt = session->header.env.nr_cpus_avail;
2031 2037
2032 n = session->header.env.numa_nodes; 2038 n = session->header.env.numa_nodes;
2033 if (!n) 2039 if (!n)
@@ -2049,7 +2055,7 @@ static int setup_nodes(struct perf_session *session)
2049 c2c.cpu2node = cpu2node; 2055 c2c.cpu2node = cpu2node;
2050 2056
2051 for (node = 0; node < c2c.nodes_cnt; node++) { 2057 for (node = 0; node < c2c.nodes_cnt; node++) {
2052 struct cpu_map *map = n[node].map; 2058 struct perf_cpu_map *map = n[node].map;
2053 unsigned long *set; 2059 unsigned long *set;
2054 2060
2055 set = bitmap_alloc(c2c.cpus_cnt); 2061 set = bitmap_alloc(c2c.cpus_cnt);
@@ -2059,7 +2065,7 @@ static int setup_nodes(struct perf_session *session)
2059 nodes[node] = set; 2065 nodes[node] = set;
2060 2066
2061 /* empty node, skip */ 2067 /* empty node, skip */
2062 if (cpu_map__empty(map)) 2068 if (perf_cpu_map__empty(map))
2063 continue; 2069 continue;
2064 2070
2065 for (cpu = 0; cpu < map->nr; cpu++) { 2071 for (cpu = 0; cpu < map->nr; cpu++) {
@@ -2236,8 +2242,8 @@ static void print_pareto(FILE *out)
2236 2242
2237static void print_c2c_info(FILE *out, struct perf_session *session) 2243static void print_c2c_info(FILE *out, struct perf_session *session)
2238{ 2244{
2239 struct perf_evlist *evlist = session->evlist; 2245 struct evlist *evlist = session->evlist;
2240 struct perf_evsel *evsel; 2246 struct evsel *evsel;
2241 bool first = true; 2247 bool first = true;
2242 2248
2243 fprintf(out, "=================================================\n"); 2249 fprintf(out, "=================================================\n");
@@ -2567,7 +2573,7 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
2567 return parse_callchain_report_opt(arg); 2573 return parse_callchain_report_opt(arg);
2568} 2574}
2569 2575
2570static int setup_callchain(struct perf_evlist *evlist) 2576static int setup_callchain(struct evlist *evlist)
2571{ 2577{
2572 u64 sample_type = perf_evlist__combined_sample_type(evlist); 2578 u64 sample_type = perf_evlist__combined_sample_type(evlist);
2573 enum perf_call_graph_mode mode = CALLCHAIN_NONE; 2579 enum perf_call_graph_mode mode = CALLCHAIN_NONE;