From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753249AbbCAQua (ORCPT ); Sun, 1 Mar 2015 11:50:30 -0500 Received: from terminus.zytor.com ([198.137.202.10]:60235 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbbCAQuS (ORCPT ); Sun, 1 Mar 2015 11:50:18 -0500 Date: Sun, 1 Mar 2015 08:50:04 -0800 From: tip-bot for Adrian Hunter Message-ID: Cc: mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, jolsa@redhat.com, linux-kernel@vger.kernel.org, eranian@google.com, adrian.hunter@intel.com, hpa@zytor.com Reply-To: hpa@zytor.com, adrian.hunter@intel.com, eranian@google.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@redhat.com, mingo@kernel.org, acme@redhat.com In-Reply-To: <1424774766-24194-1-git-send-email-adrian.hunter@intel.com> References: <1424774766-24194-1-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tools: Fix pthread_attr_setaffinity_np build error Git-Commit-ID: 95a09cfa3cdf94231ce511f1697754482b918d39 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 95a09cfa3cdf94231ce511f1697754482b918d39 Gitweb: http://git.kernel.org/tip/95a09cfa3cdf94231ce511f1697754482b918d39 Author: Adrian Hunter AuthorDate: Tue, 24 Feb 2015 12:46:06 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 25 Feb 2015 12:18:03 -0300 perf tools: Fix pthread_attr_setaffinity_np build error Feature detection for pthread_attr_setaffinity_np was failing, producing this error: In file included from bench/futex-hash.c:17:0: bench/futex.h:73:19: error: conflicting types for ‘pthread_attr_setaffinity_np’ static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr, ^ In file included from bench/futex.h:72:0, from bench/futex-hash.c:17: /usr/include/pthread.h:407:12: note: previous declaration of ‘pthread_attr_setaffinity_np’ was here extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, ^ make[3]: *** [bench/futex-hash.o] Error 1 make[2]: *** [bench] Error 2 make[2]: *** Waiting for unfinished jobs.... This was because compiling test-pthread-attr-setaffinity-np.c failed due to the function arguments: test-pthread-attr-setaffinity-np.c: In function ‘main’: test-pthread-attr-setaffinity-np.c:11:2: warning: null argument where non-null required (argument 3) [-Wnonnull] ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL); ^ So fix the arguments. Signed-off-by: Adrian Hunter Tested-by: Stephane Eranian Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1424774766-24194-1-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 0a0d3ec..2b81b72 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,11 @@ int main(void) { int ret = 0; pthread_attr_t thread_attr; + cpu_set_t cs; 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); + ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs); return ret; }