[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANcMJZAd=Vmey2sgA4gT8dsa3H4kPXxTGth94tczBS5zQmeQHw@mail.gmail.com>
Date: Wed, 18 Feb 2015 10:00:49 -0800
From: John Stultz <john.stultz@...aro.org>
To: Stephane Eranian <eranian@...gle.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
acme@...hat.com, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>, ak@...ux.intel.com,
Jiri Olsa <jolsa@...hat.com>, namhyung@...nel.org,
cel@...ibm.com, sukadev@...ux.vnet.ibm.com, sonnyrao@...omium.org,
johnmccutchan@...gle.com, David Ahern <dsahern@...il.com>,
adrian.hunter@...el.com, pawell.moll@....com
Subject: Re: [PATCH v2 4/4] clock: add perf_clock posix clock
On Wed, Feb 18, 2015 at 9:21 AM, Stephane Eranian <eranian@...gle.com> wrote:
> This patch is a re-packaging of David's Ahern
> posix perf clock available here:
>
> https://github.com/dsahern/linux/blob/perf-full-monty/README.ahern
>
> The patch itself is based on Pawel Moll's original post:
>
> https://lkml.org/lkml/2013/3/14/523
>
> The new clock is call PERF_CLOCK. To use it
>
> #include <time.h>
> #include <linux/time.h>
>
> struct timespec ts;
>
> clock_gettime(PERF_CLOCK, &ts);
I'd still strongly recommend against exposing the perf clock to
userspace this way. The time domain isn't clearly different from
something like CLOCK_MONOTONIC_RAW and doesn't really have well
defined behavior. We're just exporting "whatever the kernel does
internally" to userspace, and in the past similar internal use clocks
like the sched_clock have changed their behavior, so I'm not confident
the perf clock is really baked enough (including cross architectures)
to make it part of the ABI.
Pawel and others have continued to work on other approaches that allow
for perf events to be interpolated to, or use CLOCK_MONOTONIC itself,
which I don't object to, so you might want to follow up on those?
thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists