Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169529
b: refs/heads/master
c: 8f0b037
h: refs/heads/master
i:
  169527: a77a42e
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Oct 20, 2009
1 parent 2b495d5 commit 46f51b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e42049926ebdcae24fdfdc8f0e3ff8f05f24a60b
refs/heads/master: 8f0b037398a909ccf703ad5f5803066db6327f22
11 changes: 2 additions & 9 deletions trunk/tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand All @@ -595,17 +595,13 @@ 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.
*/
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)
Expand Down Expand Up @@ -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 == '.') {
Expand Down

0 comments on commit 46f51b1

Please sign in to comment.