mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Chase Douglas <chase.douglas@canonical.com>
Cc: linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] ftrace: print sample std dev when function profiling
Date: Tue, 27 Apr 2010 18:15:54 -0400	[thread overview]
Message-ID: <1272406554.9739.78.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <y2k40ec3ea41004271406x3727625cwa3c5d628e0e9ad3b@mail.gmail.com>

On Tue, 2010-04-27 at 17:06 -0400, Chase Douglas wrote:
> On Tue, Apr 27, 2010 at 4:50 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > On Mon, 2010-04-26 at 14:02 -0400, Chase Douglas wrote:
> >
> >> +     /* Sample standard deviation (s^2) */
> >> +     if (rec->counter <= 1)
> >> +             stddev = 0;
> >> +     else {
> >> +             stddev = rec->time_squared - rec->counter * avg * avg;
> >> +             do_div(stddev, (rec->counter - 1) * 1000); /* ns^2 -> us^2 */
> >
> > Shouldn't this be:
> >
> >        do_div(stddev, (rec->counter - 1) * 1000000); ?
> >
> > (x / 1000)^2 == x^2 / 1000^2
> 
> The trace_print_graph_duration function divides the value by 1000
> again to display in us units. I could make the comment more clear, but
> I didn't want to make a big fuss over a unit conversion.
> 
> I also figured this out *after* I had some really wrong looking
> numbers :). I made sure this patch produced the correct value after
> two events, so I assume the math is correct.

OK, I see that now. I'll add this patch but I'll also fix the comment.

Thanks,

-- Steve



  reply	other threads:[~2010-04-27 22:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 18:02 Chase Douglas
2010-04-27 20:50 ` Steven Rostedt
2010-04-27 21:06   ` Chase Douglas
2010-04-27 22:15     ` Steven Rostedt [this message]
2010-04-30  8:47 ` [tip:tracing/core] tracing: Show sample std dev in " tip-bot for Chase Douglas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272406554.9739.78.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=chase.douglas@canonical.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®