Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182479
b: refs/heads/master
c: 3846df2
h: refs/heads/master
i:
  182477: 5a4e13d
  182475: 6a0a50f
  182471: e462fac
  182463: 1ed8cb2
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Feb 25, 2010
1 parent f208cca commit 5d15425
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 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: c7ad21af2c8b7accb893a576b100296c61c5d610
refs/heads/master: 3846df2e0a99a2bf10023de0e9c1496592012d4c
5 changes: 5 additions & 0 deletions trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#include <stdio.h>
#include "debug.h"

const char *map_type__name[MAP__NR_TYPES] = {
[MAP__FUNCTION] = "Functions",
[MAP__VARIABLE] = "Variables",
};

static inline int is_anon_memory(const char *filename)
{
return strcmp(filename, "//anon") == 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ enum map_type {

#define MAP__NR_TYPES (MAP__VARIABLE + 1)

extern const char *map_type__name[MAP__NR_TYPES];

struct dso;
struct ref_reloc_sym;
struct map_groups;
Expand Down
16 changes: 14 additions & 2 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp)
struct rb_node *nd;
size_t ret = fprintf(fp, "dso: %s (", self->short_name);

if (self->short_name != self->long_name)
ret += fprintf(fp, "%s, ", self->long_name);
ret += fprintf(fp, "%s, %sloaded, ", map_type__name[type],
self->loaded ? "" : "NOT ");
ret += dso__fprintf_buildid(self, fp);
ret += fprintf(fp, ")\n");
for (nd = rb_first(&self->symbols[type]); nd; nd = rb_next(nd)) {
Expand Down Expand Up @@ -1580,6 +1584,9 @@ static int dso__load_vmlinux(struct dso *self, struct map *map,
err = dso__load_sym(self, map, vmlinux, fd, filter, 0);
close(fd);

if (err > 0)
pr_debug("Using %s for symbols\n", vmlinux);

return err;
}

Expand All @@ -1594,7 +1601,6 @@ int dso__load_vmlinux_path(struct dso *self, struct map *map,
for (i = 0; i < vmlinux_path__nr_entries; ++i) {
err = dso__load_vmlinux(self, map, vmlinux_path[i], filter);
if (err > 0) {
pr_debug("Using %s for symbols\n", vmlinux_path[i]);
dso__set_long_name(self, strdup(vmlinux_path[i]));
break;
}
Expand Down Expand Up @@ -1661,12 +1667,16 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,

if (asprintf(&kallsyms_allocated_filename,
"%s/.debug/[kernel.kallsyms]/%s",
getenv("HOME"), sbuild_id) == -1)
getenv("HOME"), sbuild_id) == -1) {
pr_err("Not enough memory for kallsyms file lookup\n");
return -1;
}

kallsyms_filename = kallsyms_allocated_filename;

if (access(kallsyms_filename, F_OK)) {
pr_err("No kallsyms or vmlinux with build-id %s "
"was found\n", sbuild_id);
free(kallsyms_allocated_filename);
return -1;
}
Expand All @@ -1680,6 +1690,8 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,

do_kallsyms:
err = dso__load_kallsyms(self, kallsyms_filename, map, filter);
if (err > 0)
pr_debug("Using %s for symbols\n", kallsyms_filename);
free(kallsyms_allocated_filename);

out_try_fixup:
Expand Down
5 changes: 0 additions & 5 deletions trunk/tools/perf/util/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ int thread__comm_len(struct thread *self)
return self->comm_len;
}

static const char *map_type__name[MAP__NR_TYPES] = {
[MAP__FUNCTION] = "Functions",
[MAP__VARIABLE] = "Variables",
};

static size_t __map_groups__fprintf_maps(struct map_groups *self,
enum map_type type, FILE *fp)
{
Expand Down

0 comments on commit 5d15425

Please sign in to comment.