public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for Steven Rostedt (Red Hat)" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
	mingo@kernel.org, namhyung@kernel.org, fweisbec@gmail.com,
	rostedt@goodmis.org, akpm@linux-foundation.org,
	tglx@linutronix.de
Subject: [tip:perf/core] tools lib traceevent: Have bprintk output the same as the kernel does
Date: Mon, 4 Nov 2013 12:23:01 -0800	[thread overview]
Message-ID: <tip-0883d9d730fc294c3d90ebd190b94e5782ead316@git.kernel.org> (raw)
In-Reply-To: <20131101215501.272654481@goodmis.org>

Commit-ID:  0883d9d730fc294c3d90ebd190b94e5782ead316
Gitweb:     http://git.kernel.org/tip/0883d9d730fc294c3d90ebd190b94e5782ead316
Author:     Steven Rostedt (Red Hat) <rostedt@goodmis.org>
AuthorDate: Fri, 1 Nov 2013 17:53:57 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 4 Nov 2013 14:35:35 -0300

tools lib traceevent: Have bprintk output the same as the kernel does

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>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20131101215501.272654481@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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;

  reply	other threads:[~2013-11-04 20:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 21:53 [PATCH 0/8] tools lib traceevent: Add changes from trace-cmd repo Steven Rostedt
2013-11-01 21:53 ` [PATCH 1/8] tools lib traceevent: Add support for extracting trace_clock in report Steven Rostedt
2013-11-01 21:53 ` [PATCH 2/8] tools lib traceevent: Update printk formats when entered Steven Rostedt
2013-11-04 20:22   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2013-11-01 21:53 ` [PATCH 3/8] tools lib traceevent: If %s is a pointer, check printk formats Steven Rostedt
2013-11-04 20:22   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2013-11-01 21:53 ` [PATCH 4/8] tools lib traceevent: Handle __print_hex(__get_dynamic_array(fieldname), len) Steven Rostedt
2013-11-01 21:53 ` [PATCH 5/8] tools lib traceevent: Have bprintk output the same as the kernel does Steven Rostedt
2013-11-04 20:23   ` tip-bot for Steven Rostedt (Red Hat) [this message]
2013-11-01 21:53 ` [PATCH 6/8] tools lib traceevent: Check for spaces in character array Steven Rostedt
2013-11-04 20:23   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2013-11-01 21:53 ` [PATCH 7/8] tools lib traceevent: Add flags NOHANDLE and PRINTRAW to individual events Steven Rostedt
2013-11-04 20:23   ` [tip:perf/core] " tip-bot for Steven Rostedt
2013-11-01 21:54 ` [PATCH 8/8] tools lib traceevent: Add pevent_print_func_field() helper function Steven Rostedt
2013-11-04 20:23   ` [tip:perf/core] tools lib traceevent: Add pevent_print_func_field () " tip-bot for Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0883d9d730fc294c3d90ebd190b94e5782ead316@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox