/* * PowerPC and S390 do not support creation of instruction breakpoints using the * perf_event interface. * * Just disable the test for these architectures until these issues are * resolved.
*/ #ifdefined(__powerpc__) || defined(__s390x__) #define BP_ACCOUNT_IS_SUPPORTED 0 #else #define BP_ACCOUNT_IS_SUPPORTED 1 #endif
staticvolatilelong the_var;
static noinline int test_function(void)
{ return 0;
}
for (i = 0; i < wp_cnt; i++) {
fd[i] = wp_event((void *)&the_var, &attr); if (fd[i] == -1) {
pr_err("failed to create wp\n"); goto out;
}
}
for (; i < (bp_cnt + wp_cnt); i++) {
fd[i] = bp_event((void *)test_function, &attr); if (fd[i] == -1) break;
}
ret = i != (bp_cnt + wp_cnt);
out: while (i--)
close(fd[i]);
free(fd); return ret;
}
/* * This test does following: * - detects the number of watch/break-points, * skip test if any is missing * - detects PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl, * skip test if it's missing * - detects if watchpoints and breakpoints share * same slots * - create all possible watchpoints on cpu 0 * - change one of it to breakpoint * - in case wp and bp do not share slots, * we create another watchpoint to ensure * the slot accounting is correct
*/ staticint test__bp_accounting(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ int has_ioctl = detect_ioctl(); int wp_cnt = detect_cnt(false); int bp_cnt = detect_cnt(true); int share = detect_share(wp_cnt, bp_cnt);
if (!BP_ACCOUNT_IS_SUPPORTED) {
pr_debug("Test not supported on this architecture"); return TEST_SKIP;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.