Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753749AbbBRSLT (ORCPT ); Wed, 18 Feb 2015 13:11:19 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:38484 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753167AbbBRSLR (ORCPT ); Wed, 18 Feb 2015 13:11:17 -0500 Message-ID: <54E4D5C4.1070005@gmail.com> Date: Wed, 18 Feb 2015 11:11:16 -0700 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Stultz , 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, adrian.hunter@intel.com, pawell.moll@arm.com Subject: Re: [PATCH v2 4/4] clock: add perf_clock posix clock References: <1424280109-9801-1-git-send-email-eranian@google.com> <1424280109-9801-5-git-send-email-eranian@google.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 30 On 2/18/15 11:00 AM, John Stultz wrote: > 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? AFAIK Stephane is not proposing this patch for inclusion but rather it is an unfortunate necessary evil. The module exposes perf_clock (ie., local_clock) to userspace and allows in this case the generation of samples with a perf timestamp which is required for proper sorting. I understand this solution is not liked, but it works, requires no kernel modifications to achieve the end goal and can be used for kernels going back to at least 2.6.38 (perhaps earlier, have not checked). David -- 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/