aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2015-11-16 17:25:16 -0500
committerSteven Rostedt <rostedt@goodmis.org>2016-02-09 14:23:05 -0500
commitbf1417bc8967fe15b0d8586e33f11ffb03eda627 (patch)
tree4b5ada2abfb50da34fa9c8054751e89a426d6165
parentd25035856947616efbce541c2f6021461949b8ea (diff)
downloadtrace-cmd-bf1417bc8967fe15b0d8586e33f11ffb03eda627.tar.gz
tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines
When a long value is read on 32 bit machines for 64 bit output, the parsing needs to change "%lu" into "%llu", as the value is read natively. Unfortunately, if "%llu" is already there, the code will add another "l" to it and fail to parse it properly. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--event-parse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/event-parse.c b/event-parse.c
index c2bb418b..e3b026a3 100644
--- a/event-parse.c
+++ b/event-parse.c
@@ -4969,13 +4969,12 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
sizeof(long) != 8) {
char *p;
- ls = 2;
/* make %l into %ll */
- p = strchr(format, 'l');
- if (p)
+ if (ls == 1 && (p = strchr(format, 'l')))
memmove(p+1, p, strlen(p)+1);
else if (strcmp(format, "%p") == 0)
strcpy(format, "0x%llx");
+ ls = 2;
}
switch (ls) {
case -2: