perf test: Skip wp modify test on old kernels
Namhyung Kim
maintainerPATCH 1/1 perf test: Skip wp modify test on old kernels
It uses PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl. The kernel would return
ENOTTY if it's not supported. Update the skip reason in that case.
---
I'd like to add Fixes: 2e85d5979e8d tag here but it'd conlict with the later change in e47c6ecaae1d.
tools/perf/tests/wp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
tools/perf/tests/wp.c +7 -2
@@ -2,6 +2,7 @@#include <stdlib.h> #include <string.h> #include <unistd.h> +#include <errno.h> #include <sys/ioctl.h> #include <linux/hw_breakpoint.h> #include <linux/kernel.h>
@@ -137,8 +138,7 @@ static int test__wp_rw(struct test_suite *test __maybe_unused,#endif } -static int test__wp_modify (struct test_suite *test__maybe_unused , -int subtest__maybe_unused ) +static int test__wp_modify (struct test_suite *test,int subtest) {#if defined(__s390x__)return TEST_SKIP ;
@@ -160,6 +160,11 @@ static int test__wp_modify(struct test_suite *test __maybe_unused, new_attr.disabled =1 ; ret =ioctl (fd,PERF_EVENT_IOC_MODIFY_ATTRIBUTES , &new_attr);if (ret <0 ) { +if (errno ==ENOTTY ) { + test->test_cases[subtest].skip_reason ="missing kernel support" ; + ret =TEST_SKIP ; + } +pr_debug ("ioctl(PERF_EVENT_IOC_MODIFY_ATTRIBUTES) failed\n" );close (fd);return ret;
Signature · 1 line
2.37.2.789.g6183377224-goog
Quoted 2 lines · Namhyung Kim
It uses
PERF_EVENT_IOC_MODIFY_ATTRIBUTESioctl. The kernel would return ENOTTY if it's not supported. Update the skip reason in that case.
Quoted 2 lines
I'd like to add Fixes:
2e85d5979e8dtag here but it'd conlict with the later change ine47c6ecaae1d.
Is it worth to backport?
Thanks,
Ravi
Em Mon, Sep 19, 2022 at 11:24:05AM +0530, Ravi Bangoria escreveu:
Quoted 5 lines · Namhyung Kim
Quoted 2 lines
It uses
PERF_EVENT_IOC_MODIFY_ATTRIBUTESioctl. The kernel would return ENOTTY if it's not supported. Update the skip reason in that case.Reviewed-by Ravi Bangoria <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 7 lines
Quoted 2 lines
I'd like to add Fixes:
2e85d5979e8dtag here but it'd conlict with the later change ine47c6ecaae1d.Is it worth to backport?
Thanks,
Ravi
Signature · 1 line
- Arnaldo