diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-03 11:31:26 -0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-03 11:31:26 -0200 |
commit | f9e3d4b1a9c86217655997d3ef109b1eaae967bc (patch) | |
tree | bc1a44a2afe2eeeeae050b569a2c7a6fd0f54458 /tools | |
parent | 104268a335d8aeb4293301e26a7bfad964ddc1ca (diff) | |
download | kernel-common-f9e3d4b1a9c86217655997d3ef109b1eaae967bc.tar.gz kernel-common-f9e3d4b1a9c86217655997d3ef109b1eaae967bc.tar.bz2 kernel-common-f9e3d4b1a9c86217655997d3ef109b1eaae967bc.zip |
perf top: Fix live annotation in the --stdio interface
In the old --stdio interface the annotation is done just after one
selects a symbol, while in --tui, now the default when the required libs
are installed, we annotate all symbols with samples so that when
annotation is asked we see what happened recently on that symbol.
To achieve that the --stdio variant checks if the hist_entry being
processed is the one selected by the user via the 's' hotkey. What
happens now that we share the hist_entry abstractions with 'perf report'
is that for minimizing locking contention multiple rb_trees are used,
one for collecting the samples and other to browse/show them after
resorting it by number of samples and decay them, which is done
periodically.
So the simple test in record_precise_ip doesn't work as we move
hist_entries between those rb_trees. To fix it just check that the
underlying struct symbol associated with those hist_entries is the same.
Reported-by: Mike Galbraith <efault@gmx.de>
Tested-by: Mike Galbraith <efault@gmx.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bcfnraqkux88fox9ba9767ds@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-top.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index a13f8870d94c..c9cdedb58134 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -200,7 +200,8 @@ static void record_precise_ip(struct hist_entry *he, int counter, u64 ip) struct symbol *sym; if (he == NULL || he->ms.sym == NULL || - (he != top.sym_filter_entry && use_browser != 1)) + ((top.sym_filter_entry == NULL || + top.sym_filter_entry->ms.sym != he->ms.sym) && use_browser != 1)) return; sym = he->ms.sym; |