Re: [PATCH v1] perf top: Make zeroing histogram on refresh the default

From: Namhyung Kim
Date: Fri Jun 07 2024 - 14:19:06 EST


On Thu, Jun 06, 2024 at 11:11:38AM -0300, Arnaldo Carvalho de Melo wrote:
> On Thu, Jun 06, 2024 at 10:15:00AM +0530, Ravi Bangoria wrote:
> > On 5/17/2024 3:51 AM, Ian Rogers wrote:
> > > Instead of decaying histograms over time change it so that they are
> > > zero-ed on each perf top refresh. Previously the option '-z', or
> > > pressing 'z' in tui mode, would enable this behavior. Decaying samples
> > > is non-intuitive as it isn't how "top" works. Make zeroing on refresh
> > > the default and rename the command line options from 'z' to 'Z' and
> > > 'zero' to 'decay'.
>
> > I've also felt `perf top` decay as non-intuitive. Esp. when system becomes
> > idle after some heavy workload, even decayed samples are far more compared
> > to samples from currently running processes and thus `perf top` keeps
> > showing already finished processes at the top, which is kind of confusing.
> > fwiw:
>
> > Acked-by: Ravi Bangoria <ravi.bangoria@xxxxxxx>
>
> Thanks for voicing your opinion, that is really helpful.
>
> Changing tool behaviour can have unintended consequences even when done
> with the best intentions and analysis, that is why I'm wary of doing it.
>
> The --children case generated complaints when we made it the default, so
> we ended up with a ~/.perfconfig option to disable it:
>
> root@number:~# perf config top.children=false
> root@number:~# perf top -g
>
> Or enable explicitely:
>
> root@number:~# perf config top.children=true
> root@number:~# perf top -g
>
> Same thing with the build id cache, where one can disable it using 'perf
> config', etc.
>
> So I'd do this initially with a 'perf config top.refresh=zero' instead
> of changing something so few people complained as not being intuitive
> after all those years of having that default.

This kind of thing happens periodically, I guess we can add some message
to help users to set the default config when it's not set. In TUI, it
can even set the config directly according to the users response.

Thanks,
Namhyung