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>
This commit is contained in:
parent
164c800e42
commit
b7c14a0b6a
1 changed files with 5 additions and 1 deletions
|
@ -923,8 +923,10 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
|
||||||
filename = dso__build_id_filename(dso, NULL, 0);
|
filename = dso__build_id_filename(dso, NULL, 0);
|
||||||
if (filename != NULL) {
|
if (filename != NULL) {
|
||||||
err = dso__load_vmlinux(dso, map, filename, filter);
|
err = dso__load_vmlinux(dso, map, filename, filter);
|
||||||
if (err > 0)
|
if (err > 0) {
|
||||||
|
dso->lname_alloc = 1;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
free(filename);
|
free(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,6 +934,7 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map,
|
||||||
err = dso__load_vmlinux(dso, map, vmlinux_path[i], filter);
|
err = dso__load_vmlinux(dso, map, vmlinux_path[i], filter);
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
dso__set_long_name(dso, strdup(vmlinux_path[i]));
|
dso__set_long_name(dso, strdup(vmlinux_path[i]));
|
||||||
|
dso->lname_alloc = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -971,6 +974,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map,
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
dso__set_long_name(dso,
|
dso__set_long_name(dso,
|
||||||
strdup(symbol_conf.vmlinux_name));
|
strdup(symbol_conf.vmlinux_name));
|
||||||
|
dso->lname_alloc = 1;
|
||||||
goto out_fixup;
|
goto out_fixup;
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Add table
Reference in a new issue