summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrz <trz>2005-08-03 21:12:29 +0000
committertrz <trz>2005-08-03 21:12:29 +0000
commitd5d5ee898ced4664141283793a142b992230d2c4 (patch)
tree7e36b9251fea533a08aed2aad629817df19441a0
parent2205d1152e6e9ff34908bf83c3964fb5883adff1 (diff)
downloadsystemtap-steved-d5d5ee898ced4664141283793a142b992230d2c4.tar.gz
systemtap-steved-d5d5ee898ced4664141283793a142b992230d2c4.tar.xz
systemtap-steved-d5d5ee898ced4664141283793a142b992230d2c4.zip
Added transport failure message
-rw-r--r--runtime/ChangeLog6
-rw-r--r--runtime/io.c4
-rw-r--r--runtime/print.c10
3 files changed, 14 insertions, 6 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 6a7651ba..93ba3a61 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-03 Tom Zanussi <trz@us.ibm.com>
+
+ * io.c (_stp_vlog): Remove call to _stp_print_flush().
+ * print.c (_stp_print_flush): _stp_warn() on first
+ transport failure.
+
2005-08-01 Martin Hunt <hunt@redhat.com>
* io.c (_stp_vlog): Use _stp_pid instead os _stp_tport->pid.
diff --git a/runtime/io.c b/runtime/io.c
index 1d378472..c4e3cf2c 100644
--- a/runtime/io.c
+++ b/runtime/io.c
@@ -56,10 +56,6 @@ static void _stp_vlog (enum code type, char *func, int line, const char *fmt, va
buf[num + start] = '\0';
_stp_ctrl_send(STP_REALTIME_DATA, buf, start + num + 1, _stp_pid);
-#ifndef STP_NETLINK_ONLY
- _stp_string_cat_cstr(_stp_stdout,buf);
- _stp_print_flush();
-#endif
}
put_cpu();
}
diff --git a/runtime/print.c b/runtime/print.c
index f340a3a1..d262c9ed 100644
--- a/runtime/print.c
+++ b/runtime/print.c
@@ -46,8 +46,11 @@ void _stp_print_flush (void)
return;
ret =_stp_transport_write(buf, len + 1);
- if (unlikely(ret < 0))
+ if (unlikely(ret < 0)) {
+ if (!atomic_read(&_stp_transport_failures))
+ _stp_warn("Transport failure - try using a larger buffer size\n");
atomic_inc (&_stp_transport_failures);
+ }
_stp_pbuf_len[cpu] = 0;
*buf = 0;
@@ -86,8 +89,11 @@ void _stp_print_flush (void)
scnprintf (buf, TIMESTAMP_SIZE, "%10d", seq);
buf[TIMESTAMP_SIZE - 1] = ' ';
ret = _stp_transport_write(buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1);
- if (unlikely(ret < 0))
+ if (unlikely(ret < 0)) {
+ if (!atomic_read(&_stp_transport_failures))
+ _stp_warn("Transport failure - try using a larger buffer size\n");
atomic_inc (&_stp_transport_failures);
+ }
_stp_pbuf_len[cpu] = 0;
*ptr = 0;