diff options
author | jhb <jhb@FreeBSD.org> | 2012-03-08 19:41:05 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-03-08 19:41:05 +0000 |
commit | 4fea355eb2254754b2e522d87d81c5562252116a (patch) | |
tree | 2da9212f02713305c4064fc6709c0a7a490815ce /sys/kern/sched_4bsd.c | |
parent | 486b631cb38cbd91bd7a8f6ab87a6d0ecdf7a8ac (diff) | |
download | FreeBSD-src-4fea355eb2254754b2e522d87d81c5562252116a.zip FreeBSD-src-4fea355eb2254754b2e522d87d81c5562252116a.tar.gz |
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
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 16cc033..1bd1cdd 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) { |