diff mbox series

[testsuite,1/3] perf_event: measure CPU 0 rather than CPU 1

Message ID 20210302172114.443689-2-omosnace@redhat.com (mailing list archive)
State Accepted
Delegated to: Ondrej Mosnáček
Headers show
Series perf_event: fixes and cleanups | expand

Commit Message

Ondrej Mosnacek March 2, 2021, 5:21 p.m. UTC
Change the "cpu" argument of perf_event_open(2) to 0, so that the test
doesn't fail on single-core machines.

This makes the perf_event pass in the GH Actions CI.

Fixes: b9e1eb2db689 ("selinux-testsuite: Add perf_event tests")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/perf_event/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/perf_event/perf_event.c b/tests/perf_event/perf_event.c
index 8983f02..1557303 100644
--- a/tests/perf_event/perf_event.c
+++ b/tests/perf_event/perf_event.c
@@ -82,7 +82,7 @@  int main(int argc, char **argv)
 	pe_attr.disabled = 1;
 	pe_attr.exclude_hv = 1;
 
-	fd = perf_event_open(&pe_attr, -1, 1, -1, 0);
+	fd = perf_event_open(&pe_attr, -1, 0, -1, 0);
 	if (fd < 0) {
 		fprintf(stderr, "Failed perf_event_open(): %s\n",
 			strerror(errno));