Re: [PATCH] sched_clock: Add option to use absolute time against hardware clock reset
From: Feng Tang
Date: Mon Sep 07 2026 - 07:23:54 EST
On Mon, Sep 07, 2026 at 10:37:03AM +0100, Marc Zyngier wrote:
[...]
> > - pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lluns\n",
> > - bits, r, r_unit, res, wrap);
> > + /* Calculate the time since last counter resetting to 0 */
> > + reset_ns = mul_u64_u64_div_u64(new_epoch, NSEC_PER_SEC, rate);
> > +
> > + pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lluns, has run %lluns since counter reset\n",
> > + bits, r, r_unit, res, wrap, reset_ns);
> >
> > /* Enable IRQ time accounting if we have a fast enough sched_clock() */
> > if (irqtime > 0 || (irqtime == -1 && rate >= 1000000))
> >
>
> Which is what people have done locally since the beginning of times.
> And the only time this is actually useful is when bringing up new
> HW/FW that is broken.
>
> So why the need to put that in an upstream kernel, instead of being as
> part of your debug toolbox? I don't think the kernel shouldn't be the
> recipient of this sort of stuff.
I see your point now, thanks!
- Feng
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.