Prev: [PATCH 0/3] p9auth fs: introduction
Next: 2.6.33.3-rt16: WARNING: at fs/namespace.c:1197 umount_tree+0x127/0x175()
From: Steven Rostedt on 27 Apr 2010 17:00 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 -- Steve > + } > + -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Chase Douglas on 27 Apr 2010 17:10 On Tue, Apr 27, 2010 at 4:50 PM, Steven Rostedt <rostedt(a)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. -- Chase -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Steven Rostedt on 27 Apr 2010 18:20
On Tue, 2010-04-27 at 17:06 -0400, Chase Douglas wrote: > On Tue, Apr 27, 2010 at 4:50 PM, Steven Rostedt <rostedt(a)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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |