[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140123133847.GB1180@krava.brq.redhat.com>
Date: Thu, 23 Jan 2014 14:38:48 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 1/5] perf tools: Count filtered entries to total period
also
On Thu, Jan 23, 2014 at 08:28:49AM +0900, Namhyung Kim wrote:
> Currently if a sample was filtered by command line option, it just
> dropped. But this affects final output in that the percentage can be
> different since the filtered entries were not included to the total.
>
> But user might want to see the original percentages when filter
> applied so change the behavior depends on a new symbol_conf.filter_
> relative value in order to be controlled by user later.
SNIP
> + al->filtered |= (1 << HIST_FILTER__SYMBOL);
>
> -out_filtered:
> - al->filtered = true;
> return 0;
> }
> diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> index e4e6249b87d4..73b999448932 100644
> --- a/tools/perf/util/hist.c
> +++ b/tools/perf/util/hist.c
> @@ -13,13 +13,6 @@ static bool hists__filter_entry_by_thread(struct hists *hists,
> static bool hists__filter_entry_by_symbol(struct hists *hists,
> struct hist_entry *he);
>
> -enum hist_filter {
> - HIST_FILTER__DSO,
> - HIST_FILTER__THREAD,
> - HIST_FILTER__PARENT,
> - HIST_FILTER__SYMBOL,
> -};
it striked me that al.filtered is duplicating he.filtered, so I thought
we could leave just the one in hist_entry.. now I see annotate, diff
and others use al.filtered to skip hist_entry adding/processing
I think there's use for relative/total switch in other places,
and we could actually get rid of the al.filtered and make
the relative switch global (also in config?) .. in the future ;-)
> -
> struct callchain_param callchain_param = {
> .mode = CHAIN_GRAPH_REL,
> .min_percent = 0.5,
> @@ -329,8 +322,9 @@ void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h)
> if (!h->filtered) {
> hists__calc_col_len(hists, h);
> ++hists->nr_entries;
> - hists->stats.total_period += h->stat.period;
> }
> + if (!h->filtered || !symbol_conf.filter_relative)
> + hists->stats.total_period += h->stat.period;
also we could keep both counts and easily switch on in tui/gui
.. in the future ;-)
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists