aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-03-08 19:41:05 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-03-08 19:41:05 +0000
commit44ad5475222d2043df40fcbe3f5703915ee16468 (patch)
tree2da9212f02713305c4064fc6709c0a7a490815ce /sys/kern/sched_4bsd.c
parentfb175d1c8134efd7016acfbc1e725bd99df80eb9 (diff)
downloadsrc-44ad5475222d2043df40fcbe3f5703915ee16468.tar.gz
src-44ad5475222d2043df40fcbe3f5703915ee16468.zip
Add a new sched_clear_name() method to the scheduler interface to clear
the cached name used for KTR_SCHED traces when a thread's name changes. This way KTR_SCHED traces (and thus schedgraph) will notice when a thread's name changes, most commonly via execve(). MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=232700
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 16cc033204e4..1bd1cdd5ef5a 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1614,6 +1614,17 @@ sched_tdname(struct thread *td)
#endif
}
+#ifdef KTR
+void
+sched_clear_tdname(struct thread *td)
+{
+ struct td_sched *ts;
+
+ ts = td->td_sched;
+ ts->ts_name[0] = '\0';
+}
+#endif
+
void
sched_affinity(struct thread *td)
{