X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/a1c7dba18ef36983396c282fe85292db066e39db..3903760236c30e3b5ace7a4eefac3a269d68957c:/tools/tests/jitter/timer_jitter.c diff --git a/tools/tests/jitter/timer_jitter.c b/tools/tests/jitter/timer_jitter.c index abcfe87b8..7e0c9a0c1 100644 --- a/tools/tests/jitter/timer_jitter.c +++ b/tools/tests/jitter/timer_jitter.c @@ -47,6 +47,8 @@ #include #include +#include + typedef enum my_policy_type { MY_POLICY_REALTIME, MY_POLICY_TIMESHARE, MY_POLICY_FIXEDPRI } my_policy_type_t; #define DEFAULT_MAX_SLEEP_NS 2000000000ll /* Two seconds */ @@ -354,6 +356,18 @@ main(int argc, char **argv) exit(1); } + /* + * Disable the wake monitor. If we are + * performing a large number of + * iterations, the wake monitor may + * cause this process to get suspended, + * thus causing a large jitter value. + */ + if (proc_disable_wakemon(getpid()) != KERN_SUCCESS) { + printf("Couldn't disable wake monitor.\n"); + /* For now, do not exit; this call could be locked down */ + } + /* * Repeatedly pick a random timer length and * try to sleep exactly that long