[PATCH 16/22] tools lib traceevent: Make the name output optional in pevent_field_info
From: Jiri Olsa
Date: Sun Feb 02 2014 - 16:44:40 EST
Making the name output optional in pevent_field_info function.
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
---
tools/lib/traceevent/event-parse.c | 9 ++++++---
tools/lib/traceevent/event-parse.h | 3 ++-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index a3370f2..7b5b2dc 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4028,13 +4028,16 @@ static int is_printable_array(char *p, unsigned int len)
void pevent_field_info(struct trace_seq *s,
struct format_field *field,
- void *data, int size __maybe_unused)
+ void *data, int size __maybe_unused,
+ bool print_name)
{
struct event_format *event = field->event;
unsigned int offset, len, i;
unsigned long long val;
- trace_seq_printf(s, " %s=", field->name);
+ if (print_name)
+ trace_seq_printf(s, " %s=", field->name);
+
if (field->flags & FIELD_IS_ARRAY) {
offset = field->offset;
len = field->size;
@@ -4100,7 +4103,7 @@ static void print_event_fields(struct trace_seq *s, void *data, int size,
field = event->format.fields;
while (field) {
- pevent_field_info(s, field, data, size);
+ pevent_field_info(s, field, data, size, true);
field = field->next;
}
}
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 73492a9..b49fad1 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -590,7 +590,8 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
void pevent_field_info(struct trace_seq *s,
struct format_field *field,
- void *data, int size);
+ void *data, int size __maybe_unused,
+ bool print_name);
int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size,
int long_size);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/