aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-03-11 15:57:36 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-03-11 15:57:36 +0000
commit28ef18b8c1abf8859fb74c26c6cecbe4c50b1318 (patch)
tree7cace7df21c038a36459c5c9a76b503e7de7c9ad /sys/kern/sched_4bsd.c
parent6c9271a918fe4ebadb5a9ee73ffdc9fdc3fc7aee (diff)
downloadsrc-28ef18b8c1abf8859fb74c26c6cecbe4c50b1318.tar.gz
src-28ef18b8c1abf8859fb74c26c6cecbe4c50b1318.zip
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
Notes
Notes: svn path=/head/; revision=315075
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 534f59cd5a42..27d69a275c3f 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -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 *