Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753975AbbBRSAv (ORCPT ); Wed, 18 Feb 2015 13:00:51 -0500 Received: from mail-ig0-f180.google.com ([209.85.213.180]:41906 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbbBRSAu (ORCPT ); Wed, 18 Feb 2015 13:00:50 -0500 MIME-Version: 1.0 In-Reply-To: <1424280109-9801-5-git-send-email-eranian@google.com> References: <1424280109-9801-1-git-send-email-eranian@google.com> <1424280109-9801-5-git-send-email-eranian@google.com> Date: Wed, 18 Feb 2015 10:00:49 -0800 X-Google-Sender-Auth: GZ_LpdUBNyBZX5-gZE_y4OUWHdY Message-ID: Subject: Re: [PATCH v2 4/4] clock: add perf_clock posix clock From: John Stultz To: Stephane Eranian Cc: Linux Kernel Mailing List , acme@redhat.com, Peter Zijlstra , Ingo Molnar , ak@linux.intel.com, Jiri Olsa , namhyung@kernel.org, cel@us.ibm.com, sukadev@linux.vnet.ibm.com, sonnyrao@chromium.org, johnmccutchan@google.com, David Ahern , adrian.hunter@intel.com, pawell.moll@arm.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 39 On Wed, Feb 18, 2015 at 9:21 AM, Stephane Eranian 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 > #include > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/