Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1237377imu; Fri, 9 Nov 2018 13:08:46 -0800 (PST) X-Google-Smtp-Source: AJdET5cW/kVo1sNxl4SQECatZDAjCoOJYal97BTMQQVj4/bdI2vsCllyIw1dJOLB4Dz2WA2n1PTW X-Received: by 2002:a63:4b60:: with SMTP id k32mr8793084pgl.186.1541797726502; Fri, 09 Nov 2018 13:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541797726; cv=none; d=google.com; s=arc-20160816; b=nOpeXzIVQqCo7ccsB0HPbXce0NQWS8+HF0J2QpalmxPZf17IZvbj23Xco4bLZPdERH XHCxIBrwV1fGivt9iyoyrvzg44sGD6Vn6mBwBx1vnjt4WmZ7m0+VmL7Vu02cywHEuGOC n5DjOYxWzOAu/bpgd9xoPEUY4gJYVoTx5yqIbBNcjZa3FNCAs5ZxvoBByp53Nd5nwgYH aH0KM9iIXURaVBO4ZFp1VwZqvOKB5mlPXLevLeNxxU1FCpNojPyK14ES+W+UJk6Yc7o7 CD8hq4qdRvthhrlhKJtVDId5uTvUduMet+Vm+DSZEFRTBzUU5lvuG73aCOfQCRWx6ACJ ROKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OrA9URgylIDHh1SL5BiAZZ5Bj0dFFQ/iNoArldKMzFQ=; b=OPH1TPIYGNKvtKwxM0KDaYKJDJ7WALAG6Q3QMApSJJbno59MtKz18QEI4iHGHaGztP QLbkGAg7EGBOj6h9q6rgdWDT4a3QjLnj6WvlwT0nZN594BfSCq7ecDf4AKo84ecwZ9tM gKnPkO5o+LHC++i0nj6++LEuGWwtYy8jeNIYHjDdoC3CBMg7sdDcQvwq2IyFEe09MBxv e9rLRGUlG2wynYT7kwb8S+NaRcEeoqQ+7u2vh8c1/wNrPPBgF783yKA3sY4H2jI1F5qX ziGoMkKOSTOJF3eXkG8/S5sziFfoG5GQ5GMxyH90gu7bUG056p7ROmpKl/2iLgBynPVz FFDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d32-v6si9065357pld.238.2018.11.09.13.08.28; Fri, 09 Nov 2018 13:08:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728326AbeKJGtq (ORCPT + 99 others); Sat, 10 Nov 2018 01:49:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:36084 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725799AbeKJGtq (ORCPT ); Sat, 10 Nov 2018 01:49:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F1270AE25; Fri, 9 Nov 2018 21:07:25 +0000 (UTC) Date: Fri, 9 Nov 2018 13:07:19 -0800 From: Davidlohr Bueso To: Arnaldo Carvalho de Melo Cc: akpm@linux-foundation.org, jbaron@akamai.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 1/2] perf-bench: Add epoll parallel epoll_wait benchmark Message-ID: <20181109210719.pr7ohayuwqmfp2wl@linux-r8p5> References: <20181106152226.20883-1-dave@stgolabs.net> <20181106152226.20883-2-dave@stgolabs.net> <20181106182349.thdkpvshkna5vd7o@linux-r8p5> <20181106191325.GM7077@kernel.org> <20181108134500.GA15568@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181108134500.GA15568@kernel.org> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 08 Nov 2018, Arnaldo Carvalho de Melo wrote: >Em Tue, Nov 06, 2018 at 04:13:25PM -0300, Arnaldo Carvalho de Melo escreveu: > CC /tmp/build/perf/bench/futex-lock-pi.o > CC /tmp/build/perf/bench/epoll-wait.o >bench/epoll-wait.c: In function 'do_threads': >bench/epoll-wait.c:345:10: error: implicit declaration of function 'pthread_attr_setaffinity_np' [-Werror=implicit-function-declaration] > ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset); Ah, yes, how about the following? -----8<----------------------------------------------------- perf-bench: Move HAVE_PTHREAD_ATTR_SETAFFINITY_NP into bench.h Both futex and epoll need this call, and can cause build failure on systems that don't have it pthread_attr_setaffinity_np(). Signed-off-by: Davidlohr Bueso --- tools/perf/bench/bench.h | 11 +++++++++++ tools/perf/bench/futex.h | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h index 0e415464931b..fddb3ced9db6 100644 --- a/tools/perf/bench/bench.h +++ b/tools/perf/bench/bench.h @@ -51,4 +51,15 @@ int bench_epoll_ctl(int argc, const char **argv); extern int bench_format; extern unsigned int bench_repeat; +#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP +#include +#include +static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused, + size_t cpusetsize __maybe_unused, + cpu_set_t *cpuset __maybe_unused) +{ + return 0; +} +#endif + #endif diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h index db4853f209c7..31b53cc7d5bc 100644 --- a/tools/perf/bench/futex.h +++ b/tools/perf/bench/futex.h @@ -86,16 +86,4 @@ futex_cmp_requeue(u_int32_t *uaddr, u_int32_t val, u_int32_t *uaddr2, int nr_wak return futex(uaddr, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, uaddr2, val, opflags); } - -#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP -#include -#include -static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused, - size_t cpusetsize __maybe_unused, - cpu_set_t *cpuset __maybe_unused) -{ - return 0; -} -#endif - #endif /* _FUTEX_H */ -- 2.16.4