summaryrefslogtreecommitdiff
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)
return p - ptr;
}
-int dso__load_kallsyms(struct dso *self)
+static int dso__load_kallsyms(struct dso *self)
{
struct rb_node *nd, *prevnd;
char *line = NULL;
@@ -410,7 +410,7 @@ out:
return ret;
}
-int dso__load_vmlinux(struct dso *self, const char *vmlinux)
+static int dso__load_vmlinux(struct dso *self, const char *vmlinux)
{
int err, fd = open(vmlinux, O_RDONLY);
@@ -423,6 +423,19 @@ int dso__load_vmlinux(struct dso *self, const char *vmlinux)
return err;
}
+int dso__load_kernel(struct dso *self, const char *vmlinux)
+{
+ int err = -1;
+
+ if (vmlinux)
+ err = dso__load_vmlinux(self, vmlinux);
+
+ if (err)
+ err = dso__load_kallsyms(self);
+
+ return err;
+}
+
void symbol__init(void)
{
elf_version(EV_CURRENT);