aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-annotate.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 245692530de1..99bac6aa72c4 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -57,7 +57,8 @@ static const char *sym_hist_filter;
57 57
58static int symbol_filter(struct map *map, struct symbol *sym) 58static int symbol_filter(struct map *map, struct symbol *sym)
59{ 59{
60 if (strcmp(sym->name, sym_hist_filter) == 0) { 60 if (sym_hist_filter == NULL ||
61 strcmp(sym->name, sym_hist_filter) == 0) {
61 struct sym_priv *priv = dso__sym_priv(map->dso, sym); 62 struct sym_priv *priv = dso__sym_priv(map->dso, sym);
62 const int size = (sizeof(*priv->hist) + 63 const int size = (sizeof(*priv->hist) +
63 (sym->end - sym->start) * sizeof(u64)); 64 (sym->end - sym->start) * sizeof(u64));
@@ -581,7 +582,6 @@ static void annotate_sym(struct hist_entry *he)
581static void find_annotations(void) 582static void find_annotations(void)
582{ 583{
583 struct rb_node *nd; 584 struct rb_node *nd;
584 int count = 0;
585 585
586 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) { 586 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
587 struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node); 587 struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node);
@@ -595,7 +595,6 @@ static void find_annotations(void)
595 continue; 595 continue;
596 596
597 annotate_sym(he); 597 annotate_sym(he);
598 count++;
599 /* 598 /*
600 * Since we have a hist_entry per IP for the same symbol, free 599 * Since we have a hist_entry per IP for the same symbol, free
601 * he->sym->hist to signal we already processed this symbol. 600 * he->sym->hist to signal we already processed this symbol.
@@ -603,9 +602,6 @@ static void find_annotations(void)
603 free(priv->hist); 602 free(priv->hist);
604 priv->hist = NULL; 603 priv->hist = NULL;
605 } 604 }
606
607 if (!count)
608 printf(" Error: symbol '%s' not present amongst the samples.\n", sym_hist_filter);
609} 605}
610 606
611static int __cmd_annotate(void) 607static int __cmd_annotate(void)
@@ -793,9 +789,6 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
793 sym_hist_filter = argv[0]; 789 sym_hist_filter = argv[0];
794 } 790 }
795 791
796 if (!sym_hist_filter)
797 usage_with_options(annotate_usage, options);
798
799 setup_pager(); 792 setup_pager();
800 793
801 if (field_sep && *field_sep == '.') { 794 if (field_sep && *field_sep == '.') {