From: Arnaldo Carvalho de Melo Date: Thu, 20 Oct 2011 08:45:44 +0000 (-0200) Subject: perf hists: Don't decay total_period for filtered entries X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c64550cfddfdbd7a6f9d5ffb37382a05d7f0306b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf hists: Don't decay total_period for filtered entries 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 Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-yt4xsbq20u9x9ypuwwyw2kao@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 75526d123eb2..1f269fd48944 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -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; }