From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbbC0Rf2 (ORCPT ); Fri, 27 Mar 2015 13:35:28 -0400 Received: from mail-ig0-f174.google.com ([209.85.213.174]:35348 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbbC0Rf1 (ORCPT ); Fri, 27 Mar 2015 13:35:27 -0400 Message-ID: <551594DD.7050705@gmail.com> Date: Fri, 27 Mar 2015 11:35:25 -0600 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Peter Zijlstra CC: tglx@linutronix.de, acme@redhat.com, jolsa@redhat.com, eranian@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, hpa@zytor.com, akpm@linux-foundation.org, mingo@kernel.org Subject: Re: [PATCH] perf, record: Add clockid parameter References: <20150327143201.GG21418@twins.programming.kicks-ass.net> <55158F25.9040100@gmail.com> <20150327172059.GK23123@twins.programming.kicks-ass.net> In-Reply-To: <20150327172059.GK23123@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/27/15 11:20 AM, Peter Zijlstra wrote: >> This is a new feature which means use_clockid on older kernels will fail. So >> need to catch that and throw an error -- perhaps yet another probe function. > > How does that work? What do I grep to find an example? I figured if the > kernel didn't support the syscall will fail and we'll terminate > someplace. > Look at __perf_evsel__open(). In this case you probably do not want to fallback but tell the user the clock id option is not supported. The problem is deciphering the failure is due to the clock id versus all the other failure reasons.