[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e955e3b5-08b8-0092-92cc-c59420e3e748@intel.com>
Date: Wed, 9 Feb 2022 15:39:31 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
kvm@...r.kernel.org, H Peter Anvin <hpa@...or.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Leo Yan <leo.yan@...aro.org>
Subject: Re: [PATCH 02/11] perf/x86: Add support for TSC as a perf event clock
On 09/02/2022 15:11, Peter Zijlstra wrote:
> On Wed, Feb 09, 2022 at 10:49:20AM +0200, Adrian Hunter wrote:
>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>> index 82858b697c05..150d2b70a41f 100644
>> --- a/include/uapi/linux/perf_event.h
>> +++ b/include/uapi/linux/perf_event.h
>> @@ -290,6 +290,14 @@ enum {
>> PERF_TXN_ABORT_SHIFT = 32,
>> };
>>
>> +/*
>> + * If supported, clockid value to select an architecture dependent hardware
>> + * clock. Note this means the unit of time is ticks not nanoseconds.
>> + * On x86, this is provided by the rdtsc instruction, and is not
>> + * paravirtualized.
>> + */
>> +#define CLOCK_PERF_HW_CLOCK 0x10000000
>
> This steps on the clockid_t space; are we good with that?
>
> At some point there was talk of dynamic clock ids, that would complicate
> things more than they are today.
There are 16 clock IDs at the moment and perf only supports a few of them.
If there were a conflict in the future, then an attribute bit would be needed
to differentiate the 2 cases: standard clock IDs vs non-standard "perf" clock IDs.
An alternative would be to add that attribute bit now.
Powered by blists - more mailing lists