Skip to contentSkip to conversation

perf test: Fix attr tests for PERF_FORMAT_LOST

PATCH Applied James Clark 3 participants 4 messages Oct 12, 2022 – Oct 14, 2022 perf events

lore
Share & tools
lore
#0 lore raw

v2 cover perf test: Fix attr tests for PERF_FORMAT_LOST

Changes since v1:

* Add rather than replace the new value so that the test still passes on older kernels

James Clark (1):
perf test: Fix attr tests for PERF_FORMAT_LOST

 tools/perf/tests/attr/base-record                | 2 +-
 tools/perf/tests/attr/system-wide-dummy          | 2 +-
 tools/perf/tests/attr/test-record-group          | 4 ++--
 tools/perf/tests/attr/test-record-group-sampling | 6 +++---
 tools/perf/tests/attr/test-record-group1         | 4 ++--
 tools/perf/tests/attr/test-record-group2         | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 1/1 perf test: Fix attr tests for PERF_FORMAT_LOST

Since PERF_FORMAT_LOST was added, the default read format has that bit set, so add it to the tests. Keep the old value as well so that the test still passes on older kernels.

This fixes the following failure:

expected read_format=0|4, got 20
FAILED './tests/attr/test-record-C0' - match failure

Fixes 85b425f31c88 ("perf record: Set PERF_FORMAT_LOST by default")
Cc Namhyung Kim <[email protected]>
---
 tools/perf/tests/attr/base-record                | 2 +-
 tools/perf/tests/attr/system-wide-dummy          | 2 +-
 tools/perf/tests/attr/test-record-group          | 4 ++--
 tools/perf/tests/attr/test-record-group-sampling | 6 +++---
 tools/perf/tests/attr/test-record-group1         | 4 ++--
 tools/perf/tests/attr/test-record-group2         | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/tests/attr/base-record +1 -1
index 8c10955eff93..3ef07a12aa14 100644
@@ -9,7 +9,7 @@ size=128
 config=0
 sample_period=*
 sample_type=263
-read_format=0|4
+read_format=0|4|20
 disabled=1
 inherit=1
 pinned=0
tools/perf/tests/attr/system-wide-dummy +1 -1
index 86a15dd359d9..8fec06eda5f9 100644
@@ -11,7 +11,7 @@ size=128
 config=9
 sample_period=4000
 sample_type=455
-read_format=4
+read_format=4|20
 # Event will be enabled right away.
 disabled=0
 inherit=1
tools/perf/tests/attr/test-record-group +2 -2
index 14ee60fd3f41..6c1cff8aae8b 100644
@@ -7,14 +7,14 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
 group_fd=1
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group-sampling +3 -3
index 300b9f7e6d69..97e7e64a38f0 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=343
-read_format=12
+read_format=12|28
 inherit=0
 
 [event-2:base-record]
@@ -21,8 +21,8 @@ config=3
 # default | PERF_SAMPLE_READ
 sample_type=343
 
-# PERF_FORMAT_ID | PERF_FORMAT_GROUP
-read_format=12
+# PERF_FORMAT_ID | PERF_FORMAT_GROUP  | PERF_FORMAT_LOST
+read_format=12|28
 task=0
 mmap=0
 comm=0
tools/perf/tests/attr/test-record-group1 +2 -2
index 3ffe246e0228..eeb1db392bc9 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
@@ -15,7 +15,7 @@ group_fd=1
 type=0
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group2 +2 -2
index 6b9f8d182ce1..cebdaa8e64e4 100644
@@ -9,7 +9,7 @@ group_fd=-1
 config=0|1
 sample_period=1234000
 sample_type=87
-read_format=12
+read_format=12|28
 inherit=0
 freq=0
 
@@ -19,7 +19,7 @@ group_fd=1
 config=0|1
 sample_period=6789000
 sample_type=87
-read_format=12
+read_format=12|28
 disabled=0
 inherit=0
 mmap=0
Signature · 1 line
2.28.0
maintainer Acked-by on v2 1/1
#2 lore raw

Hello,

Quoted 5 lines · James Clark

Since PERF_FORMAT_LOST was added, the default read format has that bit set, so add it to the tests. Keep the old value as well so that the test still passes on older kernels.

Quoted 7 lines

This fixes the following failure:

expected read_format=0|4, got 20
FAILED './tests/attr/test-record-C0' - match failure

Fixes 85b425f31c88 ("perf record: Set PERF_FORMAT_LOST by default")

Thanks,
Namhyung

Quoted 127 lines
---
 tools/perf/tests/attr/base-record                | 2 +-
 tools/perf/tests/attr/system-wide-dummy          | 2 +-
 tools/perf/tests/attr/test-record-group          | 4 ++--
 tools/perf/tests/attr/test-record-group-sampling | 6 +++---
 tools/perf/tests/attr/test-record-group1         | 4 ++--
 tools/perf/tests/attr/test-record-group2         | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/tests/attr/base-record +1 -1
index 8c10955eff93..3ef07a12aa14 100644
@@ -9,7 +9,7 @@ size=128
 config=0
 sample_period=*
 sample_type=263
-read_format=0|4
+read_format=0|4|20
 disabled=1
 inherit=1
 pinned=0
tools/perf/tests/attr/system-wide-dummy +1 -1
index 86a15dd359d9..8fec06eda5f9 100644
@@ -11,7 +11,7 @@ size=128
 config=9
 sample_period=4000
 sample_type=455
