summaryrefslogtreecommitdiffstats
path: root/runtime/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/print.c')
-rw-r--r--runtime/print.c10
1 files changed, 8 insertions, 2 deletions
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;