diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-09-04 16:41:55 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-09-08 20:36:51 -0400 |
commit | cf509e712520c6e18ecdf290b5ef85811e8ef013 (patch) | |
tree | 8c6128c6d547e252ce8c8ad5173e3432253a6254 /runtime/io.c | |
parent | f4d4e917467665003110d412819ed2433a887fcc (diff) | |
download | systemtap-steved-cf509e712520c6e18ecdf290b5ef85811e8ef013.tar.gz systemtap-steved-cf509e712520c6e18ecdf290b5ef85811e8ef013.tar.xz systemtap-steved-cf509e712520c6e18ecdf290b5ef85811e8ef013.zip |
runtime diagnostics: remove ANSI goo, add -DSTAP_DEBUG_PRINTK option.
* runtime/io.c (_stp_vlog): Don't put ansi highlighting into debugging
messages. #if STAP_DEBUG_PRINTK, direct all diagnostics to appropriate
printk channel instead of runtime trace buffer.
Diffstat (limited to 'runtime/io.c')
-rw-r--r-- | runtime/io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/io.c b/runtime/io.c index 687926fd..0136aae5 100644 --- a/runtime/io.c +++ b/runtime/io.c @@ -32,7 +32,7 @@ static void _stp_vlog (enum code type, const char *func, int line, const char *f int start = 0; if (type == DBUG) { - start = _stp_snprintf(buf, STP_LOG_BUF_LEN, "\033[36m%s:%d:\033[0m ", func, line); + start = _stp_snprintf(buf, STP_LOG_BUF_LEN, "%s:%d: ", func, line); } else if (type == WARN) { strcpy (buf, WARN_STRING); start = sizeof(WARN_STRING) - 1; @@ -49,12 +49,19 @@ static void _stp_vlog (enum code type, const char *func, int line, const char *f buf[num + start] = '\0'; } +#ifdef STAP_DEBUG_PRINTK + if (type == DBUG) printk (KERN_DEBUG "%s", buf); + else if (type == WARN) printk (KERN_WARNING "%s", buf); + else if (type == ERROR) printk (KERN_ERR "%s", buf); + else printk (KERN_INFO "%s", buf); +#else if (type != DBUG) _stp_ctl_write(STP_OOB_DATA, buf, start + num + 1); else { _stp_print(buf); _stp_print_flush(); } +#endif } put_cpu(); } |