Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754788AbbBTQBr (ORCPT ); Fri, 20 Feb 2015 11:01:47 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:36787 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbbBTQBq (ORCPT ); Fri, 20 Feb 2015 11:01:46 -0500 Date: Fri, 20 Feb 2015 17:01:24 +0100 From: Peter Zijlstra To: Pawel Moll Cc: "adrian.hunter@intel.com" , "john.stultz@linaro.org" , "mingo@kernel.org" , "eranian@google.com" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "dsahern@gmail.com" , "fweisbec@gmail.com" , "jolsa@redhat.com" , "namhyung@gmail.com" , "paulus@samba.org" , "tglx@linutronix.de" , "rostedt@goodmis.org" , "sonnyrao@chromium.org" , "ak@linux.intel.com" , "vincent.weaver@maine.edu" Subject: Re: [RFC][PATCH 2/2] perf: Add per event clockid support Message-ID: <20150220160124.GQ5029@twins.programming.kicks-ass.net> References: <20150220142930.013968488@infradead.org> <20150220143754.852733868@infradead.org> <1424446129.6259.5.camel@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424446129.6259.5.camel@arm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 35 On Fri, Feb 20, 2015 at 03:28:49PM +0000, Pawel Moll wrote: > On Fri, 2015-02-20 at 14:29 +0000, Peter Zijlstra wrote: > > @@ -334,8 +335,7 @@ struct perf_event_attr { > > */ > > __u32 sample_stack_user; > > > > - /* Align to u64. */ > > - __u32 __reserved_2; > > + __u32 clockid; > > I thought about it, but was sort-of-afraid to propose it :-) > > Now, one thing I'm not 100% sure about it is it being unsigned, as > clockid_t is signed for a reason (negative values have meaning - eg. > dynamic clocks, which could be useful in some circumstances). Of course > casting could be an answer, but is there any reason not to make it > __s32? I did not spot that significance and cannot find mention of it in clock_gettime(2) either, but I've no objection to making it __s32. > > + default: > > + /* XXX add: clock_id_valid() && clock_gettime_ns() ? */ > > + err = -EINVAL; > > + goto err_alloc; > > + } > > If you asked me, I'd say -EINVAL, no default. Yeah, I should probably restructure that a wee bit. -- 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/