-read_format=4
+read_format=4|20
 # Event will be enabled right away.
 disabled=0
 inherit=1
tools/perf/tests/attr/test-record-group +2 -2
index 14ee60fd3f41..6c1cff8aae8b 100644
@@ -7,14 +7,14 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
 group_fd=1
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group-sampling +3 -3
index 300b9f7e6d69..97e7e64a38f0 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=343
-read_format=12
+read_format=12|28
 inherit=0
 
 [event-2:base-record]
@@ -21,8 +21,8 @@ config=3
 # default | PERF_SAMPLE_READ
 sample_type=343
 
-# PERF_FORMAT_ID | PERF_FORMAT_GROUP
-read_format=12
+# PERF_FORMAT_ID | PERF_FORMAT_GROUP  | PERF_FORMAT_LOST
+read_format=12|28
 task=0
 mmap=0
 comm=0
tools/perf/tests/attr/test-record-group1 +2 -2
index 3ffe246e0228..eeb1db392bc9 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
@@ -15,7 +15,7 @@ group_fd=1
 type=0
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group2 +2 -3
index 6b9f8d182ce1..cebdaa8e64e4 100644
@@ -9,7 +9,7 @@ group_fd=-1
 config=0|1
 sample_period=1234000
 sample_type=87
-read_format=12
+read_format=12|28
 inherit=0
 freq=0
 
@@ -19,7 +19,7 @@ group_fd=1
 config=0|1
 sample_period=6789000
 sample_type=87
-read_format=12
+read_format=12|28
 disabled=0
 inherit=0
 mmap=0
--

2.28.0

maintainer Applied
#3 lore raw

Em Wed, Oct 12, 2022 at 09:06:27AM -0700, Namhyung Kim escreveu:

Quoted 10 lines

Hello,

Quoted 7 lines · James Clark

Since PERF_FORMAT_LOST was added, the default read format has that bit set, so add it to the tests. Keep the old value as well so that the test still passes on older kernels.

This fixes the following failure:

Quoted 7 lines
Quoted 5 lines

expected read_format=0|4, got 20
FAILED './tests/attr/test-record-C0' - match failure

Fixes 85b425f31c88 ("perf record: Set PERF_FORMAT_LOST by default")

Thanks, applied.

- Arnaldo

Quoted 131 lines

Thanks,
Namhyung

Quoted 127 lines
---
 tools/perf/tests/attr/base-record                | 2 +-
 tools/perf/tests/attr/system-wide-dummy          | 2 +-
 tools/perf/tests/attr/test-record-group          | 4 ++--
 tools/perf/tests/attr/test-record-group-sampling | 6 +++---
 tools/perf/tests/attr/test-record-group1         | 4 ++--
 tools/perf/tests/attr/test-record-group2         | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/tests/attr/base-record +1 -1
index 8c10955eff93..3ef07a12aa14 100644
@@ -9,7 +9,7 @@ size=128
 config=0
 sample_period=*
 sample_type=263
-read_format=0|4
+read_format=0|4|20
 disabled=1
 inherit=1
 pinned=0
tools/perf/tests/attr/system-wide-dummy +1 -1
index 86a15dd359d9..8fec06eda5f9 100644
@@ -11,7 +11,7 @@ size=128
 config=9
 sample_period=4000
 sample_type=455
-read_format=4
+read_format=4|20
 # Event will be enabled right away.
 disabled=0
 inherit=1
tools/perf/tests/attr/test-record-group +2 -2
index 14ee60fd3f41..6c1cff8aae8b 100644
@@ -7,14 +7,14 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
 group_fd=1
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group-sampling +3 -3
index 300b9f7e6d69..97e7e64a38f0 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=343
-read_format=12
+read_format=12|28
 inherit=0
 
 [event-2:base-record]
@@ -21,8 +21,8 @@ config=3
 # default | PERF_SAMPLE_READ
 sample_type=343
 
-# PERF_FORMAT_ID | PERF_FORMAT_GROUP
-read_format=12
+# PERF_FORMAT_ID | PERF_FORMAT_GROUP  | PERF_FORMAT_LOST
+read_format=12|28
 task=0
 mmap=0
 comm=0
tools/perf/tests/attr/test-record-group1 +2 -2
index 3ffe246e0228..eeb1db392bc9 100644
@@ -7,7 +7,7 @@ ret     = 1
 fd=1
 group_fd=-1
 sample_type=327
-read_format=4
+read_format=4|20
 
 [event-2:base-record]
 fd=2
@@ -15,7 +15,7 @@ group_fd=1
 type=0
 config=1
 sample_type=327
-read_format=4
+read_format=4|20
 mmap=0
 comm=0
 task=0
tools/perf/tests/attr/test-record-group2 +2 -3
index 6b9f8d182ce1..cebdaa8e64e4 100644
@@ -9,7 +9,7 @@ group_fd=-1
 config=0|1
 sample_period=1234000
 sample_type=87
-read_format=12
+read_format=12|28
 inherit=0
 freq=0
 
@@ -19,7 +19,7 @@ group_fd=1
 config=0|1
 sample_period=6789000
 sample_type=87
-read_format=12
+read_format=12|28
 disabled=0
 inherit=0
 mmap=0
--

2.28.0

Signature · 1 line
- Arnaldo