aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-01-14 12:47:30 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-01-24 14:40:32 -0500
commitb7c14a0b6a4e3add92e1527a31cb1826f4799248 (patch)
tree8f0c74f0e2250ffb833178fd1c3baf3e0dec7918
parent164c800e42657e586f6fd446b3d8d41cf1f815f1 (diff)
perf symbols: Mark vmlinux filename as allocated
Needs to be marked allocated so memory can be freed when dso is deleted. Signed-off-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1358185650-90848-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/symbol.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index daf95549e7b9..e6432d85b43d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -923,8 +923,10 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
923 filename = dso__build_id_filename(dso, NULL, 0); 923 filename = dso__build_id_filename(dso, NULL, 0);
924 if (filename != NULL) { 924 if (filename != NULL) {
925 err = dso__load_vmlinux(dso, map, filename, filter); 925 err = dso__load_vmlinux(dso, map, filename, filter);
926 if (err > 0) 926 if (err > 0) {
927 dso->lname_alloc = 1;
927 goto out; 928 goto out;
929 }
928 free(filename); 930 free(filename);
929 } 931 }
930 932
@@ -932,6 +934,7 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
932 err = dso__load_vmlinux(dso, map, vmlinux_path[i], filter); 934 err = dso__load_vmlinux(dso, map, vmlinux_path[i], filter);
933 if (err > 0) { 935 if (err > 0) {
934 dso__set_long_name(dso, strdup(vmlinux_path[i])); 936 dso__set_long_name(dso, strdup(vmlinux_path[i]));
937 dso->lname_alloc = 1;
935 break; 938 break;
936 } 939 }
937 } 940 }
@@ -971,6 +974,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map,
971 if (err > 0) { 974 if (err > 0) {
972 dso__set_long_name(dso, 975 dso__set_long_name(dso,
973 strdup(symbol_conf.vmlinux_name)); 976 strdup(symbol_conf.vmlinux_name));
977 dso->lname_alloc = 1;
974 goto out_fixup; 978 goto out_fixup;
975 } 979 }
976 return err; 980 return err;