diff mbox series

[trace-cmd,2.9] libtraceevent: Fix %zd and %Zd processing

Message ID 20220224105736.124d84d0@gandalf.local.home (mailing list archive)
State Accepted
Headers show
Series [trace-cmd,2.9] libtraceevent: Fix %zd and %Zd processing | expand

Commit Message

Steven Rostedt Feb. 24, 2022, 3:57 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The 'z' option in printf is to handle the long case. To print as 32 bit on
32 bit architectures and 64 bit on 64 bit architectures. But currently it
is simply ignored in the printf formatting.

Link: https://lore.kernel.org/all/20220223160318.09b7c4eb@gandalf.local.home/

Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Fixes: d78f5f2d3d25 ("Initial addition of trace-cmd files.")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 lib/traceevent/event-parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 63b6e0c19e2c..b9b699e9acee 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5522,9 +5522,11 @@  static int parse_arg_format(struct tep_print_parse **parse,
 		case 'L':
 			ls = 2;
 			break;
-		case '.':
 		case 'z':
 		case 'Z':
+			ls = 1;
+			break;
+		case '.':
 		case '0' ... '9':
 		case '-':
 			break;