| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select |
|---|
| 3 | 4 | * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu. |
|---|
| .. | .. |
|---|
| 9 | 10 | #include <unistd.h> |
|---|
| 10 | 11 | #include <string.h> |
|---|
| 11 | 12 | #include <sys/ioctl.h> |
|---|
| 12 | | -#include <time.h> |
|---|
| 13 | 13 | #include <fcntl.h> |
|---|
| 14 | | -#include <signal.h> |
|---|
| 15 | | -#include <sys/mman.h> |
|---|
| 16 | | -#include <linux/compiler.h> |
|---|
| 17 | 14 | #include <linux/hw_breakpoint.h> |
|---|
| 18 | | -#include <sys/ioctl.h> |
|---|
| 19 | 15 | |
|---|
| 20 | 16 | #include "tests.h" |
|---|
| 21 | 17 | #include "debug.h" |
|---|
| 22 | | -#include "perf.h" |
|---|
| 18 | +#include "event.h" |
|---|
| 19 | +#include "../perf-sys.h" |
|---|
| 23 | 20 | #include "cloexec.h" |
|---|
| 24 | 21 | |
|---|
| 25 | | -volatile long the_var; |
|---|
| 22 | +static volatile long the_var; |
|---|
| 26 | 23 | |
|---|
| 27 | 24 | static noinline int test_function(void) |
|---|
| 28 | 25 | { |
|---|
| .. | .. |
|---|
| 191 | 188 | |
|---|
| 192 | 189 | return bp_accounting(wp_cnt, share); |
|---|
| 193 | 190 | } |
|---|
| 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 | +} |
|---|