From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752896AbbB1W7p (ORCPT ); Sat, 28 Feb 2015 17:59:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbbB1W7o (ORCPT ); Sat, 28 Feb 2015 17:59:44 -0500 Date: Sat, 28 Feb 2015 23:57:51 +0100 From: Jiri Olsa To: Ingo Molnar Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Adrian Hunter , Andi Kleen , Borislav Petkov , David Ahern , He Kuang , Hemant Kumar , Kan Liang , Masami Hiramatsu , Namhyung Kim , Naohiro Aota , Paul Mackerras , Peter Zijlstra , Wang Nan , Yunlong Song , Arnaldo Carvalho de Melo Subject: Re: [PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems Message-ID: <20150228225751.GC13177@krava.redhat.com> References: <1425064989-26440-1-git-send-email-acme@kernel.org> <20150228074746.GA14064@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150228074746.GA14064@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 28, 2015 at 08:49:27AM +0100, Ingo Molnar wrote: SNIP > > 0695e57b9a6a perf tools: Factor features display code > > Firstly, 'factor' isn't a verb we use for code, 'factor out' is. But > it's not really factoring out - it separates the code. Did this title > want to say: > > perf tools: Separate feature display code into three parts > > ? The title was absolutely unreadable. > > Then it introduces two new makefile variables: LIB_FEATURE_TESTS and > VF_FEATURE_TESTS. LIB_FEATURE_TESTS is reasonably self-explanatory, > but wth is VF_FEATURE_TESTS? > > More importantly, why isn't there a _single_ comment explaining their > use in the Makefile - _especially_ since CORE_FEATURE_TESTS is > explained so well, it's not like a bad example had to be followed. > > Using cryptic abbreviations like 'VF' adds insult to injury. It took > me some time to figure out that it probably means 'Verbose Features'. > > New feature detection adds to all these variables so people will just > guess to which to add and why. > > Guys, this particular change was rushed and not explained well enough, > and it made debugging from that point on harder. Please slow down a > bit. agreed, sry about that.. I'll try to clean it up while moving features detection into tools/ as you suggested before > > > SNIP > diff --git a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c > index 0a0d3ecb4e8a..85ab83e6a42f 100644 > --- a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c > +++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c > @@ -5,10 +5,12 @@ int main(void) > { > int ret = 0; > pthread_attr_t thread_attr; > + cpu_set_t cpu_mask; > > pthread_attr_init(&thread_attr); > - /* don't care abt exact args, just the API itself in libpthread */ > - ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL); > + CPU_ZERO(&cpu_mask); > + > + ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_mask), &cpu_mask); I think Arnaldo got this one covered in perf/urgent already, but I might have missed something.. jirka