trace thread running state when a thread is run for the first time

This applies to both KTR_SCHED and DTrace sched:::on-cpu tracing.

MFC after:	10 days
This commit is contained in:
Andriy Gapon 2017-03-11 15:57:36 +00:00
parent 6c9271a918
commit 28ef18b8c1
2 changed files with 8 additions and 0 deletions

View File

@ -1666,6 +1666,10 @@ sched_fork_exit(struct thread *td)
lock_profile_obtain_lock_success(&sched_lock.lock_object,
0, 0, __FILE__, __LINE__);
THREAD_LOCK_ASSERT(td, MA_OWNED | MA_NOTRECURSED);
KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running",
"prio:%d", td->td_priority);
SDT_PROBE0(sched, , , on__cpu);
}
char *

View File

@ -2756,6 +2756,10 @@ sched_fork_exit(struct thread *td)
TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED);
lock_profile_obtain_lock_success(
&TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__);
KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running",
"prio:%d", td->td_priority);
SDT_PROBE0(sched, , , on__cpu);
}
/*