From e66aaecc057ef417d0dd1d0b94454f6704147e7f Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 2 Sep 2009 12:01:27 -0400 Subject: PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtime _stp_vscnprintf is only suitable for calls from the script, with slightly different conventions (64-bit ints/pointers, extra formatting directives). * runtime/runtime.h (_stp_{dbug,warn,error}): Add __attribute__ format(printf). * runtime/io.c (_stp_vlog): Ditto. Use vscnprintf(). * runtime/sym.c (_stp_module_check): Remove hexdumping (%.*M) of mismatching buildids. Switch to _stp_warn from printk (KERN_WARNING). * translate.cxx, runtime/unwind.c: Numerous print formatting tweaks. --- runtime/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime/io.c') diff --git a/runtime/io.c b/runtime/io.c index 8ddb53ac..687926fd 100644 --- a/runtime/io.c +++ b/runtime/io.c @@ -22,6 +22,9 @@ #define ERR_STRING "ERROR: " enum code { INFO=0, WARN, ERROR, DBUG }; +static void _stp_vlog (enum code type, const char *func, int line, const char *fmt, va_list args) + __attribute ((format (printf, 4, 0))); + static void _stp_vlog (enum code type, const char *func, int line, const char *fmt, va_list args) { int num; @@ -38,7 +41,7 @@ static void _stp_vlog (enum code type, const char *func, int line, const char *f start = sizeof(ERR_STRING) - 1; } - num = _stp_vscnprintf (buf + start, STP_LOG_BUF_LEN - start - 1, fmt, args); + num = vscnprintf (buf + start, STP_LOG_BUF_LEN - start - 1, fmt, args); if (num + start) { if (buf[num + start - 1] != '\n') { buf[num + start] = '\n'; -- cgit