Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Commit 6e50dda

Browse files
rostedtgregkh
authored andcommitted
tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines
commit 32abc2e upstream. 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> Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 969624b commit 6e50dda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/lib/traceevent/event-parse.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,13 +4968,12 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
49684968
sizeof(long) != 8) {
49694969
char *p;
49704970

4971-
ls = 2;
49724971
/* make %l into %ll */
4973-
p = strchr(format, 'l');
4974-
if (p)
4972+
if (ls == 1 && (p = strchr(format, 'l')))
49754973
memmove(p+1, p, strlen(p)+1);
49764974
else if (strcmp(format, "%p") == 0)
49774975
strcpy(format, "0x%llx");
4976+
ls = 2;
49784977
}
49794978
switch (ls) {
49804979
case -2:

0 commit comments

Comments
 (0)