Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411294 > unrolled thread

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

Started byNilay Vaish <nilayvaish@gmail.com>
First post2016-06-01 17:00 +0200
Last post2016-06-02 16:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas Nilay Vaish <nilayvaish@gmail.com> - 2016-06-01 17:00 +0200
    Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas Andi Kleen <ak@linux.intel.com> - 2016-06-01 17:00 +0200
      Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas Nilay Vaish <nilayvaish@gmail.com> - 2016-06-02 14:10 +0200
        Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas Andi Kleen <andi@firstfloor.org> - 2016-06-02 16:30 +0200

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

FromNilay Vaish <nilayvaish@gmail.com>
Date2016-06-01 17:00 +0200
SubjectRe: [PATCH 2/4] perf stat: Add computation of TopDown formulas
Message-ID<rFfMJ-1eo-17@gated-at.bofh.it>
On 24 May 2016 at 14:52, Andi Kleen <andi@firstfloor.org> 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

[toc] | [next] | [standalone]


#1411297

FromAndi Kleen <ak@linux.intel.com>
Date2016-06-01 17:00 +0200
Message-ID<rFfMJ-1eo-15@gated-at.bofh.it>
In reply to#1411294
On Wed, Jun 01, 2016 at 09:50:07AM -0500, Nilay Vaish wrote:
> On 24 May 2016 at 14:52, Andi Kleen <andi@firstfloor.org> 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?

You mean the if statement?

Otherwise if nothing was measured it would always report everything backend bound,
which wouldn't be correct.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

[toc] | [prev] | [next] | [standalone]


#1412174

FromNilay Vaish <nilayvaish@gmail.com>
Date2016-06-02 14:10 +0200
Message-ID<rFzBM-5Mk-39@gated-at.bofh.it>
In reply to#1411297
Andi,  I am talking about the if statement.  I don't know why it would
happen that nothing got measured.  I am guessing you saw it happen.
May be we can add a comment in the patch that it is possible that all
counter values are zero and therefore we need that if statement.

--
Nilay

On 1 June 2016 at 09:56, Andi Kleen <ak@linux.intel.com> wrote:
> On Wed, Jun 01, 2016 at 09:50:07AM -0500, Nilay Vaish wrote:
>> On 24 May 2016 at 14:52, Andi Kleen <andi@firstfloor.org> 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?
>
> You mean the if statement?
>
> Otherwise if nothing was measured it would always report everything backend bound,
> which wouldn't be correct.
>
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only

[toc] | [prev] | [next] | [standalone]


#1412281

FromAndi Kleen <andi@firstfloor.org>
Date2016-06-02 16:30 +0200
Message-ID<rFBNf-71V-15@gated-at.bofh.it>
In reply to#1412174
On Thu, Jun 02, 2016 at 06:56:51AM -0500, Nilay Vaish wrote:
> Andi,  I am talking about the if statement.  I don't know why it would
> happen that nothing got measured.  I am guessing you saw it happen.
> May be we can add a comment in the patch that it is possible that all
> counter values are zero and therefore we need that if statement.

Sure it can happen that nothing got measured, for example if the program
didn't run, or the group didn't get scheduled.

-Andi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web