aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/lib/traceevent/event-parse.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 6d31b6419d37..12a7e2a40c89 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -1939,7 +1939,22 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
1939 goto out_warn_free; 1939 goto out_warn_free;
1940 1940
1941 type = process_arg_token(event, right, tok, type); 1941 type = process_arg_token(event, right, tok, type);
1942 arg->op.right = right; 1942
1943 if (right->type == PRINT_OP &&
1944 get_op_prio(arg->op.op) < get_op_prio(right->op.op)) {
1945 struct print_arg tmp;
1946
1947 /* rotate ops according to the priority */
1948 arg->op.right = right->op.left;
1949
1950 tmp = *arg;
1951 *arg = *right;
1952 *right = tmp;
1953
1954 arg->op.left = right;
1955 } else {
1956 arg->op.right = right;
1957 }
1943 1958
1944 } else if (strcmp(token, "[") == 0) { 1959 } else if (strcmp(token, "[") == 0) {
1945 1960