diff options
Diffstat (limited to 'tools/perf/util/trace-event-parse.c')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 16cf2d51c4e1..64d6e302751a 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -1776,6 +1776,29 @@ static unsigned long long read_size(void *ptr, int size) | |||
1776 | } | 1776 | } |
1777 | } | 1777 | } |
1778 | 1778 | ||
1779 | unsigned long long | ||
1780 | raw_field_value(struct event *event, const char *name, void *data) | ||
1781 | { | ||
1782 | struct format_field *field; | ||
1783 | |||
1784 | field = find_any_field(event, name); | ||
1785 | if (!field) | ||
1786 | return 0ULL; | ||
1787 | |||
1788 | return read_size(data + field->offset, field->size); | ||
1789 | } | ||
1790 | |||
1791 | void *raw_field_ptr(struct event *event, const char *name, void *data) | ||
1792 | { | ||
1793 | struct format_field *field; | ||
1794 | |||
1795 | field = find_any_field(event, name); | ||
1796 | if (!field) | ||
1797 | return NULL; | ||
1798 | |||
1799 | return data + field->offset; | ||
1800 | } | ||
1801 | |||
1779 | static int get_common_info(const char *type, int *offset, int *size) | 1802 | static int get_common_info(const char *type, int *offset, int *size) |
1780 | { | 1803 | { |
1781 | struct event *event; | 1804 | struct event *event; |