summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2023-12-12 16:13:13 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-12-23 22:39:42 -0300
commit67bc54bbc5a25c0488cc488558a11c14c10f5f14 (patch)
treef869530891b1d6b805d4f21f4e22462bbd0b4972 /tools/perf/util/annotate.h
parent3a0c26edc3d2f39da3a91eb6eae404253e7ccbaa (diff)
downloadlinux-stable-67bc54bbc5a25c0488cc488558a11c14c10f5f14.tar.gz
linux-stable-67bc54bbc5a25c0488cc488558a11c14c10f5f14.tar.bz2
linux-stable-67bc54bbc5a25c0488cc488558a11c14c10f5f14.zip
perf annotate: Implement hist_entry__get_data_type()
It's the function to find out the type info from the given sample data and will be called from the hist_entry sort logic when 'type' sort key is used. It first calls objdump to disassemble the instructions and figure out information about memory access at the location. Maybe we can do it better by analyzing the instruction directly, but I'll leave it for later work. The memory access is determined by checking instruction operands to have "(" and then extract register name and offset. It'll return NULL if no data type is found. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: linux-toolchains@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Link: https://lore.kernel.org/r/20231213001323.718046-8-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r--tools/perf/util/annotate.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 25ae8893d4f9..6c75b2832286 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -23,6 +23,7 @@ struct option;
struct perf_sample;
struct evsel;
struct symbol;
+struct annotated_data_type;
struct ins {
const char *name;
@@ -475,4 +476,7 @@ struct annotated_insn_loc {
int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl,
struct annotated_insn_loc *loc);
+/* Returns a data type from the sample instruction (if any) */
+struct annotated_data_type *hist_entry__get_data_type(struct hist_entry *he);
+
#endif /* __PERF_ANNOTATE_H */