[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170419141545.GF19643@krava>
Date: Wed, 19 Apr 2017 16:15:45 +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 6/7] perf report: Show branch type statistics for
stdio mode
On Wed, Apr 19, 2017 at 11:48:13PM +0800, Jin Yao wrote:
SNIP
> +static void branch_type_stat_display(FILE *fp, struct branch_type_stat *stat)
> +{
> + u64 total = 0;
> + int i;
> +
> + for (i = 0; i < PERF_BR_MAX; i++)
> + total += stat->counts[i];
> +
> + if (total == 0)
> + return;
> +
> + fprintf(fp, "\n#");
> + fprintf(fp, "\n# Branch Statistics:");
> + fprintf(fp, "\n#");
> +
> + if (stat->jcc_fwd > 0)
> + fprintf(fp, "\n%12s: %5.1f%%",
> + "JCC forward",
> + 100.0 * (double)stat->jcc_fwd / (double)total);
> +
> + if (stat->jcc_bwd > 0)
> + fprintf(fp, "\n%12s: %5.1f%%",
> + "JCC backward",
> + 100.0 * (double)stat->jcc_bwd / (double)total);
> +
> + if (stat->cross_4k > 0)
> + fprintf(fp, "\n%12s: %5.1f%%",
> + "CROSS_4K",
> + 100.0 * (double)stat->cross_4k / (double)total);
> +
> + if (stat->cross_2m > 0)
> + fprintf(fp, "\n%12s: %5.1f%%",
> + "CROSS_2M",
> + 100.0 * (double)stat->cross_2m / (double)total);
> +
> + for (i = 0; i < PERF_BR_MAX; i++) {
> + if (stat->counts[i] > 0)
> + fprintf(fp, "\n%12s: %5.1f%%",
> + branch_type_name(i),
> + 100.0 *
> + (double)stat->counts[i] / (double)total);
> + }
> +}
could you please also move this one to that new branch.c file
thanks,
jirka
Powered by blists - more mailing lists