aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/annotate-data.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/annotate-data.h')
-rw-r--r--tools/perf/util/annotate-data.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h
index 1b0db8e8c40e..ad6493ea2c8e 100644
--- a/tools/perf/util/annotate-data.h
+++ b/tools/perf/util/annotate-data.h
@@ -8,6 +8,7 @@
#include <linux/types.h>
struct annotated_op_loc;
+struct debuginfo;
struct evsel;
struct map_symbol;
@@ -73,6 +74,35 @@ extern struct annotated_data_type unknown_type;
extern struct annotated_data_type stackop_type;
/**
+ * struct data_loc_info - Data location information
+ * @ms: Map and Symbol info
+ * @ip: Instruction address
+ * @var_addr: Data address (for global variables)
+ * @var_name: Variable name (for global variables)
+ * @op: Instruction operand location (regs and offset)
+ * @di: Debug info
+ * @fbreg: Frame base register
+ * @fb_cfa: Whether the frame needs to check CFA
+ * @type_offset: Final offset in the type
+ */
+struct data_loc_info {
+ /* These are input field, should be filled by caller */
+ struct map_symbol *ms;
+ u64 ip;
+ u64 var_addr;
+ const char *var_name;
+ struct annotated_op_loc *op;
+
+ /* These are used internally */
+ struct debuginfo *di;
+ int fbreg;
+ bool fb_cfa;
+
+ /* This is for the result */
+ int type_offset;
+};
+
+/**
* struct annotated_data_stat - Debug statistics
* @total: Total number of entry
* @no_sym: No symbol or map found
@@ -106,9 +136,7 @@ extern struct annotated_data_stat ann_data_stat;
#ifdef HAVE_DWARF_SUPPORT
/* Returns data type at the location (ip, reg, offset) */
-struct annotated_data_type *find_data_type(struct map_symbol *ms, u64 ip,
- struct annotated_op_loc *loc, u64 addr,
- const char *var_name);
+struct annotated_data_type *find_data_type(struct data_loc_info *dloc);
/* Update type access histogram at the given offset */
int annotated_data_type__update_samples(struct annotated_data_type *adt,
@@ -121,9 +149,7 @@ void annotated_data_type__tree_delete(struct rb_root *root);
#else /* HAVE_DWARF_SUPPORT */
static inline struct annotated_data_type *
-find_data_type(struct map_symbol *ms __maybe_unused, u64 ip __maybe_unused,
- struct annotated_op_loc *loc __maybe_unused,
- u64 addr __maybe_unused, const char *var_name __maybe_unused)
+find_data_type(struct data_loc_info *dloc __maybe_unused)
{
return NULL;
}