diff mbox series

[v3,4/4] perf test: Leader sampling shouldn't clear sample period

Message ID 20200912025655.1337192-5-irogers@google.com
State Not Applicable
Delegated to: BPF Maintainers
Headers show
Series Fixes for setting event freq/periods | expand

Commit Message

Ian Rogers Sept. 12, 2020, 2:56 a.m. UTC
Add test that a sibling with leader sampling doesn't have its period
cleared.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/attr/README             |  1 +
 tools/perf/tests/attr/test-record-group2 | 29 ++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 tools/perf/tests/attr/test-record-group2

Comments

Arnaldo Carvalho de Melo Sept. 14, 2020, 10:36 p.m. UTC | #1
Em Fri, Sep 11, 2020 at 07:56:55PM -0700, Ian Rogers escreveu:
> Add test that a sibling with leader sampling doesn't have its period
> cleared.

Thanks, applied and collected Jiri's Acks for [34]/4 and Adrian's for
3/4.

- Arnaldo
 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/tests/attr/README             |  1 +
>  tools/perf/tests/attr/test-record-group2 | 29 ++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 tools/perf/tests/attr/test-record-group2
> 
> diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README
> index 6cd408108595..a36f49fb4dbe 100644
> --- a/tools/perf/tests/attr/README
> +++ b/tools/perf/tests/attr/README
> @@ -49,6 +49,7 @@ Following tests are defined (with perf commands):
>    perf record --call-graph fp kill              (test-record-graph-fp)
>    perf record --group -e cycles,instructions kill (test-record-group)
>    perf record -e '{cycles,instructions}' kill   (test-record-group1)
> +  perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
>    perf record -D kill                           (test-record-no-delay)
>    perf record -i kill                           (test-record-no-inherit)
>    perf record -n kill                           (test-record-no-samples)
> diff --git a/tools/perf/tests/attr/test-record-group2 b/tools/perf/tests/attr/test-record-group2
> new file mode 100644
> index 000000000000..6b9f8d182ce1
> --- /dev/null
> +++ b/tools/perf/tests/attr/test-record-group2
> @@ -0,0 +1,29 @@
> +[config]
> +command = record
> +args    = --no-bpf-event -e '{cycles/period=1234000/,instructions/period=6789000/}:S' kill >/dev/null 2>&1
> +ret     = 1
> +
> +[event-1:base-record]
> +fd=1
> +group_fd=-1
> +config=0|1
> +sample_period=1234000
> +sample_type=87
> +read_format=12
> +inherit=0
> +freq=0
> +
> +[event-2:base-record]
> +fd=2
> +group_fd=1
> +config=0|1
> +sample_period=6789000
> +sample_type=87
> +read_format=12
> +disabled=0
> +inherit=0
> +mmap=0
> +comm=0
> +freq=0
> +enable_on_exec=0
> +task=0
> -- 
> 2.28.0.618.gf4bc123cb7-goog
>
diff mbox series

Patch

diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README
index 6cd408108595..a36f49fb4dbe 100644
--- a/tools/perf/tests/attr/README
+++ b/tools/perf/tests/attr/README
@@ -49,6 +49,7 @@  Following tests are defined (with perf commands):
   perf record --call-graph fp kill              (test-record-graph-fp)
   perf record --group -e cycles,instructions kill (test-record-group)
   perf record -e '{cycles,instructions}' kill   (test-record-group1)
+  perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
   perf record -D kill                           (test-record-no-delay)
   perf record -i kill                           (test-record-no-inherit)
   perf record -n kill                           (test-record-no-samples)
diff --git a/tools/perf/tests/attr/test-record-group2 b/tools/perf/tests/attr/test-record-group2
new file mode 100644
index 000000000000..6b9f8d182ce1
--- /dev/null
+++ b/tools/perf/tests/attr/test-record-group2
@@ -0,0 +1,29 @@ 
+[config]
+command = record
+args    = --no-bpf-event -e '{cycles/period=1234000/,instructions/period=6789000/}:S' kill >/dev/null 2>&1
+ret     = 1
+
+[event-1:base-record]
+fd=1
+group_fd=-1
+config=0|1
+sample_period=1234000
+sample_type=87
+read_format=12
+inherit=0
+freq=0
+
+[event-2:base-record]
+fd=2
+group_fd=1
+config=0|1
+sample_period=6789000
+sample_type=87
+read_format=12
+disabled=0
+inherit=0
+mmap=0
+comm=0
+freq=0
+enable_on_exec=0
+task=0