Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 16:51:49 +0200 Matthias Schiffer wrote: > I mentioned in my commit message was caused by the second MIPS-specific > issue I mentioned in my last mail, so while this method may lead to > inaccurate results [1], and it is certainly not Welford's method, it might > be good enough

Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-27 Thread Matthias Schiffer
On 03/26/2018 06:51 PM, Steven Rostedt wrote: > On Sat, 24 Mar 2018 17:26:38 +0100 > Matthias Schiffer wrote: > >> @@ -905,8 +898,20 @@ static void profile_graph_return(struct >> ftrace_graph_ret *trace) >> >> rec = ftrace_find_profiled_func(stat, trace->func); >> if (rec) { >> +

Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-26 Thread Steven Rostedt
On Sun, 25 Mar 2018 19:09:39 +0200 Matthias Schiffer wrote: > > I have two more questions/issues regarding the generic code: > > 1) There is a small window when enabling the profiler where rec->counter > gets incremented, but profile_graph_return() does not record times yet. For > functions tha

Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-26 Thread Steven Rostedt
On Sat, 24 Mar 2018 17:26:38 +0100 Matthias Schiffer wrote: > @@ -905,8 +898,20 @@ static void profile_graph_return(struct ftrace_graph_ret > *trace) > > rec = ftrace_find_profiled_func(stat, trace->func); > if (rec) { > + unsigned long long avg, delta1, delta2; > + >

Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-25 Thread Matthias Schiffer
On 03/24/2018 11:03 PM, Matthias Schiffer wrote: > On 03/24/2018 05:26 PM, Matthias Schiffer wrote: >> It is well-known that it is not possible to accurately calculate variances >> just by accumulating squared samples; in fact, such an approach can even >> result in negative numbers. An earlier att

Re: [PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-24 Thread Matthias Schiffer
On 03/24/2018 05:26 PM, Matthias Schiffer wrote: > It is well-known that it is not possible to accurately calculate variances > just by accumulating squared samples; in fact, such an approach can even > result in negative numbers. An earlier attempt to fix the calculation > referred to Welford's me

[PATCH] ftrace: fix stddev calculation in function profiler (again)

2018-03-24 Thread Matthias Schiffer
It is well-known that it is not possible to accurately calculate variances just by accumulating squared samples; in fact, such an approach can even result in negative numbers. An earlier attempt to fix the calculation referred to Welford's method, but did not implement it correctly, leading to meea