Making the name output optional in pevent_field_info function.

Signed-off-by: Jiri Olsa <jo...@redhat.com>
Cc: Corey Ashford <cjash...@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweis...@gmail.com>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Steven Rostedt <rost...@goodmis.org>
Cc: David Ahern <dsah...@gmail.com>
---
 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to