Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf c2c report: Add 'cpucnt' sort key

It is to be displayed in the single cacheline output:

cpucnt

It displays number of distinct cpus that hit cacheline.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-ib2kdwam52fby9u2k3ij6lhm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
b6fe2bbc 92062d54

+23
+23
tools/perf/builtin-c2c.c
··· 1015 1015 MEAN_ENTRY(mean_lcl_entry, lcl_hitm); 1016 1016 MEAN_ENTRY(mean_load_entry, load); 1017 1017 1018 + static int 1019 + cpucnt_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp, 1020 + struct hist_entry *he) 1021 + { 1022 + struct c2c_hist_entry *c2c_he; 1023 + int width = c2c_width(fmt, hpp, he->hists); 1024 + char buf[10]; 1025 + 1026 + c2c_he = container_of(he, struct c2c_hist_entry, he); 1027 + 1028 + scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); 1029 + return scnprintf(hpp->buf, hpp->size, "%*s", width, buf); 1030 + } 1031 + 1018 1032 #define HEADER_LOW(__h) \ 1019 1033 { \ 1020 1034 .line[1] = { \ ··· 1355 1341 .width = 8, 1356 1342 }; 1357 1343 1344 + static struct c2c_dimension dim_cpucnt = { 1345 + .header = HEADER_BOTH("cpu", "cnt"), 1346 + .name = "cpucnt", 1347 + .cmp = empty_cmp, 1348 + .entry = cpucnt_entry, 1349 + .width = 8, 1350 + }; 1351 + 1358 1352 static struct c2c_dimension *dimensions[] = { 1359 1353 &dim_dcacheline, 1360 1354 &dim_offset, ··· 1400 1378 &dim_mean_rmt, 1401 1379 &dim_mean_lcl, 1402 1380 &dim_mean_load, 1381 + &dim_cpucnt, 1403 1382 NULL, 1404 1383 }; 1405 1384