[PATCH 1/3] perf: parse greater/less than or equal

From: Hidetoshi Seto
Date: Tue Dec 06 2011 - 20:37:02 EST


Some btrfs tracepoints have complex format like following, but perf
command failed to parse it:

print fmt: "%s", ((REC->id >= min) || (REC->id <= max )) ?
__print_symbolic(REC->id, { 1ULL, "ROOT_TREE" }, ... ) : "-"

$ perf script
Warning: unknown op '>='
Warning: Error: expected type 5 but read 1
Warning: failed to read event print fmt for btrfs_transaction_commit

This patch allow perf command to parse operation tokens, '>=' and '<='.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
---
tools/perf/util/trace-event-parse.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 0a7ed5b..c2adc76 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1229,6 +1229,8 @@ process_op(struct event *event, struct print_arg *arg, char **tok)
strcmp(token, "/") == 0 ||
strcmp(token, "<") == 0 ||
strcmp(token, ">") == 0 ||
+ strcmp(token, "<=") == 0 ||
+ strcmp(token, ">=") == 0 ||
strcmp(token, "==") == 0 ||
strcmp(token, "!=") == 0) {

--
1.7.7.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/