summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2009-10-06 01:09:50 -0500
committerIngo Molnar <mingo@elte.hu>2009-10-06 15:04:45 +0200
commit26a50744b21fff65bd754874072857bee8967f4d (patch)
tree4819820f0841090232fcd2525f496f787fd411c7 /tools
parentd9b2002c406011164f245de7a81304625989f1c9 (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.c24
-rw-r--r--tools/perf/util/trace-event.h1
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 55b41b9e383..be8412d699a 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)
if (read_expected(EVENT_OP, (char *)";") < 0)
goto fail_expect;
+ if (read_expected(EVENT_ITEM, (char *)"signed") < 0)
+ goto fail_expect;
+
+ if (read_expected(EVENT_OP, (char *)":") < 0)
+ goto fail_expect;
+
+ if (read_expect_type(EVENT_ITEM, &token))
+ goto fail;
+ if (strtoul(token, NULL, 0))
+ field->flags |= FIELD_IS_SIGNED;
+ free_token(token);
+
+ if (read_expected(EVENT_OP, (char *)";") < 0)
+ goto fail_expect;
+
if (read_expect_type(EVENT_NEWLINE, &token) < 0)
goto fail;
free_token(token);
@@ -2845,6 +2860,15 @@ static void parse_header_field(char *type,
free_token(token);
if (read_expected(EVENT_OP, (char *)";") < 0)
return;
+ if (read_expected(EVENT_ITEM, (char *)"signed") < 0)
+ return;
+ if (read_expected(EVENT_OP, (char *)":") < 0)
+ return;
+ if (read_expect_type(EVENT_ITEM, &token) < 0)
+ return;
+ free_token(token);
+ if (read_expected(EVENT_OP, (char *)";") < 0)
+ return;
if (read_expect_type(EVENT_NEWLINE, &token) < 0)
return;
free_token(token);
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 162c3e6deb9..00b440df66d 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -26,6 +26,7 @@ enum {
enum format_flags {
FIELD_IS_ARRAY = 1,
FIELD_IS_POINTER = 2,
+ FIELD_IS_SIGNED = 4,
};
struct format_field {