[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANDhNCo-+rV5+2pxAbpX4Lj6EhR9gsP0SqWpipm3j_G_e8cMzw@mail.gmail.com>
Date: Mon, 23 Jan 2023 22:13:45 -0800
From: John Stultz <jstultz@...gle.com>
To: kan.liang@...ux.intel.com
Cc: peterz@...radead.org, mingo@...hat.com, tglx@...utronix.de,
sboyd@...nel.org, linux-kernel@...r.kernel.org, eranian@...gle.com,
namhyung@...nel.org, ak@...ux.intel.com
Subject: Re: [PATCH 0/3] Convert TSC to monotonic clock for PEBS
On Mon, Jan 23, 2023 at 10:27 AM <kan.liang@...ux.intel.com> wrote:
>
> From: Kan Liang <kan.liang@...ux.intel.com>
>
> A Processor Event Based Sampling (PEBS) record includes a field that
> provide the time stamp counter value when the counter was overflowed
> and the PEBS record was generated. The accurate time stamp can be used
> to reconcile user samples. However, the current PEBS codes only can
> convert the time stamp to sched_clock, which is not available from user
> space. A solution to convert a given TSC to user visible monotonic
> clock is required.
>
> The perf_event subsystem only converts the TSC in a NMI handler. The
> converter function must be fast and NMI safe.
>
> Considered the below two existing functions, but none of them fulfill
> the above requirements.
> - The ktime_get_mono_fast_ns() is NMI safe, but it can only return the
> current clock monotonic rather than a given time's monotonic.
> - The get_device_system_crosststamp() can calculate the system time from
> a given device time. But it's not fast and NMI safe.
So, apologies if this is a silly question (my brain quickly evicts the
details on get_device_system_crosststamp every time I look at it), but
rather then introducing a new interface, what would it take to rework
the existing get_device_system_crosststamp() logic to be usable for
both use cases?
thanks
-john
Powered by blists - more mailing lists