Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas

From: Nilay Vaish
Date: Wed Jun 01 2016 - 10:50:57 EST


On 24 May 2016 at 14:52, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> +static double td_be_bound(int ctx, int cpu)
> +{
> + double sum = (td_fe_bound(ctx, cpu) +
> + td_bad_spec(ctx, cpu) +
> + td_retiring(ctx, cpu));
> + if (sum == 0)
> + return 0;
> + return sanitize_val(1.0 - sum);
> +}
> +

Can you explain why we need the check on sum?

--
Nilay