perf trace beauty mmap: Ignore 'fd' and 'offset' args for MAP_ANONYMOUS
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Jul 2017 15:16:15 +0000 (12:16 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 20 Jul 2017 12:55:51 +0000 (09:55 -0300)
Just suppress them, not used by the kernel.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-atpt07y2x9a8ttlwja94ow3j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/trace/beauty/mmap.c

index af1cfde6b97b12962045d9bc66126c217335ad21..754558f9009db2743e4d1211d25c0cb45f36ceae 100644 (file)
@@ -34,6 +34,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
 {
        int printed = 0, flags = arg->val;
 
+       if (flags & MAP_ANONYMOUS)
+               arg->mask |= (1 << 4) | (1 << 5); /* Mask 4th ('fd') and 5th ('offset') args, ignored */
+
 #define        P_MMAP_FLAG(n) \
        if (flags & MAP_##n) { \
                printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \