From: tip-bot for Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
rostedt@goodmis.org, wolfgang.mauerer@siemens.com,
tglx@linutronix.de, namhyung@kernel.org
Subject: [tip:perf/core] tools lib traceevent: Fix trace_printk for long integers
Date: Fri, 6 Jul 2012 04:11:49 -0700 [thread overview]
Message-ID: <tip-c5b35b731965d16fa8c966e288489857097e0b25@git.kernel.org> (raw)
In-Reply-To: <1332411501-8059-3-git-send-email-wolfgang.mauerer@siemens.com>
Commit-ID: c5b35b731965d16fa8c966e288489857097e0b25
Gitweb: http://git.kernel.org/tip/c5b35b731965d16fa8c966e288489857097e0b25
Author: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
AuthorDate: Thu, 22 Mar 2012 11:18:21 +0100
Committer: Namhyung Kim <namhyung@kernel.org>
CommitDate: Wed, 4 Jul 2012 13:40:30 +0900
tools lib traceevent: Fix trace_printk for long integers
On 32 bit systems, a conversion of the trace_printk format string
"%lu" -> "%llu" is intended (similar for %lx etc.) when a trace was
taken on a machine with 64 bit long integers. However, the current
code computes the bogus transformation "%lu" -> "%u". Fix this.
Besides that, the transformation is only required on systems that don't
use 64 bits for long integers natively.
Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1332411501-8059-3-git-send-email-wolfgang.mauerer@siemens.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/event-parse.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index da06c33..ddee5a8 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3895,14 +3895,15 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
break;
}
}
- if (pevent->long_size == 8 && ls) {
+ if (pevent->long_size == 8 && ls &&
+ sizeof(long) != 8) {
char *p;
ls = 2;
/* make %l into %ll */
p = strchr(format, 'l');
if (p)
- memmove(p, p+1, strlen(p)+1);
+ memmove(p+1, p, strlen(p)+1);
else if (strcmp(format, "%p") == 0)
strcpy(format, "0x%llx");
}
prev parent reply other threads:[~2012-07-06 11:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 10:18 [PATCH 0/2] Fix ftrace stack traces on x86_64 Wolfgang Mauerer
2012-03-22 10:18 ` [PATCH 1/2] Fix ftrace stack trace entries Wolfgang Mauerer
2012-03-24 7:56 ` [tip:perf/urgent] tracing: " tip-bot for Wolfgang Mauerer
2012-03-22 10:18 ` [PATCH 2/2, trace-cmd] Fix trace_printk for long integers Wolfgang Mauerer
2012-03-23 21:20 ` Steven Rostedt
2012-07-06 11:11 ` tip-bot for Wolfgang Mauerer [this message]
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-c5b35b731965d16fa8c966e288489857097e0b25@git.kernel.org \
--to=wolfgang.mauerer@siemens.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
Powered by JetHome