diff options
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r-- | tools/perf/util/dso.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 6f7d5a9d6b05..c4374f07603c 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -513,10 +513,16 @@ void dsos__add(struct list_head *head, struct dso *dso) | |||
513 | list_add_tail(&dso->node, head); | 513 | list_add_tail(&dso->node, head); |
514 | } | 514 | } |
515 | 515 | ||
516 | struct dso *dsos__find(struct list_head *head, const char *name) | 516 | struct dso *dsos__find(struct list_head *head, const char *name, bool cmp_short) |
517 | { | 517 | { |
518 | struct dso *pos; | 518 | struct dso *pos; |
519 | 519 | ||
520 | if (cmp_short) { | ||
521 | list_for_each_entry(pos, head, node) | ||
522 | if (strcmp(pos->short_name, name) == 0) | ||
523 | return pos; | ||
524 | return NULL; | ||
525 | } | ||
520 | list_for_each_entry(pos, head, node) | 526 | list_for_each_entry(pos, head, node) |
521 | if (strcmp(pos->long_name, name) == 0) | 527 | if (strcmp(pos->long_name, name) == 0) |
522 | return pos; | 528 | return pos; |
@@ -525,7 +531,7 @@ struct dso *dsos__find(struct list_head *head, const char *name) | |||
525 | 531 | ||
526 | struct dso *__dsos__findnew(struct list_head *head, const char *name) | 532 | struct dso *__dsos__findnew(struct list_head *head, const char *name) |
527 | { | 533 | { |
528 | struct dso *dso = dsos__find(head, name); | 534 | struct dso *dso = dsos__find(head, name, false); |
529 | 535 | ||
530 | if (!dso) { | 536 | if (!dso) { |
531 | dso = dso__new(name); | 537 | dso = dso__new(name); |