diff options
Diffstat (limited to 'tools/perf/builtin-mem.c')
-rw-r--r-- | tools/perf/builtin-mem.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index dedd612eae5e..65465930ef8e 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -4,7 +4,6 @@ #include <sys/stat.h> #include <unistd.h> #include "builtin.h" -#include "perf.h" #include <subcmd/parse-options.h> #include "util/auxtrace.h" @@ -22,6 +21,7 @@ #include "util/pmu-hybrid.h" #include "util/sample.h" #include "util/string2.h" +#include "util/util.h" #include <linux/err.h> #define MEM_OPERATION_LOAD 0x1 @@ -200,6 +200,7 @@ dump_raw_samples(struct perf_tool *tool, struct addr_location al; const char *fmt, *field_sep; char str[PAGE_SIZE_NAME_LEN]; + struct dso *dso = NULL; if (machine__resolve(machine, &al, sample) < 0) { fprintf(stderr, "problem processing %d event, skipping it.\n", @@ -210,8 +211,11 @@ dump_raw_samples(struct perf_tool *tool, if (al.filtered || (mem->hide_unresolved && al.sym == NULL)) goto out_put; - if (al.map != NULL) - al.map->dso->hit = 1; + if (al.map != NULL) { + dso = map__dso(al.map); + if (dso) + dso->hit = 1; + } field_sep = symbol_conf.field_sep; if (field_sep) { @@ -252,7 +256,7 @@ dump_raw_samples(struct perf_tool *tool, symbol_conf.field_sep, sample->data_src, symbol_conf.field_sep, - al.map ? (al.map->dso ? al.map->dso->long_name : "???") : "???", + dso ? dso->long_name : "???", al.sym ? al.sym->name : "???"); out_put: addr_location__put(&al); |