[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121218154710.GN1283@krava.brq.redhat.com>
Date: Tue, 18 Dec 2012 16:47:10 +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>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH 07/14] perf ui/hist: Add support for event group view
On Mon, Dec 17, 2012 at 03:38:58PM +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@....com>
>
> Show group members' overhead also when showing the leader's if event
> group is enabled. Use macro for defining hpp functions which looks
> almost identical.
SNIP
> -
> -static int hpp__color_overhead_us(struct perf_hpp_fmt *fmt __maybe_unused,
> - struct perf_hpp *hpp, struct hist_entry *he)
> +static int __hpp__percent_fmt(struct perf_hpp *hpp, struct hist_entry *he,
> + u64 (*get_field)(struct hist_entry *),
> + const char *fmt, hpp_snprint_fn print_fn)
it's hard to tell from diff, but the function looks like this (group part):
if (symbol_conf.event_group) {
int prev_idx, idx_delta, i;
struct perf_evsel *evsel = hists_to_evsel(hists);
struct hist_entry *pair;
int nr_members = evsel->nr_members;
if (nr_members <= 1)
return ret;
prev_idx = perf_evsel__group_idx(evsel);
list_for_each_entry(pair, &he->pairs.head, pairs.node) {
u64 period = get_field(pair);
u64 total = pair->hists->stats.total_period;
if (!total)
continue;
evsel = hists_to_evsel(pair->hists);
idx_delta = perf_evsel__group_idx(evsel) - prev_idx - 1;
for (i = 0; i < idx_delta; i++) {
ret += print_fn(hpp->buf + ret, hpp->size - ret,
fmt, 0.0);
}
ret += print_fn(hpp->buf + ret, hpp->size - ret,
fmt, 100.0 * period / total);
prev_idx += 1 + idx_delta;
}
idx_delta = nr_members - prev_idx - 1;
for (i = 0; i < idx_delta; i++) {
ret += print_fn(hpp->buf + ret, hpp->size - ret,
fmt, 0.0);
}
}
The temporary array (initial send) was more clear to me.. but if
this is the preffered way I wont object, since this is another place
that would benefit from hist_entries array linking.. when (and if)
there's ever patch for that ;-)
I think this code now suffers from mischosen data layer
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