diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 15:08:44 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 16:51:09 -0300 |
commit | 7e155d4d5e2912f75443c18c02dd6f1dbd4eef84 (patch) | |
tree | 24bc86c6ee5154cd4556ecf0b4a003683b9303d4 /tools/perf/util/symbol.c | |
parent | 5230fb7db42914e47786a6e920d2624739b0f896 (diff) |
perf symbols: Remove open coded management of long_name_allocated member
Instead of expecting callers to set this member accodingly so that later
at dso destruction it can, if needed, be correctly free()d, make it a
requirement by passing it as a parameter to dso__set_long_name.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-na7t1tqim22vuqkt4zq5n4ri@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 9a5de8837d6d..5029ee1a9421 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1159,7 +1159,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map, dso->data_type = DSO_BINARY_TYPE__GUEST_KCORE; else dso->data_type = DSO_BINARY_TYPE__KCORE; - dso__set_long_name(dso, strdup(kcore_filename)); + dso__set_long_name(dso, strdup(kcore_filename), true); close(fd); @@ -1438,8 +1438,7 @@ int dso__load_vmlinux(struct dso *dso, struct map *map, dso->data_type = DSO_BINARY_TYPE__GUEST_VMLINUX; else dso->data_type = DSO_BINARY_TYPE__VMLINUX; - dso__set_long_name(dso, (char *)vmlinux); - dso->long_name_allocated = vmlinux_allocated; + dso__set_long_name(dso, (char *)vmlinux, vmlinux_allocated); dso__set_loaded(dso, map->type); pr_debug("Using %s for symbols\n", symfs_vmlinux); } @@ -1631,7 +1630,7 @@ do_kallsyms: free(kallsyms_allocated_filename); if (err > 0 && !dso__is_kcore(dso)) { - dso__set_long_name(dso, strdup("[kernel.kallsyms]")); + dso__set_long_name(dso, strdup("[kernel.kallsyms]"), true); map__fixup_start(map); map__fixup_end(map); } @@ -1679,7 +1678,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map, pr_debug("Using %s for symbols\n", kallsyms_filename); if (err > 0 && !dso__is_kcore(dso)) { machine__mmap_name(machine, path, sizeof(path)); - dso__set_long_name(dso, strdup(path)); + dso__set_long_name(dso, strdup(path), true); map__fixup_start(map); map__fixup_end(map); } |