Date: Wed, 6 Feb 2008 22:03:56 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 134931 for review Message-ID: <200802062203.m16M3uWe011606@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134931 Change 134931 by jb@jb_freebsd1 on 2008/02/06 22:03:40 Add a kdb_enter() stub to the DTrace kernel hooks stuff for the case when the kernel is built without KDB. I don't want DTrace to panic when a DTrace breakpoint is used without KDB. Add the call to kdb_enter() in the DTrace breakpoint action code. Affected files ... .. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/dtrace/dtrace.c#33 edit .. //depot/projects/dtrace/src/sys/kern/kern_dtrace.c#5 edit Differences ... ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/dtrace/dtrace.c#33 (text) ==== @@ -113,6 +113,7 @@ #if !defined(sun) #include <sys/ctype.h> #include <sys/limits.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/sysctl.h> @@ -5374,9 +5375,10 @@ c[i++] = ')'; c[i] = '\0'; -printf("%s(%d): DOODAD\n",__func__,__LINE__); -#ifdef DOODAD +#if defined(sun) debug_enter(c); +#else + kdb_enter(KDB_WHY_DTRACE, "breakpoint action"); #endif } ==== //depot/projects/dtrace/src/sys/kern/kern_dtrace.c#5 (text+ko) ==== @@ -27,9 +27,12 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_kdb.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/eventhandler.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/proc.h> @@ -103,3 +106,15 @@ } SYSINIT(kdtrace, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_dtrace, NULL) + +#ifndef KDB +/* + * This is a stub for the kernel debugger for the DTrace actions to call + * when the kernel has been built without KDB. + */ +void +kdb_enter(const char *why, const char *msg) +{ + printf("Cannot enter kernel debugger - No KDB in kernel.\n%s - %s\n", why, msg); +} +#endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802062203.m16M3uWe011606>