aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate-data.c
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2024-08-19 23:36:02 +0000
committerArnaldo Carvalho de Melo <[email protected]>2024-08-21 14:48:39 +0000
commit7a5c2170244b4f55588353e68ebbafc249597ee6 (patch)
tree823c5015019f27ae458525212c7200a1e2aa2c9a /tools/perf/ui/browsers/annotate-data.c
parentperf bpf: Remove redundant check that map is NULL (diff)
downloadkernel-7a5c2170244b4f55588353e68ebbafc249597ee6.tar.gz
kernel-7a5c2170244b4f55588353e68ebbafc249597ee6.zip
perf annotate-data: Show offset and size in hex
It'd be better to have them in hex to check cacheline alignment. Percent offset size field 100.00 0 0x1c0 struct cfs_rq { 0.00 0 0x10 struct load_weight load { 0.00 0 0x8 long unsigned int weight; 0.00 0x8 0x4 u32 inv_weight; }; 0.00 0x10 0x4 unsigned int nr_running; 14.56 0x14 0x4 unsigned int h_nr_running; 0.00 0x18 0x4 unsigned int idle_nr_running; 0.00 0x1c 0x4 unsigned int idle_h_nr_running; ... Committer notes: Justification from Namhyung when asked about why it would be "better": Cache line sizes are power of 2 so it'd be natural to use hex and check whether an offset is in the same boundary. Also 'perf annotate' shows instruction offsets in hex. > > Maybe this should be selectable? I can add an option and/or a config if you want. Signed-off-by: Namhyung Kim <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/ui/browsers/annotate-data.c')
-rw-r--r--tools/perf/ui/browsers/annotate-data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
index f563a3bb072c..cd562a8822b7 100644
--- a/tools/perf/ui/browsers/annotate-data.c
+++ b/tools/perf/ui/browsers/annotate-data.c
@@ -427,12 +427,12 @@ static void browser__write(struct ui_browser *uib, void *entry, int row)
/* print type info */
if (be->indent == 0 && !member->var_name) {
- ui_browser__printf(uib, " %10d %10d %s%s",
+ ui_browser__printf(uib, " %#10x %#10x %s%s",
member->offset, member->size,
member->type_name,
list_empty(&member->children) || be->folded? ";" : " {");
} else {
- ui_browser__printf(uib, " %10d %10d %*s%s\t%s%s",
+ ui_browser__printf(uib, " %#10x %#10x %*s%s\t%s%s",
member->offset, member->size,
be->indent * 4, "", member->type_name,
member->var_name ?: "",