Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1174481pxb; Thu, 21 Oct 2021 17:37:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyScHmHYVpxV/nwx21RftbESqENHyHVKPwANEfaA5PfFwxxaln7KXPko4+RifaI/ph+DIIZ X-Received: by 2002:a17:906:6bce:: with SMTP id t14mr11167689ejs.546.1634863064912; Thu, 21 Oct 2021 17:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634863064; cv=none; d=google.com; s=arc-20160816; b=vQSwOqWEWzJ+1+jdbWvDD/j6tOKSrwXWT/BRlac34UKK/Zd72/HyTpTh3Pm6cxIj52 qiKF78APHJ0uOBAE17veNZEMyneKRQRIX8IAXM4wquV+5LZ0uKLnsWT+Ro4yEOw0qDo5 8PGbVh8syg/0MiKCpQ+kUDhkASb5x3CbfW2zZ8SLDnzce/ZTxmsrUChjiL3bj24BpSd0 dD8vxsfGJzPdhlj8tcW3wK9P32RBR6+JRD/2d4Mrd/OUva/7umiKOdNB7wEYax1TpVZF on5AVMEj5KSbK4H4OTEufzvFE/Ufb1+nETULPYpa3+RSO8d3odAfg50dlbzUpRXiAlXF E4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4wOTzbqLNYqxGFNwDAYixOtsIL9GISPycQH+77EFemU=; b=0uv30M/o1zsc533tQKyfGrtHRtLhAatZx7EdbrGlDMAgbLdlDDLP8ADFdKUFKAf24E CTipX8PvfiQCKaYml7lxlqAnQk2Ee6pfCh7/HnhvsLdDmqDdnIAt/w8OAW21xTROskig SAA97Bkvf2EFPgQ+cMyNZSWWEsudzCObpxihrf1WPjrQxn9JIgJ4ThzJiegse6i17cg4 7xbWNKKtK6S+2S3IN4ZAqaiWeWL53GyfRQy6fJHJTfSnUkPoqxh+kxhOCo2GTIWAl4iW /sWrpfjgp3M1n97MFdbXUhNaWziupUsF1zvhfGOPfqwtex9MaZn32ATlJkyVuzwjfNYm mQxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YvozeOiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si9633602edb.104.2021.10.21.17.37.21; Thu, 21 Oct 2021 17:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YvozeOiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232109AbhJVAhw (ORCPT + 99 others); Thu, 21 Oct 2021 20:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhJVAhw (ORCPT ); Thu, 21 Oct 2021 20:37:52 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A78C7C061766; Thu, 21 Oct 2021 17:35:35 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id 3so51921ilq.7; Thu, 21 Oct 2021 17:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4wOTzbqLNYqxGFNwDAYixOtsIL9GISPycQH+77EFemU=; b=YvozeOiT87sbTM6nN+buHxQFa8IoQ0P7Qvwpv7KUJ5Ky1YPYaLuj72DBTC2cVLlHXM 2ST6sUvojU1p1+OqgucRhIW4uMAzCVq5Hj9PXhoNxAX+4lsplb/oyFajDXzOTtg8frvw cypbq0e0BAYThQB9tL/0dNqdlibBbDPSEAOJMjjXYBXTHnLn2Gk5ULramCYQGB22q1SB cfG9NdEkCnzH50BMY8vKG/68eNqbO/nvngZdFLQwxwfYxeyYM3pqA88+zGPpWa3/SgTA wcZykSIuI8sc1Ocbe1Bx4xDYSxbF1MsEKDTxYbv4kENmmhkfs+XD2LjMNDGepDtzVAt7 2eYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4wOTzbqLNYqxGFNwDAYixOtsIL9GISPycQH+77EFemU=; b=NPvzjTs/O7hyzgSk8E1V/zT9n1bhuBMlXuE5i8JrDJp5CYDjdE7UtzaXlCvHPsIsp3 gNZNJ7wUQy3ShIj6uDTPML5W8mQZtp1sh7i+kdzlVZli/ssh191zYWUUCrk2Q4O+dhG1 0zuPcs2Lw9JhrF/ZAT9OBdQNVWpoq5pQTrZmzvP6F85zdApiSB50EXp31hxyfuBqvUPE /+M1Yy8Y94vPo4Ocusc3g3ClyHK8kE4vRaHfGBVbv91jDZ/gogb3WHsS+9ukY+oZ9xAz +7T1aSNpjrPTr0Yyl0ABj7iAnbUm2B9coF81FRVYPBYbNk+0GfnHtG/3ztqRZZ2AHq4a f7dA== X-Gm-Message-State: AOAM532cfPgfpYwr213F1+kN81KB3u5VxhpfL1x+BTH+nhsdm4IBMAn0 pylScZOU+AZdoYHjtnILwbm+feWrHXtYhkeDc+o= X-Received: by 2002:a05:6e02:1bab:: with SMTP id n11mr157789ili.290.1634862935056; Thu, 21 Oct 2021 17:35:35 -0700 (PDT) MIME-Version: 1.0 References: <20211020223920.2810727-1-alistair.francis@opensource.wdc.com> In-Reply-To: From: Alistair Francis Date: Fri, 22 Oct 2021 10:35:08 +1000 Message-ID: Subject: Re: [PATCH v4 1/4] perf bench futex: Call the futex syscall from a function To: Arnaldo Carvalho de Melo Cc: Alistair Francis , linux-riscv , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Mark Rutland , Davidlohr Bueso , Darren Hart , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Atish Patra , Arnd Bergmann , Alistair Francis , Davidlohr Bueso Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 11:25 PM Arnaldo Carvalho de Melo wrote: > > Em Thu, Oct 21, 2021 at 08:39:17AM +1000, Alistair Francis escreveu: > > From: Alistair Francis > > > > In preparation for a more complex futex() function let's convert the > > current macro into two functions. We need two functions to avoid > > compiler failures as the macro is overloaded. > > > > This will allow us to include pre-processor conditionals in the futex > > syscall functions. > > > > Signed-off-by: Alistair Francis > > Acked-by: Davidlohr Bueso > > --- > > tools/perf/bench/futex.h | 43 ++++++++++++++++++++++++---------------- > > 1 file changed, 26 insertions(+), 17 deletions(-) > > Right after applying this one: > > In file included from bench/futex-hash.c:29: > bench/futex.h: In function =E2=80=98futex_syscall=E2=80=99: > bench/futex.h:52:61: error: =E2=80=98ts32=E2=80=99 undeclared (first use = in this function); did you mean =E2=80=98s32=E2=80=99? > 52 | return syscall(SYS_futex, uaddr, op | opflags, val, ts32,= uaddr2, val3); > | ^~~~ > | s32 Sorry about that. There is a copy and paste error here. I have fixed this p= atch. Alistair > bench/futex.h:52:61: note: each undeclared identifier is reported only on= ce for each function it appears in > bench/futex.h:49:82: error: unused parameter =E2=80=98timeout=E2=80=99 [-= Werror=3Dunused-parameter] > 49 | futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, s= truct timespec *timeout, > | ~= ~~~~~~~~~~~~~~~~^~~~~~~ > bench/futex.h:53:1: error: control reaches end of non-void function [-Wer= ror=3Dreturn-type] > 53 | } > | ^ > cc1: all warnings being treated as errors > make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp= /build/perf/bench/futex-hash.o] Error 1 > make[4]: *** Waiting for unfinished jobs.... > In file included from bench/futex-wake-parallel.c:31: > bench/futex.h: In function =E2=80=98futex_syscall=E2=80=99: > bench/futex.h:52:61: error: =E2=80=98ts32=E2=80=99 undeclared (first use = in this function); did you mean =E2=80=98s32=E2=80=99? > 52 | return syscall(SYS_futex, uaddr, op | opflags, val, ts32,= uaddr2, val3); > | ^~~~ > | s32 > bench/futex.h:52:61: note: each undeclared identifier is reported only on= ce for each function it appears in > bench/futex.h:49:82: error: unused parameter =E2=80=98timeout=E2=80=99 [-= Werror=3Dunused-parameter] > 49 | futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, s= truct timespec *timeout, > | ~= ~~~~~~~~~~~~~~~~^~~~~~~ > bench/futex.h:53:1: error: control reaches end of non-void function [-Wer= ror=3Dreturn-type] > 53 | } > | ^ > cc1: all warnings being treated as errors > make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp= /build/perf/bench/futex-wake-parallel.o] Error 1 > In file included from bench/futex-requeue.c:26: > bench/futex.h: In function =E2=80=98futex_syscall=E2=80=99: > bench/futex.h:52:61: error: =E2=80=98ts32=E2=80=99 undeclared (first use = in this function); did you mean =E2=80=98s32=E2=80=99? > 52 | return syscall(SYS_futex, uaddr, op | opflags, val, ts32,= uaddr2, val3); > | ^~~~ > | s32 > bench/futex.h:52:61: note: each undeclared identifier is reported only on= ce for each function it appears in > bench/futex.h:49:82: error: unused parameter =E2=80=98timeout=E2=80=99 [-= Werror=3Dunused-parameter] > 49 | futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, s= truct timespec *timeout, > | ~= ~~~~~~~~~~~~~~~~^~~~~~~ > bench/futex.h:53:1: error: control reaches end of non-void function [-Wer= ror=3Dreturn-type] > 53 | } > | ^ > cc1: all warnings being treated as errors > In file included from bench/futex-lock-pi.c:19: > bench/futex.h: In function =E2=80=98futex_syscall=E2=80=99: > bench/futex.h:52:61: error: =E2=80=98ts32=E2=80=99 undeclared (first use = in this function); did you mean =E2=80=98s32=E2=80=99? > 52 | return syscall(SYS_futex, uaddr, op | opflags, val, ts32,= uaddr2, val3); > | ^~~~ > | s32 > bench/futex.h:52:61: note: each undeclared identifier is reported only on= ce for each function it appears in > bench/futex.h:49:82: error: unused parameter =E2=80=98timeout=E2=80=99 [-= Werror=3Dunused-parameter] > 49 | futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, s= truct timespec *timeout, > | ~= ~~~~~~~~~~~~~~~~^~~~~~~ > bench/futex.h:53:1: error: control reaches end of non-void function [-Wer= ror=3Dreturn-type] > 53 | } > | ^ > cc1: all warnings being treated as errors > make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp= /build/perf/bench/futex-requeue.o] Error 1 > make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp= /build/perf/bench/futex-lock-pi.o] Error 1 > In file included from bench/futex-wake.c:25: > bench/futex.h: In function =E2=80=98futex_syscall=E2=80=99: > bench/futex.h:52:61: error: =E2=80=98ts32=E2=80=99 undeclared (first use = in this function); did you mean =E2=80=98s32=E2=80=99? > 52 | return syscall(SYS_futex, uaddr, op | opflags, val, ts32,= uaddr2, val3); > | ^~~~ > | s32 > bench/futex.h:52:61: note: each undeclared identifier is reported only on= ce for each function it appears in > bench/futex.h:49:82: error: unused parameter =E2=80=98timeout=E2=80=99 [-= Werror=3Dunused-parameter] > 49 | futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, s= truct timespec *timeout, > | ~= ~~~~~~~~~~~~~~~~^~~~~~~ > bench/futex.h:53:1: error: control reaches end of non-void function [-Wer= ror=3Dreturn-type] > 53 | } > | ^ > cc1: all warnings being treated as errors > make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp= /build/perf/bench/futex-wake.o] Error 1 > make[3]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:139: ben= ch] Error 2 > make[3]: *** Waiting for unfinished jobs.... > make[2]: *** [Makefile.perf:660: /tmp/build/perf/perf-in.o] Error 2 > make[1]: *** [Makefile.perf:240: sub-make] Error 2 > make: *** [Makefile:113: install-bin] Error 2 > make: Leaving directory '/var/home/acme/git/perf/tools/perf' > > Performance counter stats for 'make -k BUILD_BPF_SKEL=3D1 CORESIGHT=3D1 = PYTHON=3Dpython3 O=3D/tmp/build/perf -C tools/perf install-bin': > > 2,467.00 msec task-clock:u # 1.263 CPUs utilize= d > 2,457.82 msec cpu-clock:u # 1.259 CPUs utilize= d > > 1.952573032 seconds time elapsed > > 1.444401000 seconds user > 1.111434000 seconds sys > > > =E2=AC=A2[acme@toolbox perf]$ > >