From c2cff575b7819b64bfd19bb7feae00e92b158a23 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 3 Jun 2022 03:52:43 +0200 Subject: [PATCH] Add debug info to track down M1 time-constraint issue --- libs/pbd/pthread_utils.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index 5b1c82ae02..457518b67f 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -424,6 +424,11 @@ pbd_mach_set_realtime_policy (pthread_t thread_id, double period_ns, bool main) tcp.constraint = ticks_per_ns * period_clk * .95; tcp.preemptible = true; +#ifndef NDEBUG + printf ("period_ns=%f timebase.num=%d timebase_den=%d\n", period_ns, timebase_info.numer, timebase_info.denom); + printf ("Mach Thread(%p) request: period=%d comp=%d constraint=%d preemt=%d\n", thread_id, tcp.period, tcp.computation, tcp.constraint, tcp.preemptible); +#endif + res = thread_policy_set (pthread_mach_thread_np (thread_id), THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t)&tcp,