Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp575004pxy; Fri, 30 Apr 2021 11:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+3SL1rw0UCy9e8z+HC/44OmcLGNm+5bQyzaoI2ty2xrpp0+1B18e5P7R9uyInkig8DJKB X-Received: by 2002:a17:902:a5c6:b029:e5:df57:e156 with SMTP id t6-20020a170902a5c6b02900e5df57e156mr6431152plq.71.1619806940229; Fri, 30 Apr 2021 11:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619806940; cv=none; d=google.com; s=arc-20160816; b=lj413abryQuRcpvMOWM72VmXR6KjxlYuKmXq3eCVjVNHGRCmYqzyWf1NJpXFpFQopQ HLhkJ1fENYFV6HZzDi2YSCJTFIjIItTQaT5Kq24tc2l7HLz41Fpc+b9C63Xz/6yNNSCV 3mopxt4dQhNqkALxERoQZqGkvGSVV/D92APlLGW+JuJCeXat97imlBYK4FAVbhf5iWBK g63DQ0lgd0Okgkr7j3P9g5EWHO0CJK7PrCzqZq0B2a3Uo6/xBQ4uB75YZ2bXaSvYNp+U RDsFaJDmiV6Nly+Q0FJ4UuYQ9xDUs9qm5ZVl0GXuSh3SxxtkJU2xxhhbY7d4V0v9vT2H olRg== 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=KuanUtjgeSA60TqKy6dduengCXROZaysvvKjzBygWZk=; b=mwoZu8H9yKDjBKzYIOBKPTVNbiEkZa0HkqPOFnz5Pmirw7DQi+w/59k7l/w/ynl9B1 fulp8NKCe3U6zu44h0gFazCK3lnB97PtJjvLJKd73f1r9koqrcej11xf2EJ+RvqJLQJ4 VT7c2/bxTjwk+8g3NtPvH6bbGfisS9Kz29pjxBAjfVXnJLzc27JzV4EVuGoz5EhShcKx y5HBf4qPSuARIPggostRM9DesBcLkgLVpYGutF3Ga7CeRXunbwoyreF9tdgfwtUdOOA4 2lMhTbrMntDhQuAE9aZWf7NjhkYio6eFcp9zH63SLl1764aCThVlPlAUDr8A7t8DQ65p wHRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jb8+CroD; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si3925988pgv.194.2021.04.30.11.22.06; Fri, 30 Apr 2021 11:22:20 -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=@kernel.org header.s=k20201202 header.b=jb8+CroD; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbhD3SWA (ORCPT + 99 others); Fri, 30 Apr 2021 14:22:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:33618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbhD3SWA (ORCPT ); Fri, 30 Apr 2021 14:22:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9FE6F613D9 for ; Fri, 30 Apr 2021 18:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619806871; bh=RmbbiAkH4JmT/dChtltom/gbGZbNXlnFFpa0oAzvEHY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jb8+CroDi15WxNlFfeN6QehcgAP0ZzVbNlwkyhc2zDdYtMr8cwocIXDdOqut6Zlxo tx/N1emgcE7kYkBmG9DxjdjhndwlNSeP1wugzci9jE7KXbYRDphjNz0B4i4oINfQkx PUlEwFkKBazlEZd6kCldqrINVecD8fzujKlJ8X/j3IYt3WcZVbdObJJxD7kYYSzLL7 G8aZ1iCe11VBd6jTgRJKmwb4PmiCba1H6jm5r3779x3RidY7Rvw6B1CnFBOwG/P7Oi /bIcSmXB/mMwNkO6pUMRFw4aGIRyF4+kUwG1YUgVblbc9ZnVLJhot3GVuPrItcrHt7 Lub3yC+RSAFtQ== Received: by mail-ej1-f41.google.com with SMTP id l4so106591911ejc.10 for ; Fri, 30 Apr 2021 11:21:11 -0700 (PDT) X-Gm-Message-State: AOAM530FOacHfLe6wcTEviy70e8eareLUM8Sq4hGzh8wdop4vbK/UJAP 8cd9m8xKvzb2uM7mEbVjMFjDrciO7GKnUFy9SQ== X-Received: by 2002:a17:906:18e1:: with SMTP id e1mr5746788ejf.341.1619806870144; Fri, 30 Apr 2021 11:21:10 -0700 (PDT) MIME-Version: 1.0 References: <20210420031511.2348977-1-robh@kernel.org> <20210420031511.2348977-8-robh@kernel.org> <20210430164616.pzb7yxrsugexso25@gabell> In-Reply-To: From: Rob Herring Date: Fri, 30 Apr 2021 13:20:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 7/9] perf: arm64: Add test for userspace counter access on heterogeneous systems To: Masayoshi Mizuma Cc: Will Deacon , Catalin Marinas , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , Mark Rutland , Alexander Shishkin , Honnappa Nagarahalli , Zachary.Leaf@arm.com, Raphael Gault , Jonathan Cameron , Namhyung Kim , Itaru Kitayama , linux-arm-kernel , "linux-kernel@vger.kernel.org" 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 Fri, Apr 30, 2021 at 1:17 PM Rob Herring wrote: > > On Fri, Apr 30, 2021 at 11:46 AM Masayoshi Mizuma = wrote: > > > > On Mon, Apr 19, 2021 at 10:15:09PM -0500, Rob Herring wrote: > > > Userspace counter access only works on heterogeneous systems with som= e > > > restrictions. The userspace process must be pinned to a homogeneous > > > subset of CPUs and must open the corresponding PMU for those CPUs. Th= is > > > commit adds a test implementing these requirements. > > > > > > Signed-off-by: Rob Herring > > > --- > > > v6: > > > - Add a check on cap_user_rdpmc > > > v5: > > > - Adapt to libperf mmap API changes > > > v4: > > > - Update perf_evsel__mmap params > > > v2: > > > - Drop all but heterogeneous test as others covered by libperf tests > > > - Rework to use libperf > > > --- > > > tools/perf/arch/arm64/include/arch-tests.h | 7 + > > > tools/perf/arch/arm64/tests/Build | 1 + > > > tools/perf/arch/arm64/tests/arch-tests.c | 4 + > > > tools/perf/arch/arm64/tests/user-events.c | 177 +++++++++++++++++++= ++ > > > 4 files changed, 189 insertions(+) > > > create mode 100644 tools/perf/arch/arm64/tests/user-events.c > > > > > > diff --git a/tools/perf/arch/arm64/include/arch-tests.h b/tools/perf/= arch/arm64/include/arch-tests.h > > > index 90ec4c8cb880..380ad34a3f09 100644 > > > --- a/tools/perf/arch/arm64/include/arch-tests.h > > > +++ b/tools/perf/arch/arm64/include/arch-tests.h > > > @@ -2,11 +2,18 @@ > > > #ifndef ARCH_TESTS_H > > > #define ARCH_TESTS_H > > > > > > +#include > > > + > > > #ifdef HAVE_DWARF_UNWIND_SUPPORT > > > struct thread; > > > struct perf_sample; > > > +int test__arch_unwind_sample(struct perf_sample *sample, > > > + struct thread *thread); > > > #endif > > > > Hello, > > > > I got the following compile error with aarch64 on Fedora33. > > > > # make tools/perf > > ... > > In file included from arch/arm64/tests/arch-tests.c:4: > > /root//libperf_v7/tools/perf/arch/arm64/include/arch-tests.h:10:5: = error: redundant redeclaration of =E2=80=98test__arch_unwind_sample=E2=80= =99 [-Werror=3Dredundant-decls] > > 10 | int test__arch_unwind_sample(struct perf_sample *sample, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > In file included from arch/arm64/tests/arch-tests.c:3: > > /root//libperf_v7/tools/perf/tests/tests.h:140:5: note: previous de= claration of =E2=80=98test__arch_unwind_sample=E2=80=99 was here > > 140 | int test__arch_unwind_sample(struct perf_sample *sample, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > cc1: all warnings being treated as errors > > make[8]: *** [/root//libperf_v7/tools/build/Makefile.build:97: /roo= t/libperf_v7/tools/perf/arch/arm64/tests/arch-tests.o] Error 1 > > make[8]: *** Waiting for unfinished jobs.... > > In file included from arch/arm64/tests/user-events.c:13: > > /root//libperf_v7/tools/perf/arch/arm64/include/arch-tests.h:10:5: = error: redundant redeclaration of =E2=80=98test__arch_unwind_sample=E2=80= =99 [-Werror=3Dredundant-decls] > > 10 | int test__arch_unwind_sample(struct perf_sample *sample, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > In file included from arch/arm64/tests/user-events.c:12: > > /root//libperf_v7/tools/perf/tests/tests.h:140:5: note: previous de= claration of =E2=80=98test__arch_unwind_sample=E2=80=99 was here > > 140 | int test__arch_unwind_sample(struct perf_sample *sample, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > cc1: all warnings being treated as errors > > ... > > > > The error is gone after the following patch is applied. > > Thanks. Honestly, I'm not sure why it was there in the first place. > Looking at the git history and this series history doesn't give any > clues. Well, except that both x86 and powerpc have the same hunk in their arch-tests.h. Do you see errors on those arches? Rob