Skip to content

Commit

Permalink
perf hists: Don't decay total_period for filtered entries
Browse files Browse the repository at this point in the history
Following the 'perf report' model we don't zap hist_entry instances from
the rb tree, we just keep them with he->filtered set to a mask of the
filters applied to it (thread, parent, DSO so far).

In top we need to decay even filtered entries, but we better not touch
total_period for them...

Now everything seems to work when filters are applied on top as they
worked in 'report', i.e. both dynamic and static hist entry browsing
works with filters.

Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
acmel committed Oct 20, 2011

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2cf9ceb commit c64550c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/perf/util/hist.c
Original file line number Diff line number Diff line change
@@ -105,11 +105,16 @@ static void hist_entry__decay(struct hist_entry *he)

static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
{
if (he->period == 0)
u64 prev_period = he->period;

if (prev_period == 0)
return true;
hists->stats.total_period -= he->period;

hist_entry__decay(he);
hists->stats.total_period += he->period;

if (!he->filtered)
hists->stats.total_period -= prev_period - he->period;

return he->period == 0;
}

0 comments on commit c64550c

Please sign in to comment.