summaryrefslogtreecommitdiffstats
path: root/runtime/io.c
diff options
context:
space:
mode:
authorhunt <hunt>2008-01-30 00:45:45 +0000
committerhunt <hunt>2008-01-30 00:45:45 +0000
commit787abf66a1807e62f54b84732bcc6a12480db8ed (patch)
tree36f29aac665a4cfa3ce433135ea919761208a898 /runtime/io.c
parent5d03112aaed421893cc08a6112b699995d254506 (diff)
downloadsystemtap-steved-787abf66a1807e62f54b84732bcc6a12480db8ed.tar.gz
systemtap-steved-787abf66a1807e62f54b84732bcc6a12480db8ed.tar.xz
systemtap-steved-787abf66a1807e62f54b84732bcc6a12480db8ed.zip
2008-01-29 Martin Hunt <hunt@redhat.com>
* io.c (_stp_vlog): Use get_cpu() instead of smp_processor_id() because this function can get called with interrupts enabled.
Diffstat (limited to 'runtime/io.c')
-rw-r--r--runtime/io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/io.c b/runtime/io.c
index e36381bd..c49d86e6 100644
--- a/runtime/io.c
+++ b/runtime/io.c
@@ -1,6 +1,6 @@
/* -*- linux-c -*-
* I/O for printing warnings, errors and debug messages
- * Copyright (C) 2005, 2006, 2007 Red Hat Inc.
+ * Copyright (C) 2005-2008 Red Hat Inc.
*
* This file is part of systemtap, and is free software. You can
* redistribute it and/or modify it under the terms of the GNU General
@@ -25,7 +25,7 @@ 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)
{
int num;
- char *buf = per_cpu_ptr(Stp_lbuf, smp_processor_id());
+ char *buf = per_cpu_ptr(Stp_lbuf, get_cpu());
int start = 0;
if (type == DBUG) {
@@ -53,6 +53,7 @@ static void _stp_vlog (enum code type, const char *func, int line, const char *f
_stp_print_flush();
}
}
+ put_cpu();
}
/** Logs Data.