FreeBSD kernel kern code
subr_stack.c File Reference
#include "opt_ddb.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/linker.h>
#include <sys/malloc.h>
#include <sys/sbuf.h>
#include <sys/stack.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
Include dependency graph for subr_stack.c:

Go to the source code of this file.

Functions

 __FBSDID ("$BSDSUniX$")
 
 FEATURE (stack,"Support for capturing kernel stack")
 
static MALLOC_DEFINE (M_STACK,"stack","Stack Traces")
 
static int stack_symbol (vm_offset_t pc, char *namebuf, u_int buflen, long *offset)
 
static int stack_symbol_ddb (vm_offset_t pc, const char **name, long *offset)
 
struct stack * stack_create (void)
 
void stack_destroy (struct stack *st)
 
int stack_put (struct stack *st, vm_offset_t pc)
 
void stack_copy (struct stack *src, struct stack *dst)
 
void stack_zero (struct stack *st)
 
void stack_print (struct stack *st)
 
void stack_print_short (struct stack *st)
 
void stack_print_ddb (struct stack *st)
 
void stack_sbuf_print (struct sbuf *sb, struct stack *st)
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
FEATURE ( stack  ,
"Support for capturing kernel stack"   
)
static MALLOC_DEFINE ( M_STACK  ,
"stack"  ,
"Stack Traces"   
)
static
void stack_copy ( struct stack *  src,
struct stack *  dst 
)

Definition at line 80 of file subr_stack.c.

Referenced by sysctl_debug_witness_badstacks().

Here is the caller graph for this function:

struct stack* stack_create ( void  )

Definition at line 53 of file subr_stack.c.

References malloc().

Here is the call graph for this function:

void stack_destroy ( struct stack *  st)

Definition at line 62 of file subr_stack.c.

References free().

Here is the call graph for this function:

void stack_print ( struct stack *  st)

Definition at line 94 of file subr_stack.c.

References printf(), and stack_symbol().

Here is the call graph for this function:

void stack_print_ddb ( struct stack *  st)

Definition at line 130 of file subr_stack.c.

References name, printf(), and stack_symbol_ddb().

Referenced by kdb_backtrace(), and kdb_backtrace_thread().

Here is the call graph for this function:

Here is the caller graph for this function:

void stack_print_short ( struct stack *  st)

Definition at line 110 of file subr_stack.c.

References printf(), and stack_symbol().

Here is the call graph for this function:

int stack_put ( struct stack *  st,
vm_offset_t  pc 
)

Definition at line 69 of file subr_stack.c.

void stack_sbuf_print ( struct sbuf *  sb,
struct stack *  st 
)

Definition at line 170 of file subr_stack.c.

References sbuf_printf(), and stack_symbol().

Referenced by sysctl_debug_witness_badstacks().

Here is the call graph for this function:

Here is the caller graph for this function:

static int stack_symbol ( vm_offset_t  pc,
char *  namebuf,
u_int  buflen,
long *  offset 
)
static

Definition at line 247 of file subr_stack.c.

References linker_search_symbol_name().

Referenced by stack_print(), stack_print_short(), and stack_sbuf_print().

Here is the call graph for this function:

Here is the caller graph for this function:

static int stack_symbol_ddb ( vm_offset_t  pc,
const char **  name,
long *  offset 
)
static

Definition at line 260 of file subr_stack.c.

References linker_ddb_search_symbol(), linker_ddb_symbol_values(), and sym.

Referenced by stack_print_ddb().

Here is the call graph for this function:

Here is the caller graph for this function:

void stack_zero ( struct stack *  st)

Definition at line 87 of file subr_stack.c.

Referenced by kdb_backtrace(), kdb_backtrace_thread(), sysctl_debug_witness_badstacks(), and witness_lock_order_add().

Here is the caller graph for this function: