diff options
| author | Namhyung Kim <[email protected]> | 2024-03-19 05:51:03 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2024-03-21 13:41:28 +0000 |
| commit | 1ebb5e17ef21b492ee60654d4e22cbfb3763661f (patch) | |
| tree | 5a28fb9c6f5ecdab00c96b5655f11bed3b69cb73 /tools/perf/util/annotate-data.h | |
| parent | perf annotate-data: Add update_insn_state() (diff) | |
| download | kernel-1ebb5e17ef21b492ee60654d4e22cbfb3763661f.tar.gz kernel-1ebb5e17ef21b492ee60654d4e22cbfb3763661f.zip | |
perf annotate-data: Add get_global_var_type()
Accessing global variable is common when it tracks execution later.
Factor out the common code into a function for later use.
It adds thread and cpumode to struct data_loc_info to find (global)
symbols if needed. Also remove var_name as it's retrieved in the
helper function.
Signed-off-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate-data.h')
| -rw-r--r-- | tools/perf/util/annotate-data.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h index 7324cafe2c7b..acfbd1748d02 100644 --- a/tools/perf/util/annotate-data.h +++ b/tools/perf/util/annotate-data.h @@ -11,6 +11,7 @@ struct annotated_op_loc; struct debuginfo; struct evsel; struct map_symbol; +struct thread; /** * struct annotated_member - Type of member field @@ -76,10 +77,11 @@ extern struct annotated_data_type stackop_type; /** * struct data_loc_info - Data location information * @arch: CPU architecture info + * @thread: Thread info * @ms: Map and Symbol info * @ip: Instruction address * @var_addr: Data address (for global variables) - * @var_name: Variable name (for global variables) + * @cpumode: CPU execution mode * @op: Instruction operand location (regs and offset) * @di: Debug info * @fbreg: Frame base register @@ -89,10 +91,11 @@ extern struct annotated_data_type stackop_type; struct data_loc_info { /* These are input field, should be filled by caller */ struct arch *arch; + struct thread *thread; struct map_symbol *ms; u64 ip; u64 var_addr; - const char *var_name; + u8 cpumode; struct annotated_op_loc *op; /* These are used internally */ |
