Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4305023pxb; Sat, 5 Feb 2022 09:19:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdtpKV9M+wOob6AMark9ZmrHvf2R2w0uV4AirKwPgjLAplCSv+byb4LBBFpXarZQdCgO+e X-Received: by 2002:a05:6402:190f:: with SMTP id e15mr5354828edz.195.1644081581683; Sat, 05 Feb 2022 09:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644081581; cv=none; d=google.com; s=arc-20160816; b=lPHMyzIJSUrPUOI4biVZHotMpkmhBDaJPW3cwPYuLm1F+e/6FRHg0uMaeXwgsiyAFE 8/JkTjbeqI98E7RAsx8u8JmsR0r9EtXaaLNoy5lfT2vqtSJQlYCMVTn8FcVdiXrXs0QW F1cAzAecBs9gkx2ttHOzeAH8Ba9ElIsXnnVUEzmGRJMG7Ji9zQI6S/o++RM2eSNn5tXn kYlNqeg8QjRXcm8MZZ+RKzmGDrecB/J/oVYkqpJQuh30IjXVAgQ47XEufCD991XPw7hp J0QJfkZ9P99cayuo418XYwkAKvJR99o6hF9C0+/6cbfxlNAiemvBKbm+e2qdX0SEY+80 MNNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mRwDG3dHdSCt9JBk2JbCS8GWF1RzkAIy/xnl8iR8W7Y=; b=wcbuD725KIWOQKHImj4Cu0rpIxpLmazSxPMBi05EfypWhH4IdjpqJXS1JKM+lVHTGt JgK8k4b/GZTm6ogY+cM+L/FvkXJcHxybdUvV5I6u0q08bjG/8uO3lLj1RxB5D3GgJ7Ug aR+kgMkHQWHLMx1cp41sqoOKUhnIv3mcJxcRDHVra0f9XxWpD3/ONPm9j0tRt/3UW6wS WikfCClDnD7WW+JJTntq4QSx1Hm+FYG/+dL+b5NLj20HTN546ZBIi6B2AZ33VuAu8su4 Pfzbwan6IedUfHgxXWPgJ0Eip/H5gOc8N4zVrhTlgxxH5mGvtc1pRAH35dVQQFm/B/r3 j+sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Efq/Yfxk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go12si3998953ejc.521.2022.02.05.09.19.16; Sat, 05 Feb 2022 09:19:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Efq/Yfxk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359667AbiBEIKZ (ORCPT + 99 others); Sat, 5 Feb 2022 03:10:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239233AbiBEIKX (ORCPT ); Sat, 5 Feb 2022 03:10:23 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0BE7C061348 for ; Sat, 5 Feb 2022 00:10:21 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id k17so7134629plk.0 for ; Sat, 05 Feb 2022 00:10:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mRwDG3dHdSCt9JBk2JbCS8GWF1RzkAIy/xnl8iR8W7Y=; b=Efq/YfxkqG5CBZkRIDisd5gefe9br7yxLyzgSlJN58z1Z1XQqxfejULxQmW8IMxsK6 pbUElT+8PCYsg8YA/RUK6wr+//t3jug9t+qemcQ5s5H06POYAojLHHsWPMPCAQ7L4XFZ M80w3rSQrn1K0SQBHRJdaEV/7J0Ps+vnOlZ/zk6uarHFQXTDi0zNN99DAZJuOwHkAofb 35vVxceWkkJxUCysdnD88PUHrKqu5TdxmfL4iy+ZMTgQHFNE4zlMPmsrmK44dyRJCU/0 zK8JAJ5CzTqIgFiLlHyG5eKoi4YgIFtaxoh37za2slQitkcVCkmGhPDYMNielJbbCtha RHJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mRwDG3dHdSCt9JBk2JbCS8GWF1RzkAIy/xnl8iR8W7Y=; b=yWMFAivT94XD7k3hbKDl0mx9K9jIeA1OjNmIxbkmq7+AwtK9K2eqLPknGzbJqoqJFq Kh4ZL3xCmmQYfKHaSYUKIIIL/zu1kJDqNkBeYdI6Yl2xFSNcOTUlBhuDxOix00hNvSXS bCYF4MVOOFnce+hkwh8srqjQ8529WKdbcJmZa8pQoT+pOFYNw1AUdV8bXN6m0RyiCKdR IaXpAvIht52D3KR0n+d/i4WUN7wb7NcGdOkABFdHGmVMM+Cl6rGKr7L41PWJ4LOQznKD IQeBjwD3kYL9dTejUMK7H4aszPWAGJ0/3/fWqHElxgGH2Ylis8b+RElrHPOLcEE/7EqQ UDAA== X-Gm-Message-State: AOAM533XxGpzIQwpSISbygYHSqo+W32UU3vTWwr5CdvHu5P6cFoxXNVw C4U2VGSKgQJSbD1kZi30Y3C2EA== X-Received: by 2002:a17:902:8483:: with SMTP id c3mr7095691plo.19.1644048620689; Sat, 05 Feb 2022 00:10:20 -0800 (PST) Received: from leoy-ThinkPad-X240s ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id k16sm5118928pfu.140.2022.02.05.00.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Feb 2022 00:10:19 -0800 (PST) Date: Sat, 5 Feb 2022 16:10:13 +0800 From: Leo Yan To: German Gomez Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event Message-ID: <20220205081013.GA391033@leoy-ThinkPad-X240s> References: <20220126160710.32983-1-german.gomez@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220126160710.32983-1-german.gomez@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi German, On Wed, Jan 26, 2022 at 04:07:09PM +0000, German Gomez wrote: > Adds a couple of perf_event_attr tests for the fix introduced in [1]. > The tests check that the correct sample_period value is set in the > struct perf_event_attr of the arm_spe events. > > [1]: https://lore.kernel.org/all/20220118144054.2541-1-german.gomez@arm.com/ > > Signed-off-by: German Gomez I tested this patch with two commands: # PERF_TEST_ATTR=/tmp /usr/bin/python2 ./tests/attr.py -d ./tests/attr/ \ -p ./perf -vvvvv -t test-record-spe-period # PERF_TEST_ATTR=/tmp /usr/bin/python2 ./tests/attr.py -d ./tests/attr/ \ -p ./perf -vvvvv -t test-record-spe-period-term Both testing can pass on Hisilicon D06 board. One question: I'm a bit concern this case will fail on some Arm64 platforms which doesn't contain Arm SPE modules. E.g. below commands will always fail on Arm64 platforms if SPE module is absent. So I am wandering if we can add extra checking ARM SPE event is existed or not? # ./perf test list 17: Setup struct perf_event_attr # ./perf test 17 Thanks, Leo > --- > tools/perf/tests/attr/README | 2 + > tools/perf/tests/attr/base-record-spe | 40 +++++++++++++++++++ > tools/perf/tests/attr/test-record-spe-period | 12 ++++++ > .../tests/attr/test-record-spe-period-term | 12 ++++++ > 4 files changed, 66 insertions(+) > create mode 100644 tools/perf/tests/attr/base-record-spe > create mode 100644 tools/perf/tests/attr/test-record-spe-period > create mode 100644 tools/perf/tests/attr/test-record-spe-period-term > > diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README > index 1116fc6bf2ac..454505d343fa 100644 > --- a/tools/perf/tests/attr/README > +++ b/tools/perf/tests/attr/README > @@ -58,6 +58,8 @@ Following tests are defined (with perf commands): > perf record -c 100 -P kill (test-record-period) > perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period) > perf record -R kill (test-record-raw) > + perf record -c 2 -e arm_spe_0// -- kill (test-record-spe-period) > + perf record -e arm_spe_0/period=3/ -- kill (test-record-spe-period-term) > perf stat -e cycles kill (test-stat-basic) > perf stat kill (test-stat-default) > perf stat -d kill (test-stat-detailed-1) > diff --git a/tools/perf/tests/attr/base-record-spe b/tools/perf/tests/attr/base-record-spe > new file mode 100644 > index 000000000000..08fa96b59240 > --- /dev/null > +++ b/tools/perf/tests/attr/base-record-spe > @@ -0,0 +1,40 @@ > +[event] > +fd=* > +group_fd=-1 > +flags=* > +cpu=* > +type=* > +size=* > +config=* > +sample_period=* > +sample_type=* > +read_format=* > +disabled=* > +inherit=* > +pinned=* > +exclusive=* > +exclude_user=* > +exclude_kernel=* > +exclude_hv=* > +exclude_idle=* > +mmap=* > +comm=* > +freq=* > +inherit_stat=* > +enable_on_exec=* > +task=* > +watermark=* > +precise_ip=* > +mmap_data=* > +sample_id_all=* > +exclude_host=* > +exclude_guest=* > +exclude_callchain_kernel=* > +exclude_callchain_user=* > +wakeup_events=* > +bp_type=* > +config1=* > +config2=* > +branch_sample_type=* > +sample_regs_user=* > +sample_stack_user=* > diff --git a/tools/perf/tests/attr/test-record-spe-period b/tools/perf/tests/attr/test-record-spe-period > new file mode 100644 > index 000000000000..75f8c9cd8e3f > --- /dev/null > +++ b/tools/perf/tests/attr/test-record-spe-period > @@ -0,0 +1,12 @@ > +[config] > +command = record > +args = --no-bpf-event -c 2 -e arm_spe_0// -- kill >/dev/null 2>&1 > +ret = 1 > +arch = aarch64 > + > +[event-10:base-record-spe] > +sample_period=2 > +freq=0 > + > +# dummy event > +[event-1:base-record-spe] > diff --git a/tools/perf/tests/attr/test-record-spe-period-term b/tools/perf/tests/attr/test-record-spe-period-term > new file mode 100644 > index 000000000000..8f60a4fec657 > --- /dev/null > +++ b/tools/perf/tests/attr/test-record-spe-period-term > @@ -0,0 +1,12 @@ > +[config] > +command = record > +args = --no-bpf-event -e arm_spe_0/period=3/ -- kill >/dev/null 2>&1 > +ret = 1 > +arch = aarch64 > + > +[event-10:base-record-spe] > +sample_period=3 > +freq=0 > + > +# dummy event > +[event-1:base-record-spe] > -- > 2.25.1 >