]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kperf/thread_samplers.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / kperf / thread_samplers.c
index 901e500f750dd8b775e1c45e95970f08db7ff551..867215fb1d48dab130484ef77be49859ff5d56f6 100644 (file)
@@ -91,12 +91,12 @@ kperf_thread_info_runmode_legacy(thread_t thread)
                kperf_state |= KPERF_TI_IDLE;
        }
 
-#if !CONFIG_EMBEDDED
+#if defined(XNU_TARGET_OS_OSX)
        /* on desktop, if state is blank, leave not idle set */
        if (kperf_state == 0) {
                return TH_IDLE << 16;
        }
-#endif /* !CONFIG_EMBEDDED */
+#endif /* defined(XNU_TARGET_OS_OSX) */
 
        /* high two bytes are inverted mask, low two bytes are normal */
        return ((~kperf_state & 0xffff) << 16) | (kperf_state & 0xffff);
@@ -247,7 +247,10 @@ kperf_thread_snapshot_sample(struct kperf_thread_snapshot *thsn,
        }
 
        thsn->kpthsn_suspend_count = thread->suspend_count;
-       thsn->kpthsn_io_tier = proc_get_effective_thread_policy(thread, TASK_POLICY_IO);
+       /*
+        * Only have room for 8-bits in the trace event, so truncate here.
+        */
+       thsn->kpthsn_io_tier = (uint8_t)proc_get_effective_thread_policy(thread, TASK_POLICY_IO);
 
        BUF_VERB(PERF_TI_SNAPSAMPLE | DBG_FUNC_END);
 }
@@ -321,9 +324,11 @@ out:
 }
 
 int
-kperf_thread_dispatch_pend(struct kperf_context *context)
+kperf_thread_dispatch_pend(struct kperf_context *context,
+    unsigned int actionid)
 {
-       return kperf_ast_pend(context->cur_thread, T_KPERF_AST_DISPATCH);
+       return kperf_ast_pend(context->cur_thread, T_KPERF_AST_DISPATCH,
+                  actionid);
 }
 
 void