Hi, I try to build amd64 profiling kernel in accordance with the following guide. http://www.netbsd.org/docs/kernel/profiling/
Howerver, GENERIC.PROF kernel build failure. I make the following patch to fix this build failure. ==================== diff --git a/sys/arch/amd64/include/profile.h b/sys/arch/amd64/include/profile.h index f760594..24ea606 100644 --- a/sys/arch/amd64/include/profile.h +++ b/sys/arch/amd64/include/profile.h @@ -85,7 +85,7 @@ __asm(" .globl __mcount \n" \ #ifdef _KERNEL #ifdef MULTIPROCESSOR -__cpu_simple_lock_t __mcount_lock; +extern __cpu_simple_lock_t __mcount_lock; static inline void MCOUNT_ENTER_MP(void) diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index 1f9136e..fbc0e17 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -48,6 +48,10 @@ __KERNEL_RCSID(0, "$NetBSD: subr_prof.c,v 1.47 2014/07/10 21:13:52 christos Exp #include <sys/malloc.h> #include <sys/gmon.h> +#ifdef MULTIPROCESSOR +__cpu_simple_lock_t __mcount_lock; +#endif + MALLOC_DEFINE(M_GPROF, "gprof", "kernel profiling buffer"); /* ==================== Could you comment this patch? Thanks, -- ////////////////////////////////////////////////////////////////////// Internet Initiative Japan Inc. Device Engineering Section, Core Product Development Department, Product Division, Technology Unit Kengo NAKAHARA <k-nakah...@iij.ad.jp>