Use cpu index instead of the machine dependend, not very expressive

cpuid when naming user-visible kernel entities.
This commit is contained in:
martin 2008-03-10 22:20:14 +00:00
parent 1d7e476b69
commit d8788e7fd7
7 changed files with 28 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_cctr.c,v 1.3 2007/11/08 20:10:26 drochner Exp $ */
/* $NetBSD: kern_cctr.c,v 1.4 2008/03/10 22:20:14 martin Exp $ */
/*-
@ -83,7 +83,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/sys/i386/i386/tsc.c,v 1.204 2003/10/21 18:28:34 silby Exp $"); */
__KERNEL_RCSID(0, "$NetBSD: kern_cctr.c,v 1.3 2007/11/08 20:10:26 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_cctr.c,v 1.4 2008/03/10 22:20:14 martin Exp $");
#include "opt_multiprocessor.h"
@ -294,9 +294,9 @@ cc_calibrate_cpu(struct cpu_info *ci)
factor = -factor;
if (factor > old_factor / 10)
printf("cc_calibrate_cpu[%lu]: 10%% exceeded - delta %"
printf("cc_calibrate_cpu[%u]: 10%% exceeded - delta %"
PRId64 ", denom %" PRId64 ", factor %" PRId64
", old factor %" PRId64"\n", ci->ci_cpuid,
", old factor %" PRId64"\n", ci->ci_index,
delta, denom, (delta * 1000) / denom, old_factor);
#endif /* TIMECOUNTER_DEBUG */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_idle.c,v 1.11 2008/02/14 14:26:57 ad Exp $ */
/* $NetBSD: kern_idle.c,v 1.12 2008/03/10 22:20:14 martin Exp $ */
/*-
* Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi,
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.11 2008/02/14 14:26:57 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.12 2008/03/10 22:20:14 martin Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@ -92,7 +92,7 @@ create_idle_lwp(struct cpu_info *ci)
KASSERT(ci->ci_data.cpu_idlelwp == NULL);
error = kthread_create(PRI_IDLE, KTHREAD_MPSAFE | KTHREAD_IDLE,
ci, idle_loop, NULL, &l, "idle/%d", (int)ci->ci_cpuid);
ci, idle_loop, NULL, &l, "idle/%u", ci->ci_index);
if (error != 0)
panic("create_idle_lwp: error %d", error);
lwp_lock(l);

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_softint.c,v 1.11 2008/02/06 15:34:36 yamt Exp $ */
/* $NetBSD: kern_softint.c,v 1.12 2008/03/10 22:20:14 martin Exp $ */
/*-
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@ -183,7 +183,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.11 2008/02/06 15:34:36 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.12 2008/03/10 22:20:14 martin Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -254,16 +254,16 @@ softint_init_isr(softcpu_t *sc, const char *desc, pri_t pri, u_int level)
error = kthread_create(pri, KTHREAD_MPSAFE | KTHREAD_INTR |
KTHREAD_IDLE, ci, softint_thread, si, &si->si_lwp,
"soft%s/%d", desc, (int)ci->ci_cpuid);
"soft%s/%u", desc, ci->ci_index);
if (error != 0)
panic("softint_init_isr: error %d", error);
snprintf(si->si_name, sizeof(si->si_name), "%s/%d", desc,
(int)ci->ci_cpuid);
snprintf(si->si_name, sizeof(si->si_name), "%s/%u", desc,
ci->ci_index);
evcnt_attach_dynamic(&si->si_evcnt, EVCNT_TYPE_INTR, NULL,
"softint", si->si_name);
snprintf(si->si_name_block, sizeof(si->si_name_block), "%s block/%d",
desc, (int)ci->ci_cpuid);
snprintf(si->si_name_block, sizeof(si->si_name_block), "%s block/%u",
desc, ci->ci_index);
evcnt_attach_dynamic(&si->si_evcnt_block, EVCNT_TYPE_INTR, NULL,
"softint", si->si_name_block);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sched_m2.c,v 1.20 2008/02/14 14:26:57 ad Exp $ */
/* $NetBSD: sched_m2.c,v 1.21 2008/03/10 22:20:14 martin Exp $ */
/*
* Copyright (c) 2007, 2008 Mindaugas Rasiukevicius <rmind at NetBSD org>
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.20 2008/02/14 14:26:57 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.21 2008/03/10 22:20:14 martin Exp $");
#include <sys/param.h>
@ -1045,7 +1045,7 @@ sched_print_runqueue(void (*pr)(const char *, ...))
for (CPU_INFO_FOREACH(cii, ci)) {
ci_rq = ci->ci_schedstate.spc_sched_info;
(*pr)("Run-queue (CPU = %d):\n", ci->ci_cpuid);
(*pr)("Run-queue (CPU = %u):\n", ci->ci_index);
(*pr)(" pid.lid = %d.%d, threads count = %u, "
"avgcount = %u, highest pri = %d\n",
ci->ci_curlwp->l_proc->p_pid, ci->ci_curlwp->l_lid,
@ -1066,12 +1066,12 @@ sched_print_runqueue(void (*pr)(const char *, ...))
LIST_FOREACH(l, &p->p_lwps, l_sibling) {
sil = l->l_sched_info;
ci = l->l_cpu;
(*pr)(" | %5d %4u %4u 0x%8.8x %3s %4u %11p %3d "
(*pr)(" | %5d %4u %4u 0x%8.8x %3s %4u %11p %3u "
"%u ST=%d RT=%d %d\n",
(int)l->l_lid, l->l_priority, lwp_eprio(l),
l->l_flag, l->l_stat == LSRUN ? "RQ" :
(l->l_stat == LSSLEEP ? "SQ" : "-"),
sil->sl_timeslice, l, ci->ci_cpuid,
sil->sl_timeslice, l, ci->ci_index,
(u_int)(hardclock_ticks - sil->sl_lrtime),
sil->sl_slpsum, sil->sl_rtsum, sil->sl_flags);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_pool.c,v 1.152 2008/03/02 12:19:58 yamt Exp $ */
/* $NetBSD: subr_pool.c,v 1.153 2008/03/10 22:20:14 martin Exp $ */
/*-
* Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.152 2008/03/02 12:19:58 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.153 2008/03/10 22:20:14 martin Exp $");
#include "opt_ddb.h"
#include "opt_pool.h"
@ -3062,7 +3062,7 @@ found:
snprintf(cpucachestr,
sizeof(cpucachestr),
"cached by CPU %u",
(u_int)ci->ci_cpuid);
ci->ci_index);
goto print;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_workqueue.c,v 1.22 2007/12/05 07:06:54 ad Exp $ */
/* $NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $ */
/*-
* Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.22 2007/12/05 07:06:54 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@ -168,7 +168,7 @@ workqueue_initqueue(struct workqueue *wq, struct workqueue_queue *q,
ktf = ((wq->wq_flags & WQ_MPSAFE) != 0 ? KTHREAD_MPSAFE : 0);
if (ci) {
error = kthread_create(wq->wq_prio, ktf, ci, workqueue_worker,
wq, &q->q_worker, "%s/%u", wq->wq_name, (u_int)ci->ci_cpuid);
wq, &q->q_worker, "%s/%u", wq->wq_name, ci->ci_index);
} else {
error = kthread_create(wq->wq_prio, ktf, ci, workqueue_worker,
wq, &q->q_worker, "%s", wq->wq_name);

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_xcall.c,v 1.5 2007/11/06 00:42:44 ad Exp $ */
/* $NetBSD: subr_xcall.c,v 1.6 2008/03/10 22:20:14 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.5 2007/11/06 00:42:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.6 2008/03/10 22:20:14 martin Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -131,7 +131,7 @@ xc_init_cpu(struct cpu_info *ci)
cv_init(&ci->ci_data.cpu_xcall, "xcall");
error = kthread_create(PRI_XCALL, KTHREAD_MPSAFE, ci, xc_thread,
NULL, NULL, "xcall/%d", (int)ci->ci_cpuid);
NULL, NULL, "xcall/%u", ci->ci_index);
if (error != 0)
panic("xc_init_cpu: error %d", error);
}