Re: [PATCH v9 01/10] perf record --off-cpu: Add --off-cpu-thresh option

From: Namhyung Kim
Date: Tue Dec 10 2024 - 13:24:27 EST


On Mon, Dec 09, 2024 at 06:24:21PM -0800, Ian Rogers wrote:
> On Mon, Dec 9, 2024 at 4:09 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > Hi Howard,
> >
> > Sorry for the late review.
> >
> > On Thu, Nov 21, 2024 at 08:38:31PM -0800, Howard Chu wrote:
> > > Specify the threshold for dumping offcpu samples with --off-cpu-thresh,
> > > the unit is us (microsecond). Default value is 500,000us (500ms, 0.5s).
> >
> > I guess we mostly care about more than milli-seconds of off-cpu times.
> > Can we change the unit to msec?
>
> I wonder if there should be two values, one for the command line and
> one in the code. I think microseconds make most sense in the code, 1ms
> being roughly 1000 context switches. On the command line millisecond
> would align with perf stat's -I option, and as you point out, users
> aren't usually working at the granularity of a microsecond. Having the
> code be microsecond oriented allows the option to have a more precise
> command line option in the future, autotuning, etc.

I'm fine as long as it has a proper suffix for the unit. :)

Thanks,
Namhyung