Build in kernel support for loading DTrace modules by default. This

adds the hooks that DTrace modules register with, and adds a few functions
which have the dtrace_ prefix to allow the DTrace FBT (function boundary
trace) provider to avoid tracing because they are called from the DTtrace
probe context.

Unlike other forms of tracing and debug, DTrace support in the kernel
incurs negligible run-time cost.

I think the only reason why anyone wouldn't want to have kernel support
enabled for DTrace would be due to the license (CDDL) under which DTrace
is released.
This commit is contained in:
John Birrell 2006-11-04 04:58:10 +00:00
parent f4c93e2c4a
commit 1f80cd9398
8 changed files with 27 additions and 6 deletions

View File

@ -17,3 +17,6 @@ device uart_ns8250
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -21,3 +21,6 @@ device uart_ns8250
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -20,3 +20,6 @@ options GEOM_MBR
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -23,3 +23,6 @@ device uart_ns8250
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -14,3 +14,6 @@ device uart_z8530
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -15,3 +15,6 @@ device uart_z8530
# KSE support went from being default to a kernel option
options KSE
# Kernel support for loading DTrace modules
options KDTRACE

View File

@ -329,6 +329,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
OF_getprop(child, "clock-frequency", &clock, sizeof(clock));
tick_init(clock);
/*
* Initialize global registers.
*/
pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1;
cpu_setregs(pc);
/*
* Initialize the console before printing anything.
*/
@ -409,7 +415,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
* stack, so don't pass the real size (PAGE_SIZE) to pcpu_init or
* it'll zero it out from under us.
*/
pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1;
pcpu_init(pc, 0, sizeof(struct pcpu));
pc->pc_curthread = &thread0;
pc->pc_curpcb = thread0.td_pcb;
@ -420,11 +425,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN;
pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX;
/*
* Initialize global registers.
*/
cpu_setregs(pc);
/*
* Initialize the message buffer (after setting trap table).
*/

View File

@ -7,3 +7,6 @@ machine sun4v
# Pseudo devices.
device mem # Memory and kernel memory devices
# Kernel support for loading DTrace modules
options KDTRACE