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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/perf_event/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
-- 
2.29.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux