diff options
author | Tom Zanussi <tzanussi@gmail.com> | 2009-10-06 02:09:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-06 09:04:45 -0400 |
commit | 26a50744b21fff65bd754874072857bee8967f4d (patch) | |
tree | 4819820f0841090232fcd2525f496f787fd411c7 /tools | |
parent | d9b2002c406011164f245de7a81304625989f1c9 (diff) |
tracing/events: Add 'signed' field to format files
The sign info used for filters in the kernel is also useful to
applications that process the trace stream. Add it to the format
files and make it available to userspace.
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: rostedt@goodmis.org
Cc: lizf@cn.fujitsu.com
Cc: hch@infradead.org
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <1254809398-8078-2-git-send-email-tzanussi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 24 | ||||
-rw-r--r-- | tools/perf/util/trace-event.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 55b41b9e3834..be8412d699a1 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -897,6 +897,21 @@ static int event_read_fields(struct event *event, struct format_field **fields) | |||
897 | if (read_expected(EVENT_OP, (char *)";") < 0) | 897 | if (read_expected(EVENT_OP, (char *)";") < 0) |
898 | goto fail_expect; | 898 | goto fail_expect; |
899 | 899 | ||
900 | if (read_expected(EVENT_ITEM, (char *)"signed") < 0) | ||
901 | goto fail_expect; | ||
902 | |||
903 | if (read_expected(EVENT_OP, (char *)":") < 0) | ||
904 | goto fail_expect; | ||
905 | |||
906 | if (read_expect_type(EVENT_ITEM, &token)) | ||
907 | goto fail; | ||
908 | if (strtoul(token, NULL, 0)) | ||
909 | field->flags |= FIELD_IS_SIGNED; | ||
910 | free_token(token); | ||
911 | |||
912 | if (read_expected(EVENT_OP, (char *)";") < 0) | ||
913 | goto fail_expect; | ||
914 | |||
900 | if (read_expect_type(EVENT_NEWLINE, &token) < 0) | 915 | if (read_expect_type(EVENT_NEWLINE, &token) < 0) |
901 | goto fail; | 916 | goto fail; |
902 | free_token(token); | 917 | free_token(token); |
@@ -2845,6 +2860,15 @@ static void parse_header_field(char *type, | |||
2845 | free_token(token); | 2860 | free_token(token); |
2846 | if (read_expected(EVENT_OP, (char *)";") < 0) | 2861 | if (read_expected(EVENT_OP, (char *)";") < 0) |
2847 | return; | 2862 | return; |
2863 | if (read_expected(EVENT_ITEM, (char *)"signed") < 0) | ||
2864 | return; | ||
2865 | if (read_expected(EVENT_OP, (char *)":") < 0) | ||
2866 | return; | ||
2867 | if (read_expect_type(EVENT_ITEM, &token) < 0) | ||
2868 | return; | ||
2869 | free_token(token); | ||
2870 | if (read_expected(EVENT_OP, (char *)";") < 0) | ||
2871 | return; | ||
2848 | if (read_expect_type(EVENT_NEWLINE, &token) < 0) | 2872 | if (read_expect_type(EVENT_NEWLINE, &token) < 0) |
2849 | return; | 2873 | return; |
2850 | free_token(token); | 2874 | free_token(token); |
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index 162c3e6deb93..00b440df66d8 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h | |||
@@ -26,6 +26,7 @@ enum { | |||
26 | enum format_flags { | 26 | enum format_flags { |
27 | FIELD_IS_ARRAY = 1, | 27 | FIELD_IS_ARRAY = 1, |
28 | FIELD_IS_POINTER = 2, | 28 | FIELD_IS_POINTER = 2, |
29 | FIELD_IS_SIGNED = 4, | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | struct format_field { | 32 | struct format_field { |