From d4c94410f6615f5725c1df4bb3d92f167767a8fa Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 25 Jan 2009 07:35:10 +0000 Subject: [PATCH] - Use __XSTRING where I want the define to be expanded. This resulted in sizeof("MAXCPU") being used to calculate a string length rather than something more reasonable such as sizeof("32"). This shouldn't have caused any ill effect until we run on machines with 1000000 or more cpus. --- sys/kern/sched_4bsd.c | 2 +- sys/kern/sched_ule.c | 4 ++-- sys/sys/pcpu.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index cf669c9d2ca4..4fe1c1415f2c 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -82,7 +82,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #endif #define NICE_WEIGHT 1 /* Priorities per nice level. */ -#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX))) +#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) /* * The schedulable entity that runs a context. diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 3a06223d414a..96f7280473fd 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -86,8 +86,8 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #define KTR_ULE 0 -#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX))) -#define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__STRING(MAXCPU))) +#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) +#define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) #define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) /* diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index ddda354b0d01..a1052e6d004d 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -54,7 +54,7 @@ struct rm_queue { struct rm_queue* volatile rmq_prev; }; -#define PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__STRING(MAXCPU) + 1)) +#define PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU) + 1)) /*