Go to the source code of this file.
Defines | |
#define | STP_BUF_LEN 8191 |
Functions | |
void | dlog (const char *fmt,...) |
Logs data. | |
void | _stp_print_buf (const char *fmt,...) |
Print into the print buffer. | |
void | _stp_print_buf_init (void) |
Clear the print buffer. | |
void | _stp_print_symbol (const char *fmt, unsigned long address) |
Print addresses symbolically into the print buffer. | |
unsigned long | cur_ret_addr (struct pt_regs *regs) |
Get the current return address. | |
Variables | |
static const char *(* | _stp_kallsyms_lookup )(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, char *namebuf) = (void *)KALLSYMS_LOOKUP |
Lookup symbol. | |
static char | _stp_pbuf [8191+1] |
Static buffer for printing. | |
static int | _stp_pbuf_len = 8191 |
Definition in file io.c.
|
Print into the print buffer. Like printf, except output goes into _stp_pbuf, which will contain the null-terminated output. Safe because overflowing _stp_pbuf is not allowed. Size is limited by length of print buffer.
Definition at line 55 of file io.c. References _stp_pbuf. Referenced by _stp_print_symbol(). |
|
Clear the print buffer. Output from _stp_print_buf() will accumulate in the buffer until this is called. Definition at line 72 of file io.c. References _stp_pbuf. |
|
Print addresses symbolically into the print buffer.
Definition at line 85 of file io.c. References _stp_kallsyms_lookup, and _stp_print_buf(). |
|
Get the current return address. Call from kprobes (not jprobes).
|
|
Logs data. This function is compatible with printk. In fact it currently sends all output to vprintk, after sending "STP: ". This allows us to easily detect SystemTap output in the log file.
Definition at line 16 of file io.c. Referenced by _stp_list_clear(), _stp_register_jprobes(), _stp_register_kprobes(), _stp_unregister_jprobes(), and _stp_unregister_kprobes(). |
|
Lookup symbol. This simply calls the kernel function kallsyms_lookup(). That function is not exported, so this workaround is required. See the kernel source, kernel/kallsyms.c for more information. Definition at line 31 of file io.c. Referenced by _stp_print_symbol(). |