hc
2023-12-09 958e46acc8e900e8569dd467c1af9b8d2d019394
kernel/tools/perf/tests/bp_account.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select
34 * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu.
....@@ -9,20 +10,16 @@
910 #include <unistd.h>
1011 #include <string.h>
1112 #include <sys/ioctl.h>
12
-#include <time.h>
1313 #include <fcntl.h>
14
-#include <signal.h>
15
-#include <sys/mman.h>
16
-#include <linux/compiler.h>
1714 #include <linux/hw_breakpoint.h>
18
-#include <sys/ioctl.h>
1915
2016 #include "tests.h"
2117 #include "debug.h"
22
-#include "perf.h"
18
+#include "event.h"
19
+#include "../perf-sys.h"
2320 #include "cloexec.h"
2421
25
-volatile long the_var;
22
+static volatile long the_var;
2623
2724 static noinline int test_function(void)
2825 {
....@@ -191,3 +188,19 @@
191188
192189 return bp_accounting(wp_cnt, share);
193190 }
191
+
192
+bool test__bp_account_is_supported(void)
193
+{
194
+ /*
195
+ * PowerPC and S390 do not support creation of instruction
196
+ * breakpoints using the perf_event interface.
197
+ *
198
+ * Just disable the test for these architectures until these
199
+ * issues are resolved.
200
+ */
201
+#if defined(__powerpc__) || defined(__s390x__)
202
+ return false;
203
+#else
204
+ return true;
205
+#endif
206
+}