summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pcpu.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2009-01-17 07:17:57 +0000
committerjeff <jeff@FreeBSD.org>2009-01-17 07:17:57 +0000
commit3d8d825555e01db8b5e675c6852c0b611791c3eb (patch)
treede5dcf2f543f8bc9f57e15ad2509863476bbe371 /sys/kern/subr_pcpu.c
parentc4410efa0c6a38771669b82f73318d656bd1edd6 (diff)
downloadFreeBSD-src-3d8d825555e01db8b5e675c6852c0b611791c3eb.zip
FreeBSD-src-3d8d825555e01db8b5e675c6852c0b611791c3eb.tar.gz
- Implement generic macros for producing KTR records that are compatible
with src/tools/sched/schedgraph.py. This allows developers to quickly create a graphical view of ktr data for any resource in the system. - Add sched_tdname() and the pcpu field 'name' for quickly and uniformly identifying records associated with a thread or cpu. - Reimplement the KTR_SCHED traces using the new generic facility. Obtained from: attilio Discussed with: jhb Sponsored by: Nokia
Diffstat (limited to 'sys/kern/subr_pcpu.c')
-rw-r--r--sys/kern/subr_pcpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c
index e9fb8d0d..ea25aa7 100644
--- a/sys/kern/subr_pcpu.c
+++ b/sys/kern/subr_pcpu.c
@@ -76,6 +76,9 @@ pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
cpu_pcpu_init(pcpu, cpuid, size);
pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue;
pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue;
+#ifdef KTR
+ snprintf(pcpu->pc_name, sizeof(pcpu->pc_name), "CPU %d", cpuid);
+#endif
}
OpenPOWER on IntegriCloud