[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170419141538.GE19643@krava>
Date: Wed, 19 Apr 2017 16:15:38 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Jin Yao <yao.jin@...ux.intel.com>
Cc: acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
mingo@...hat.com, alexander.shishkin@...ux.intel.com,
Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
kan.liang@...el.com, yao.jin@...el.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v5 7/7] perf report: Show branch type in callchain entry
On Wed, Apr 19, 2017 at 11:48:14PM +0800, Jin Yao wrote:
SNIP
> +static int count_str_printf(int index, const char *str,
> + char *bf, int bfsize)
> +{
> + int printed;
> +
> + printed = scnprintf(bf, bfsize,
> + "%s%s",
> + (index) ? " " : " (", str);
> +
> + return printed;
> +}
> +
> +static int branch_type_str(struct branch_type_stat *stat,
> + char *bf, int bfsize)
> +{
> + int i, j = 0, printed = 0;
> + u64 total = 0;
> +
> + for (i = 0; i < PERF_BR_MAX; i++)
> + total += stat->counts[i];
> +
> + if (total == 0)
> + return 0;
> +
> + if (stat->jcc_fwd > 0)
> + printed += count_str_printf(j++, "JCC forward",
> + bf + printed, bfsize - printed);
> +
> + if (stat->jcc_bwd > 0)
> + printed += count_str_printf(j++, "JCC backward",
> + bf + printed, bfsize - printed);
> +
> + for (i = 0; i < PERF_BR_MAX; i++) {
> + if (i == PERF_BR_JCC)
> + continue;
> +
> + if (stat->counts[i] > 0)
> + printed += count_str_printf(j++, branch_type_name(i),
> + bf + printed, bfsize - printed);
> + }
> +
> + if (stat->cross_4k > 0)
> + printed += count_str_printf(j++, "CROSS_4K",
> + bf + printed, bfsize - printed);
> +
> + if (stat->cross_2m > 0)
> + printed += count_str_printf(j++, "CROSS_2M",
> + bf + printed, bfsize - printed);
> +
> + return printed;
> +}
could you please also move this one to that new branch.c file
thanks,
jirka
Powered by blists - more mailing lists