From 931f0b3674150bf8c89f76ac8748a9851e5b17db Mon Sep 17 00:00:00 2001 From: "ashok.vairavan" Date: Wed, 6 Jul 2016 08:13:41 -0700 Subject: [PATCH] perf tools: add --sym-lookup arg to enable symbol lookup in hugepage shm segment Orabug: 23278057 A command line flag -l, --sym-lookup is added to Perf tool to enable symbol lookup in hugepage shm segment. Perf tool without -l option exhibits the default behavior of upstream. Signed-off-by: avairava@ca-server1.us.oracle.com --- tools/perf/builtin-record.c | 2 ++ tools/perf/builtin-report.c | 2 ++ tools/perf/util/map.c | 3 ++- tools/perf/util/map.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 520c7c1518c8..5b09e04592a4 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -888,6 +888,8 @@ struct option __record_options[] = { &record_parse_callchain_opt), OPT_INCR('v', "verbose", &verbose, "be more verbose (show counter open errors, etc)"), + OPT_BOOLEAN('l', "sysv-lookup", &include_sysv_lookup, + "do symbol lookup in SYSV memory"), OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"), OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat, "per thread counts"), diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index b63aeda719be..f81fc89007ae 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -618,6 +618,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "input file name"), OPT_INCR('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"), + OPT_BOOLEAN('l', "sysv-lookup", &include_sysv_lookup, + "do symbol lookup in SYSV memory"), OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"), OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index a14f08f41686..5fb2c426be65 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -16,6 +16,7 @@ #include "machine.h" #include +bool include_sysv_lookup = false; const char *map_type__name[MAP__NR_TYPES] = { [MAP__FUNCTION] = "Functions", [MAP__VARIABLE] = "Variables", @@ -31,7 +32,7 @@ static inline int is_anon_memory(const char *filename) static inline int is_no_dso_memory(const char *filename) { return !strncmp(filename, "[stack", 6) || - !strncmp(filename, "/SYSV",5) || + (!include_sysv_lookup && !strncmp(filename, "/SYSV", 5)) || !strcmp(filename, "[heap]"); } diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index ec19c59ca38e..e2ba05a1d99d 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -16,6 +16,7 @@ enum map_type { #define MAP__NR_TYPES (MAP__VARIABLE + 1) extern const char *map_type__name[MAP__NR_TYPES]; +extern bool include_sysv_lookup; struct dso; struct ip_callchain; -- 2.50.1