zircon/kernel/kernel/scheduler.cc
// Writes a context switch record to the ktrace buffer. This is always enabled
// so that user mode tracing can track which threads are running.
Writes a context switch record to the ktrace buffer. This is always enabled
so that user mode tracing can track which threads are running.
Writes a context switch record to the ktrace buffer . This is always enabled so that user mode tracing can track which threads are running .
inline void TraceContextSwitch(const Thread* current_thread, const Thread* next_thread,
                               cpu_num_t current_cpu) {
  const auto raw_current = reinterpret_cast<uintptr_t>(current_thread);
  const auto raw_next = reinterpret_cast<uintptr_t>(next_thread);
  const auto current = static_cast<uint32_t>(raw_current);
  const auto next = static_cast<uint32_t>(raw_next);
  const auto user_tid = static_cast<uint32_t>(next_thread->user_tid());
  const uint32_t context = current_cpu | (current_thread->state() << 8) |
                           (current_thread->scheduler_state().base_priority() << 16) |
                           (next_thread->scheduler_state().base_priority() << 24);
  ktrace(TAG_CONTEXT_SWITCH, user_tid, context, current, next);
}
inline void TraceContextSwitch ( const Thread * current_thread , const Thread * next_thread , cpu_num_t current_cpu ) { const auto raw_current = reinterpret_cast < uintptr_t > ( current_thread ) ; const auto raw_next = reinterpret_cast < uintptr_t > ( next_thread ) ; const auto current = static_cast < uint32_t > ( raw_current ) ; const auto next = static_cast < uint32_t > ( raw_next ) ; const auto user_tid = static_cast < uint32_t > ( next_thread -> user_tid ( ) ) ; const uint32_t context = current_cpu | ( current_thread -> state ( ) << 8 ) | ( current_thread -> scheduler_state ( ) . base_priority ( ) << 16 ) | ( next_thread -> scheduler_state ( ) . base_priority ( ) << 24 ) ; ktrace ( TAG_CONTEXT_SWITCH , user_tid , context , current , next ) ; }
Writes a context switch record to the ktrace buffer.
Writes a context switch record to the ktrace buffer .