Skip to contentSkip to conversation

syscalls/perf_event_open01: Allow EINVAL

PATCH In review Andreas Schwab 3 participants 5 messages Aug 15, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/perf_event_open01: Allow EINVAL

A request for an unsupported perf event can also result in EINVAL.

---
 testcases/kernel/syscalls/perf_event_open/perf_event_open01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/perf_event_open/perf_event_open01.c +1 -1
index 30c0d7594..86a134b51 100644
@@ -148,7 +148,7 @@ static void verify(struct test_case_t *tc)
 	TEST(perf_event_open(&pe, 0, -1, -1, 0));
 	if (TEST_RETURN == -1) {
 		if (TEST_ERRNO == ENOENT || TEST_ERRNO == EOPNOTSUPP ||
-		    TEST_ERRNO == ENODEV) {
+		    TEST_ERRNO == ENODEV || TEST_ERRNO == EINVAL) {
 			tst_resm(TCONF | TTERRNO,
 			         "perf_event_open for %s not supported",
 			         tc->config_name);
Signature · 10 lines
2.46.0


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Andreas,

Quoted 1 line

A request for an unsupported perf event can also result in EINVAL.

Thanks for fixing LTP!
Yes, man page mentions this.

Out of curiosity, what are you fixing?
(Which kernel, arch, which event gives that).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 1 line · Petr Vorel

Out of curiosity, what are you fixing?

perf_event_open01 1 TFAIL : perf_event_open01.c:156: perf_event_open PERF_COUNT_HW_INSTRUCTIONS failed unexpectedly: TEST_ERRNO=EINVAL(22): Invalid argument

Signature · 6 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#4 lore raw
In reply to Andreas Schwab

Hi,
thanks for the patch.

Quoted 20 lines · Andreas Schwab

A request for an unsupported perf event can also result in EINVAL.

---
  testcases/kernel/syscalls/perf_event_open/perf_event_open01.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/perf_event_open/perf_event_open01.c +1 -1
index 30c0d7594..86a134b51 100644
@@ -148,7 +148,7 @@ static void verify(struct test_case_t *tc)
  	TEST(perf_event_open(&pe, 0, -1, -1, 0));
  	if (TEST_RETURN == -1) {
  		if (TEST_ERRNO == ENOENT || TEST_ERRNO == EOPNOTSUPP ||
-		    TEST_ERRNO == ENODEV) {
+		    TEST_ERRNO == ENODEV || TEST_ERRNO == EINVAL) {
  			tst_resm(TCONF | TTERRNO,
  			         "perf_event_open for %s not supported",
  			         tc->config_name);
Signature · 11 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp