diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/symbol.c | 17 | ||||
| -rw-r--r-- | tools/perf/util/symbol.h | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 156ae36dfcfc..eb06746b06b2 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
| @@ -342,6 +342,16 @@ static struct symbol *symbols__first(struct rb_root *symbols) | |||
| 342 | return NULL; | 342 | return NULL; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | static struct symbol *symbols__next(struct symbol *sym) | ||
| 346 | { | ||
| 347 | struct rb_node *n = rb_next(&sym->rb_node); | ||
| 348 | |||
| 349 | if (n) | ||
| 350 | return rb_entry(n, struct symbol, rb_node); | ||
| 351 | |||
| 352 | return NULL; | ||
| 353 | } | ||
| 354 | |||
| 345 | struct symbol_name_rb_node { | 355 | struct symbol_name_rb_node { |
| 346 | struct rb_node rb_node; | 356 | struct rb_node rb_node; |
| 347 | struct symbol sym; | 357 | struct symbol sym; |
| @@ -412,11 +422,16 @@ struct symbol *dso__find_symbol(struct dso *dso, | |||
| 412 | return symbols__find(&dso->symbols[type], addr); | 422 | return symbols__find(&dso->symbols[type], addr); |
| 413 | } | 423 | } |
| 414 | 424 | ||
| 415 | static struct symbol *dso__first_symbol(struct dso *dso, enum map_type type) | 425 | struct symbol *dso__first_symbol(struct dso *dso, enum map_type type) |
| 416 | { | 426 | { |
| 417 | return symbols__first(&dso->symbols[type]); | 427 | return symbols__first(&dso->symbols[type]); |
| 418 | } | 428 | } |
| 419 | 429 | ||
| 430 | struct symbol *dso__next_symbol(struct symbol *sym) | ||
| 431 | { | ||
| 432 | return symbols__next(sym); | ||
| 433 | } | ||
| 434 | |||
| 420 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, | 435 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, |
| 421 | const char *name) | 436 | const char *name) |
| 422 | { | 437 | { |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 436169dd1d84..ee2d3ccd3ad1 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
| @@ -240,6 +240,9 @@ struct symbol *dso__find_symbol(struct dso *dso, enum map_type type, | |||
| 240 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, | 240 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, |
| 241 | const char *name); | 241 | const char *name); |
| 242 | 242 | ||
| 243 | struct symbol *dso__first_symbol(struct dso *dso, enum map_type type); | ||
| 244 | struct symbol *dso__next_symbol(struct symbol *sym); | ||
| 245 | |||
| 243 | int filename__read_build_id(const char *filename, void *bf, size_t size); | 246 | int filename__read_build_id(const char *filename, void *bf, size_t size); |
| 244 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); | 247 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); |
| 245 | int modules__parse(const char *filename, void *arg, | 248 | int modules__parse(const char *filename, void *arg, |
