Skip to content

Commit f019394

Browse files
rostedtsashalevin
authored andcommitted
tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines
[ Upstream commit 32abc2e ] 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 <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 6649b11 commit f019394

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
@@ -4841,13 +4841,12 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
48414841
sizeof(long) != 8) {
48424842
char *p;
48434843

4844-
ls = 2;
48454844
/* make %l into %ll */
4846-
p = strchr(format, 'l');
4847-
if (p)
4845+
if (ls == 1 && (p = strchr(format, 'l')))
48484846
memmove(p+1, p, strlen(p)+1);
48494847
else if (strcmp(format, "%p") == 0)
48504848
strcpy(format, "0x%llx");
4849+
ls = 2;
48514850
}
48524851
switch (ls) {
48534852
case -2:

0 commit comments

Comments
 (0)