From 46f51b1d190430f22d5c2739bd9f59f08f862915 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 20 Oct 2009 15:08:29 -0200 Subject: [PATCH] --- yaml --- r: 169529 b: refs/heads/master c: 8f0b037398a909ccf703ad5f5803066db6327f22 h: refs/heads/master i: 169527: a77a42ef8f95aebf0d2140d4113144780c6809f1 v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-annotate.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index eb0dd5c8d3e6..0093cd114bb7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e42049926ebdcae24fdfdc8f0e3ff8f05f24a60b +refs/heads/master: 8f0b037398a909ccf703ad5f5803066db6327f22 diff --git a/trunk/tools/perf/builtin-annotate.c b/trunk/tools/perf/builtin-annotate.c index 245692530de1..99bac6aa72c4 100644 --- a/trunk/tools/perf/builtin-annotate.c +++ b/trunk/tools/perf/builtin-annotate.c @@ -57,7 +57,8 @@ static const char *sym_hist_filter; static int symbol_filter(struct map *map, struct symbol *sym) { - if (strcmp(sym->name, sym_hist_filter) == 0) { + if (sym_hist_filter == NULL || + strcmp(sym->name, sym_hist_filter) == 0) { struct sym_priv *priv = dso__sym_priv(map->dso, sym); const int size = (sizeof(*priv->hist) + (sym->end - sym->start) * sizeof(u64)); @@ -581,7 +582,6 @@ static void annotate_sym(struct hist_entry *he) static void find_annotations(void) { struct rb_node *nd; - int count = 0; for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) { struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node); @@ -595,7 +595,6 @@ static void find_annotations(void) continue; annotate_sym(he); - count++; /* * Since we have a hist_entry per IP for the same symbol, free * he->sym->hist to signal we already processed this symbol. @@ -603,9 +602,6 @@ static void find_annotations(void) free(priv->hist); priv->hist = NULL; } - - if (!count) - printf(" Error: symbol '%s' not present amongst the samples.\n", sym_hist_filter); } static int __cmd_annotate(void) @@ -793,9 +789,6 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used) sym_hist_filter = argv[0]; } - if (!sym_hist_filter) - usage_with_options(annotate_usage, options); - setup_pager(); if (field_sep && *field_sep == '.') {