[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140422164311.GJ1104@krava.brq.redhat.com>
Date: Tue, 22 Apr 2014 18:43:11 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
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/9] perf report: Count number of entries and samples
separately
On Tue, Apr 22, 2014 at 05:49:43PM +0900, Namhyung Kim wrote:
> Those stats are counted counted in multiple places so that they can
> confuse readers of the code. This is a preparation of later change
> and do not intend any functional difference.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
SNIP
>
> /* Non-group events are considered as leader */
> if (symbol_conf.event_group &&
> @@ -526,7 +533,7 @@ static u64 report__collapse_hists(struct report *rep)
>
> ui_progress__finish();
>
> - return nr_samples;
> + return rep->nr_samples;
so this ^^^ is the only usage for rep->nr_samples right?
and the output from report__collapse_hists is used
as a bool if we have at least 1 sample:
nr_samples = report__collapse_hists(rep);
if (session_done())
return 0;
if (nr_samples == 0) {
ui__error("The %s file has no samples!\n", file->path);
return 0;
}
I think report__collapse_hists does not need to return anything
and above code could use (rep->nr_entries > 0) instead, like:
report__collapse_hists(rep);
if (session_done())
return 0;
if (rep->nr_entries == 0) {
ui__error("The %s file has no samples!\n", file->path);
return 0;
}
and we could get rid of rep->nr_samples
thanks,
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