tools/perf: Add '__rel_loc' event field parsing support
Add new '__rel_loc' dynamic data location attribute support. This type attribute is similar to the '__data_loc' but records the offset from the field itself. The libtraceevent adds TEP_FIELD_IS_RELATIVE to the 'tep_format_field::flags' with TEP_FIELD_IS_DYNAMIC for'__rel_loc'. Link: https://lkml.kernel.org/r/163757344810.510314.12449413842136229871.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>
This commit is contained in:
committed by
Steven Rostedt (VMware)
parent
cd7729043b
commit
7c689c8397
@@ -392,6 +392,8 @@ static void perl_process_tracepoint(struct perf_sample *sample,
|
||||
if (field->flags & TEP_FIELD_IS_DYNAMIC) {
|
||||
offset = *(int *)(data + field->offset);
|
||||
offset &= 0xffff;
|
||||
if (field->flags & TEP_FIELD_IS_RELATIVE)
|
||||
offset += field->offset + field->size;
|
||||
} else
|
||||
offset = field->offset;
|
||||
XPUSHs(sv_2mortal(newSVpv((char *)data + offset, 0)));
|
||||
|
||||
Reference in New Issue
Block a user