diff options
| -rw-r--r-- | tools/perf/util/symbol.c | 11 | ||||
| -rw-r--r-- | tools/perf/util/symbol.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 3cb928e51a99..a194702a0a2f 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
| @@ -450,6 +450,17 @@ struct symbol *dso__next_symbol(struct symbol *sym) | |||
| 450 | return symbols__next(sym); | 450 | return symbols__next(sym); |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | struct symbol *symbol__next_by_name(struct symbol *sym) | ||
| 454 | { | ||
| 455 | struct symbol_name_rb_node *s = container_of(sym, struct symbol_name_rb_node, sym); | ||
| 456 | struct rb_node *n = rb_next(&s->rb_node); | ||
| 457 | |||
| 458 | return n ? &rb_entry(n, struct symbol_name_rb_node, rb_node)->sym : NULL; | ||
| 459 | } | ||
| 460 | |||
| 461 | /* | ||
| 462 | * Teturns first symbol that matched with @name. | ||
| 463 | */ | ||
| 453 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, | 464 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, |
| 454 | const char *name) | 465 | const char *name) |
| 455 | { | 466 | { |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 9d602e9c6f59..1650dcb3a67b 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
| @@ -231,6 +231,7 @@ struct symbol *dso__find_symbol(struct dso *dso, enum map_type type, | |||
| 231 | u64 addr); | 231 | u64 addr); |
| 232 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, | 232 | struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type, |
| 233 | const char *name); | 233 | const char *name); |
| 234 | struct symbol *symbol__next_by_name(struct symbol *sym); | ||
| 234 | 235 | ||
| 235 | struct symbol *dso__first_symbol(struct dso *dso, enum map_type type); | 236 | struct symbol *dso__first_symbol(struct dso *dso, enum map_type type); |
| 236 | struct symbol *dso__next_symbol(struct symbol *sym); | 237 | struct symbol *dso__next_symbol(struct symbol *sym); |
