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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux