From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbbCaHQV (ORCPT ); Tue, 31 Mar 2015 03:16:21 -0400 Received: from casper.infradead.org ([85.118.1.10]:41218 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbbCaHQU (ORCPT ); Tue, 31 Mar 2015 03:16:20 -0400 Date: Tue, 31 Mar 2015 09:16:17 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, acme@redhat.com, mingo@elte.hu, ak@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, cel@us.ibm.com, sukadev@linux.vnet.ibm.com, sonnyrao@chromium.org, johnmccutchan@google.com, dsahern@gmail.com, adrian.hunter@intel.com, pawel.moll@arm.com Subject: Re: [PATCH v6 1/4] perf,record: Add clockid parameter Message-ID: <20150331071617.GP27490@worktop.programming.kicks-ass.net> References: <1427753974-13380-1-git-send-email-eranian@google.com> <1427753974-13380-2-git-send-email-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427753974-13380-2-git-send-email-eranian@google.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2015 at 12:19:31AM +0200, Stephane Eranian wrote: You seem to have misplaced the hunk that goes with the fallback_missing_features: label. > @@ -1122,6 +1132,16 @@ static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, > goto try_fallback; > } > set_rlimit = NO_CHANGE; > + > + /* > + * If we succeeded but had to kill clockid, fail and > + * have perf_evsel__open_strerror() print us a nice > + * error. > + */ > + if (perf_missing_features.clockid) { > + err = -EINVAL; > + goto out_close; > + } > } > } > > @@ -1155,7 +1175,10 @@ static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, > if (err != -EINVAL || cpu > 0 || thread > 0) > goto out_close; > > - if (!perf_missing_features.cloexec && (flags & PERF_FLAG_FD_CLOEXEC)) { > + if (!perf_missing_features.clockid && evsel->attr.use_clockid) { > + perf_missing_features.clockid = true; > + goto fallback_missing_features; > + } else if (!perf_missing_features.cloexec && (flags & PERF_FLAG_FD_CLOEXEC)) { > perf_missing_features.cloexec = true; > goto fallback_missing_features; > } else if (!perf_missing_features.mmap2 && evsel->attr.mmap2) { > @@ -2080,6 +2103,8 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, > if_print(wakeup_events); > if_print(bp_type); > if_print(branch_sample_type); > + if_print(clockid); > + > } > out: > fputc('\n', fp);