summaryrefslogtreecommitdiffstats
path: root/runtime/io.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-09-02 12:01:27 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-09-02 12:01:27 -0400
commite66aaecc057ef417d0dd1d0b94454f6704147e7f (patch)
tree9eb27159000da1d759c4b12c9af4cb04ebc9abed /runtime/io.c
parentcce3b4efd1f1401246f1e1301040414db00891fa (diff)
downloadsystemtap-steved-e66aaecc057ef417d0dd1d0b94454f6704147e7f.tar.gz
systemtap-steved-e66aaecc057ef417d0dd1d0b94454f6704147e7f.tar.xz
systemtap-steved-e66aaecc057ef417d0dd1d0b94454f6704147e7f.zip
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.
Diffstat (limited to 'runtime/io.c')
-rw-r--r--runtime/io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/io.c b/runtime/io.c
index 8ddb53ac..687926fd 100644
--- a/runtime/io.c
+++ b/runtime/io.c
@@ -23,6 +23,9 @@
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;
char *buf = per_cpu_ptr(Stp_lbuf, get_cpu());
@@ -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';