lkml.org 
[lkml]   [2013]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 5/8] tools lib traceevent: Have bprintk output the same as the kernel does
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The trace_bprintk() in the kernel looks like:

ring_buffer_producer_thread: Missed: 0
ring_buffer_producer_thread: Hit: 62174350
ring_buffer_producer_thread: Entries per millisec: 6296
ring_buffer_producer_thread: 158 ns per entry
ring_buffer_producer_thread: Sleeping for 10 secs
ring_buffer_producer_thread: Starting ring buffer hammer
ring_buffer_producer_thread: End ring buffer hammer

But the current output looks like this:

ring_buffer_producer_thread : Time: 9407018 (usecs)
ring_buffer_producer_thread : Overruns: 43285485
ring_buffer_producer_thread : Read: 4405365 (by events)
ring_buffer_producer_thread : Entries: 0
ring_buffer_producer_thread : Total: 47690850
ring_buffer_producer_thread : Missed: 0
ring_buffer_producer_thread : Hit: 47690850

Remove the space between the function and the colon.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/lib/traceevent/event-parse.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 0a1ffe0..e1c743c 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3802,8 +3802,8 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
if (asprintf(&arg->atom.atom, "%lld", ip) < 0)
goto out_free;

- /* skip the first "%pf : " */
- for (ptr = fmt + 6, bptr = data + field->offset;
+ /* skip the first "%pf: " */
+ for (ptr = fmt + 5, bptr = data + field->offset;
bptr < data + size && *ptr; ptr++) {
int ls = 0;

@@ -3929,12 +3929,12 @@ get_bprint_format(void *data, int size __maybe_unused,

printk = find_printk(pevent, addr);
if (!printk) {
- if (asprintf(&format, "%%pf : (NO FORMAT FOUND at %llx)\n", addr) < 0)
+ if (asprintf(&format, "%%pf: (NO FORMAT FOUND at %llx)\n", addr) < 0)
return NULL;
return format;
}

- if (asprintf(&format, "%s : %s", "%pf", printk->printk) < 0)
+ if (asprintf(&format, "%s: %s", "%pf", printk->printk) < 0)
return NULL;

return format;
--
1.8.4.rc3



\
 
 \ /
  Last update: 2013-11-01 23:21    [W:0.106 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site