Skip to contentSkip to conversation

libtraceevent: fix parsing event argument types

PATCH RESEND Applied Konstantin Khlebnikov 3 participants 3 messages Nov 10, 2019 – Nov 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 libtraceevent: fix parsing event argument types

Add missing "%o" and "%X". Ext4 events use "%o" for printing i_mode.

---
 tools/lib/traceevent/event-parse.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/lib/traceevent/event-parse.c +5 -2
index d948475585ce..beaa8b8c08ff 100644
@@ -4395,8 +4395,10 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 				/* fall through */
 			case 'd':
 			case 'u':
-			case 'x':
 			case 'i':
+			case 'x':
+			case 'X':
+			case 'o':
 				switch (ls) {
 				case 0:
 					vsize = 4;
@@ -5078,10 +5080,11 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 
 				/* fall through */
 			case 'd':
+			case 'u':
 			case 'i':
 			case 'x':
 			case 'X':
-			case 'u':
+			case 'o':
 				if (!arg) {
 					do_warning_event(event, "no argument match");
 					event->flags |= TEP_EVENT_FL_FAILED;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · On Sun, 10 Nov 2019 13:11:01 +0300 Konstantin Khlebnikov…

Add missing "%o" and "%X". Ext4 events use "%o" for printing i_mode.

Arnaldo, can you take this?

Thanks! (this time I mean it ;)

-- Steve

Quoted 35 lines
---
 tools/lib/traceevent/event-parse.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/lib/traceevent/event-parse.c +5 -2
index d948475585ce..beaa8b8c08ff 100644
@@ -4395,8 +4395,10 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 				/* fall through */
 			case 'd':
 			case 'u':
-			case 'x':
 			case 'i':
+			case 'x':
+			case 'X':
+			case 'o':
 				switch (ls) {
 				case 0:
 					vsize = 4;
@@ -5078,10 +5080,11 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 
 				/* fall through */
 			case 'd':
+			case 'u':
 			case 'i':
 			case 'x':
 			case 'X':
-			case 'u':
+			case 'o':
 				if (!arg) {
 					do_warning_event(event, "no argument match");
 					event->flags |= TEP_EVENT_FL_FAILED;
#2 lore raw

[tip: perf/core] libtraceevent: Fix parsing of event %o and %X argument types

In reply to Konstantin Khlebnikov
The following commit has been merged into the perf/core branch of tip:

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     10f64581b1b79f3b0121c987e9ef272195940bf7
Gitweb:        https://git.kernel.org/tip/10f64581b1b79f3b0121c987e9ef272195940bf7
Author:        Konstantin Khlebnikov <[email protected]>
AuthorDate:    Sun, 10 Nov 2019 13:11:01 +03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Mon, 18 Nov 2019 13:01:59 -03:00

libtraceevent: Fix parsing of event %o and %X argument types

Add missing "%o" and "%X". Ext4 events use "%o" for printing i_mode.

---
 tools/lib/traceevent/event-parse.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/lib/traceevent/event-parse.c +5 -2
index d948475..beaa8b8 100644
@@ -4395,8 +4395,10 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 				/* fall through */
 			case 'd':
 			case 'u':
-			case 'x':
 			case 'i':
+			case 'x':
+			case 'X':
+			case 'o':
 				switch (ls) {
 				case 0:
 					vsize = 4;
@@ -5078,10 +5080,11 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 
 				/* fall through */
 			case 'd':
+			case 'u':
 			case 'i':
 			case 'x':
 			case 'X':
-			case 'u':
+			case 'o':
 				if (!arg) {
 					do_warning_event(event, "no argument match");
 					event->flags |= TEP_EVENT_FL_FAILED;