[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ef32d5e-594a-43a4-ae5c-e8ad05a2d320@redhat.com>
Date: Fri, 10 Jan 2025 10:09:14 +0000 (UTC)
From: Gabriele Monaco <gmonaco@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Kan Liang <kan.liang@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 1/2] perf ftrace: Check min/max latency only with bucket
range
2025-01-10T00:46:49Z Namhyung Kim <namhyung@...nel.org>:
> On Thu, Jan 09, 2025 at 08:53:02AM +0100, Gabriele Monaco wrote:
>> On Wed, 2025-01-08 at 13:00 -0800, Namhyung Kim wrote:
>>> It's an optional feature and remains 0 when bucket range is not
>>> given.
>>> And it makes the histogram goes to the last entry always because any
>>> latency (num) is greater than or equal to 0.
>>
>> Thanks Namhyung for fixing this, something definitely slipped while
>> testing..
>>
>> I confirm your patches work well also when the bucket range is provided but the
>> min latency isn't.
>>
>> I'm wondering if it would be cleaner to propagate your changes (using
>> min/max latency only if bucket_range is provided) also to
>> make_histogram. That function currently works since we assume
>> min_latency to be always 0, which is the case but probably not
>> considering it altogether would look a bit better and prevent some
>> headache in the future.
>
> It looks good. One thing I concern is 'num += min_latency' before
> do_inc. I put it there to make it symmetric to 'num -= min_latency'
> so it should go to inside the block too.
>
> Or you could factor it out as a function like 'i = get_bucket_index(num)'
> so that it can keep the original num for the stats.
>
Good point, I can have a deeper look at that. But I'd say it can come as a cleanup patch later.
I have a couple more changes in mind and this would be no longer related to your changes.
Thanks,
Gabriele
Powered by blists - more mailing lists