Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147562
b: refs/heads/master
c: a827c87
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed May 28, 2009
1 parent 3c2d631 commit 3f79227
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0085c954140d27937ada29d139c16341075d45e4
refs/heads/master: a827c875f2ebe69c6e6db5e7f112d4beb4d80f01
9 changes: 2 additions & 7 deletions trunk/Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,13 @@ static void dsos__fprintf(FILE *fp)

static int load_kernel(void)
{
int err = -1;
int err;

kernel_dso = dso__new("[kernel]", 0);
if (!kernel_dso)
return -1;

if (vmlinux)
err = dso__load_vmlinux(kernel_dso, vmlinux);

if (err)
err = dso__load_kallsyms(kernel_dso);

err = dso__load_kernel(kernel_dso, vmlinux);
if (err) {
dso__delete(kernel_dso);
kernel_dso = NULL;
Expand Down
17 changes: 15 additions & 2 deletions trunk/Documentation/perf_counter/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -410,7 +410,7 @@ int dso__load(struct dso *self)
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);

Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions trunk/Documentation/perf_counter/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)

struct symbol *dso__find_symbol(struct dso *self, uint64_t ip);

int dso__load_kallsyms(struct dso *self);
int dso__load_vmlinux(struct dso *self, const char *vmlinux);
int dso__load_kernel(struct dso *self, const char *vmlinux);
int dso__load(struct dso *self);

size_t dso__fprintf(struct dso *self, FILE *fp);
Expand Down

0 comments on commit 3f79227

Please sign in to comment.