aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/perf_counter/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/perf_counter/util/symbol.c')
-rw-r--r--Documentation/perf_counter/util/symbol.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/Documentation/perf_counter/util/symbol.c b/Documentation/perf_counter/util/symbol.c
index 7088206244ac..504ac3132019 100644
--- a/Documentation/perf_counter/util/symbol.c
+++ b/Documentation/perf_counter/util/symbol.c
@@ -155,7 +155,7 @@ static int hex2long(char *ptr, unsigned long *long_val)
155 return p - ptr; 155 return p - ptr;
156} 156}
157 157
158int dso__load_kallsyms(struct dso *self) 158static int dso__load_kallsyms(struct dso *self)
159{ 159{
160 struct rb_node *nd, *prevnd; 160 struct rb_node *nd, *prevnd;
161 char *line = NULL; 161 char *line = NULL;
@@ -410,7 +410,7 @@ out:
410 return ret; 410 return ret;
411} 411}
412 412
413int dso__load_vmlinux(struct dso *self, const char *vmlinux) 413static int dso__load_vmlinux(struct dso *self, const char *vmlinux)
414{ 414{
415 int err, fd = open(vmlinux, O_RDONLY); 415 int err, fd = open(vmlinux, O_RDONLY);
416 416
@@ -423,6 +423,19 @@ int dso__load_vmlinux(struct dso *self, const char *vmlinux)
423 return err; 423 return err;
424} 424}
425 425
426int dso__load_kernel(struct dso *self, const char *vmlinux)
427{
428 int err = -1;
429
430 if (vmlinux)
431 err = dso__load_vmlinux(self, vmlinux);
432
433 if (err)
434 err = dso__load_kallsyms(self);
435
436 return err;
437}
438
426void symbol__init(void) 439void symbol__init(void)
427{ 440{
428 elf_version(EV_CURRENT); 441 elf_version(EV_CURRENT);