Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169630
b: refs/heads/master
c: 9e03eb2
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 16, 2009
1 parent 06a81db commit b8097cc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 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: 37562eac3767c7f07bb1a1329708ff6453e47570
refs/heads/master: 9e03eb2d512e7f3a1e562d4b922aa8b1891750b6
30 changes: 26 additions & 4 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,21 @@ int build_id__sprintf(u8 *self, int len, char *bf)
return raw - self;
}

size_t dso__fprintf(struct dso *self, FILE *fp)
size_t dso__fprintf_buildid(struct dso *self, FILE *fp)
{
char sbuild_id[BUILD_ID_SIZE * 2 + 1];
struct rb_node *nd;
size_t ret;

build_id__sprintf(self->build_id, sizeof(self->build_id), sbuild_id);
ret = fprintf(fp, "dso: %s (%s)\n", self->short_name, sbuild_id);
return fprintf(fp, "%s", sbuild_id);
}

size_t dso__fprintf(struct dso *self, FILE *fp)
{
struct rb_node *nd;
size_t ret = fprintf(fp, "dso: %s (", self->short_name);

ret += dso__fprintf_buildid(self, fp);
ret += fprintf(fp, ")\n");

for (nd = rb_first(&self->syms); nd; nd = rb_next(nd)) {
struct symbol *pos = rb_entry(nd, struct symbol, rb_node);
Expand Down Expand Up @@ -1428,6 +1435,21 @@ void dsos__fprintf(FILE *fp)
dso__fprintf(pos, fp);
}

size_t dsos__fprintf_buildid(FILE *fp)
{
struct dso *pos;
size_t ret = 0;

list_for_each_entry(pos, &dsos, node) {
ret += dso__fprintf_buildid(pos, fp);
if (verbose)
ret += fprintf(fp, " %s\n", pos->long_name);
else
ret += fprintf(fp, "\n");
}
return ret;
}

int load_kernel(symbol_filter_t filter)
{
if (dsos__load_kernel(vmlinux_name, filter, modules) <= 0)
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ int dsos__load_kernel(const char *vmlinux, symbol_filter_t filter, int modules);
struct dso *dsos__findnew(const char *name);
int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
void dsos__fprintf(FILE *fp);
size_t dsos__fprintf_buildid(FILE *fp);

size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
size_t dso__fprintf(struct dso *self, FILE *fp);
char dso__symtab_origin(const struct dso *self);
void dso__set_build_id(struct dso *self, void *build_id);
Expand Down

0 comments on commit b8097cc

Please sign in to comment.