Defines | |
#define | STP_PRINT_BUF_LEN 8000 |
Size of buffer, not including terminating NULL. | |
#define | TIMESTAMP_SIZE 19 |
#define | STP_PRINT_BUF_START (TIMESTAMP_SIZE + 1) |
#define | _stp_print(str) |
Write a String or C string into the print buffer. | |
Functions | |
void | _stp_print_flush (void) |
Send the print buffer now. | |
void | _stp_printf (const char *fmt,...) |
Print into the print buffer. | |
void | _stp_vprintf (const char *fmt, va_list args) |
Print into the print buffer. | |
void | _stp_print_cstr (const char *str) |
Write a C string into the print buffer. | |
char * | _stp_print_clear (void) |
Clear the scratch buffer. | |
void | _stp_print_string (String str) |
Write a String into the print buffer. |
The print buffer is for collecting output to send to the user daemon. This is a per-cpu static buffer. The buffer is sent when _stp_print_flush() is called.
The reason to do this is to allow multiple small prints to be combined then timestamped and sent together to stpd. It could flush automatically on newlines, but what about stack traces which span many lines? So try this and see how it works for us.
|
Value: ({ \ if (__builtin_types_compatible_p (typeof (str), char[])) { \ char *x = (char *)str; \ _stp_print_cstr(x); \ } else { \ String x = (String)str; \ _stp_print_string(x); \ } \ }) This macro selects the proper function to call.
|
|
Clear the scratch buffer. This function should be called before anything is written to the scratch buffer. Output will accumulate in the buffer until this function is called again.
|
|
Write a C string into the print buffer. Copies a string into a print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, STP_PRINT_BUF_LEN. This is more efficient than using _stp_printf() if you don't need fancy formatting.
Definition at line 138 of file print.c. References STP_PRINT_BUF_LEN. Referenced by _stp_print_string(). |
|
Send the print buffer now. Output accumulates in the print buffer until this is called. Size is limited by length of print buffer, STP_PRINT_BUF_LEN. |
|
Write a String into the print buffer. Copies a String into a print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, STP_PRINT_BUF_LEN. This is more efficient than using _stp_printf() if you don't need fancy formatting.
Definition at line 176 of file print.c. References _stp_print_cstr(). |
|
Print into the print buffer. Like printf, except output goes to the print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, STP_PRINT_BUF_LEN.
Definition at line 99 of file print.c. References STP_PRINT_BUF_LEN. Referenced by _stp_symbol_print(). |
|
Print into the print buffer. Use this if your function already has a va_list. You probably want _stp_printf(). Definition at line 117 of file print.c. References STP_PRINT_BUF_LEN. |