summaryrefslogtreecommitdiff
path: root/tools/lib/traceevent/parse-filter.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2021-11-22 18:30:40 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-12-06 15:37:22 -0500
commitcd7729043b31b32b34daaa6775e255b76de7f976 (patch)
tree974ff6c1c5c3ab0443469c4cfd33fa0e6a87345f /tools/lib/traceevent/parse-filter.c
parentb466b13321648d3bd7bfceb9afcba5302b585cf8 (diff)
libtraceevent: Add __rel_loc relative location attribute support
Add '__rel_loc' new dynamic data location attribute which encodes the data location from the next to the field itself. This is similar to the '__data_loc' but the location offset is not from the event entry but from the next of the field. This patch adds '__rel_loc' decoding support in the libtraceevent. Link: https://lkml.kernel.org/r/163757343994.510314.13241077597729303802.stgit@devnote2 Cc: Beau Belgrave <beaub@linux.microsoft.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Tom Zanussi <zanussi@kernel.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/lib/traceevent/parse-filter.c')
-rw-r--r--tools/lib/traceevent/parse-filter.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 368826bb5a57..5df177070d53 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1712,8 +1712,11 @@ static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *
if (arg->str.field->flags & TEP_FIELD_IS_DYNAMIC) {
addr = *(unsigned int *)val;
- val = record->data + (addr & 0xffff);
size = addr >> 16;
+ addr &= 0xffff;
+ if (arg->str.field->flags & TEP_FIELD_IS_RELATIVE)
+ addr += arg->str.field->offset + arg->str.field->size;
+ val = record->data + addr;
}
/*