public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Stephane Eranian <eranian@google.com>
Cc: kan.liang@linux.intel.com, peterz@infradead.org,
	mingo@redhat.com, jstultz@google.com, sboyd@kernel.org,
	linux-kernel@vger.kernel.org, namhyung@kernel.org,
	ak@linux.intel.com
Subject: Re: [PATCH 1/3] timekeeping: NMI safe converter from a given time to monotonic
Date: Fri, 27 Jan 2023 14:30:20 +0100	[thread overview]
Message-ID: <87ilgsgl5f.ffs@tglx> (raw)
In-Reply-To: <CABPqkBSt2WH=zo0_tXNb_Q7waDazvcquXgexXqqn=70A_f4H8Q@mail.gmail.com>

On Tue, Jan 24 2023 at 01:10, Stephane Eranian wrote:
> On Tue, Jan 24, 2023 at 12:52 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>> > It's useful to provide a NMI safe function to convert a given time to
>> > monotonic. For example, the perf_event subsystem wants to convert a TSC
>> > of a PEBS record to a monotonic clock in a NMI handler.
>>
>> Why? That's a postprocessing problem, really.
>>
> Because you want to correlate samples captured by PEBS with samples
> from applications timestamped with a user available clock such as
> CLOCK_MONOTONIC, for instance.

Sure. Postprocessing can do that if the kernel provides the relevant
conversion information. Absolutely no need for doing this in the kernel.

> When I create a perf_event event and I stipulate that
> event_attr.clockid=MONOTONIC, I expect all the samples from that event
> to be timestamped using the same clock source, regardless of PEBS or
> IBS.

Just because the kernel can do the conversion, there is no requirement
to actually do so. Instrumentation has to be as lightweight as possible
and a lot of instrumentation goes the extra mile of doing postprocessing
exactly for this reason.

So if we implement this conversion in the kernel then there needs to be
a compelling technical reason to do so.

So far the provided arguments are in the 'I want a pony' realm.

Thanks,

        tglx

  parent reply	other threads:[~2023-01-27 13:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 18:27 [PATCH 0/3] Convert TSC to monotonic clock for PEBS kan.liang
2023-01-23 18:27 ` [PATCH 1/3] timekeeping: NMI safe converter from a given time to monotonic kan.liang
2023-01-24  7:01   ` John Stultz
2023-01-24 15:09     ` Liang, Kan
2023-01-24 18:43       ` John Stultz
2023-01-24 20:12         ` Liang, Kan
2023-01-24 20:33           ` John Stultz
2023-01-24 22:08             ` Liang, Kan
2023-01-24 22:40               ` John Stultz
2023-01-25 16:44                 ` Liang, Kan
2023-01-24  8:51   ` Thomas Gleixner
2023-01-24  9:10     ` Stephane Eranian
2023-01-24 16:06       ` Liang, Kan
2023-01-27 13:30       ` Thomas Gleixner [this message]
2023-01-23 18:27 ` [PATCH 2/3] x86/tsc: Add set_tsc_system_counterval kan.liang
2023-01-23 18:27 ` [PATCH 3/3] perf/x86/intel/ds: Support monotonic clock for PEBS kan.liang
2023-01-24  6:56   ` John Stultz
2023-01-24 15:17     ` Liang, Kan
2023-01-24  6:13 ` [PATCH 0/3] Convert TSC to " John Stultz
2023-01-24 15:04   ` Liang, Kan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilgsgl5f.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jstultz@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox