All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
@ 2022-01-26 16:07 German Gomez
  2022-02-05  8:10 ` Leo Yan
  2022-02-28 15:05 ` James Clark
  0 siblings, 2 replies; 7+ messages in thread
From: German Gomez @ 2022-01-26 16:07 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme
  Cc: German Gomez, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, netdev, bpf

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 <german.gomez@arm.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-01-26 16:07 [PATCH] perf test: Add perf_event_attr tests for the arm_spe event German Gomez
@ 2022-02-05  8:10 ` Leo Yan
  2022-02-07 10:50   ` German Gomez
  2022-02-28 15:05 ` James Clark
  1 sibling, 1 reply; 7+ messages in thread
From: Leo Yan @ 2022-02-05  8:10 UTC (permalink / raw)
  To: German Gomez
  Cc: linux-kernel, linux-perf-users, acme, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Martin KaFai Lau,
	Song Liu, Yonghong Song, John Fastabend, KP Singh, netdev, bpf

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 <german.gomez@arm.com>

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-02-05  8:10 ` Leo Yan
@ 2022-02-07 10:50   ` German Gomez
  2022-02-07 11:03     ` Leo Yan
  0 siblings, 1 reply; 7+ messages in thread
From: German Gomez @ 2022-02-07 10:50 UTC (permalink / raw)
  To: Leo Yan
  Cc: linux-kernel, linux-perf-users, acme, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Martin KaFai Lau,
	Song Liu, Yonghong Song, John Fastabend, KP Singh, netdev, bpf

Hi Leo, thanks for checking this

On 05/02/2022 08:10, Leo Yan wrote:
> 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 <german.gomez@arm.com>
> 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?
 
The test reports "unsupported" if the return code and the 'ret' field don't match.

When I unload the SPE module:

running './tests/attr//test-record-spe-period-term'
test limitation 'aarch64'
unsupp  './tests/attr//test-record-spe-period-term'

>
>   # ./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
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-02-07 10:50   ` German Gomez
@ 2022-02-07 11:03     ` Leo Yan
  2022-02-28 11:56       ` German Gomez
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Yan @ 2022-02-07 11:03 UTC (permalink / raw)
  To: German Gomez
  Cc: linux-kernel, linux-perf-users, acme, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Martin KaFai Lau,
	Song Liu, Yonghong Song, John Fastabend, KP Singh, netdev, bpf

On Mon, Feb 07, 2022 at 10:50:26AM +0000, German Gomez wrote:
> Hi Leo, thanks for checking this
> 
> On 05/02/2022 08:10, Leo Yan wrote:
> > 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 <german.gomez@arm.com>
> > 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?
>  
> The test reports "unsupported" if the return code and the 'ret' field don't match.
> 
> When I unload the SPE module:
> 
> running './tests/attr//test-record-spe-period-term'
> test limitation 'aarch64'
> unsupp  './tests/attr//test-record-spe-period-term'

Thanks for confirmation, German.

You could add my testing tag for this patch:

Tested-by: Leo Yan <leo.yan@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-02-07 11:03     ` Leo Yan
@ 2022-02-28 11:56       ` German Gomez
  0 siblings, 0 replies; 7+ messages in thread
From: German Gomez @ 2022-02-28 11:56 UTC (permalink / raw)
  To: Leo Yan
  Cc: linux-kernel, linux-perf-users, acme, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Martin KaFai Lau,
	Song Liu, Yonghong Song, John Fastabend, KP Singh, netdev, bpf,
	James Clark


On 07/02/2022 11:03, Leo Yan wrote:
> [...]
> Thanks for confirmation, German.
>
> You could add my testing tag for this patch:
>
> Tested-by: Leo Yan <leo.yan@linaro.org>

Thanks Leo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-01-26 16:07 [PATCH] perf test: Add perf_event_attr tests for the arm_spe event German Gomez
  2022-02-05  8:10 ` Leo Yan
@ 2022-02-28 15:05 ` James Clark
  2022-03-05 19:00   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 7+ messages in thread
From: James Clark @ 2022-02-28 15:05 UTC (permalink / raw)
  To: German Gomez, linux-kernel, linux-perf-users, acme
  Cc: Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, netdev, bpf



On 26/01/2022 16:07, 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 <german.gomez@arm.com>

Reviewed-by: James Clark <james.clark@arm.com>

> ---
>  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]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] perf test: Add perf_event_attr tests for the arm_spe event
  2022-02-28 15:05 ` James Clark
@ 2022-03-05 19:00   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-03-05 19:00 UTC (permalink / raw)
  To: James Clark
  Cc: German Gomez, linux-kernel, linux-perf-users, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Martin KaFai Lau,
	Song Liu, Yonghong Song, John Fastabend, KP Singh, netdev, bpf

Em Mon, Feb 28, 2022 at 03:05:21PM +0000, James Clark escreveu:
> 
> 
> On 26/01/2022 16:07, 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 <german.gomez@arm.com>
> 
> Reviewed-by: James Clark <james.clark@arm.com>

Thanks, applied.

- Arnaldo

 
> > ---
> >  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]

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-05 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 16:07 [PATCH] perf test: Add perf_event_attr tests for the arm_spe event German Gomez
2022-02-05  8:10 ` Leo Yan
2022-02-07 10:50   ` German Gomez
2022-02-07 11:03     ` Leo Yan
2022-02-28 11:56       ` German Gomez
2022-02-28 15:05 ` James Clark
2022-03-05 19:00   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.