diff options
author | John Baldwin <jhb@FreeBSD.org> | 2012-03-08 19:41:05 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2012-03-08 19:41:05 +0000 |
commit | 44ad5475222d2043df40fcbe3f5703915ee16468 (patch) | |
tree | 2da9212f02713305c4064fc6709c0a7a490815ce /sys/kern/sched_4bsd.c | |
parent | fb175d1c8134efd7016acfbc1e725bd99df80eb9 (diff) | |
download | src-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.c | 11 |
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) { |