diff options
author | hunt <hunt> | 2005-07-20 05:27:45 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-07-20 05:27:45 +0000 |
commit | 6d46e8cc91ae180342b80dae58d9f27fcc7790f6 (patch) | |
tree | acaa1b5510e22f7ba04b675c6dc6fcab6b634b83 /runtime/print.c | |
parent | a544b4aed2ed1a47c4e83ec9b2d0499a277616a0 (diff) | |
download | systemtap-steved-6d46e8cc91ae180342b80dae58d9f27fcc7790f6.tar.gz systemtap-steved-6d46e8cc91ae180342b80dae58d9f27fcc7790f6.tar.xz systemtap-steved-6d46e8cc91ae180342b80dae58d9f27fcc7790f6.zip |
2005-07-19 Martin Hunt <hunt@redhat.com>
* print.c (_stp_print_flush): Check return value and increment
transport failures.
Diffstat (limited to 'runtime/print.c')
-rw-r--r-- | runtime/print.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/print.c b/runtime/print.c index 1eb9934f..aa8a520d 100644 --- a/runtime/print.c +++ b/runtime/print.c @@ -77,7 +77,7 @@ void _stp_print_flush (void) int cpu = smp_processor_id(); char *buf = &_stp_pbuf[cpu][0]; char *ptr = buf + STP_PRINT_BUF_START; - int seq; + int ret, seq; if (_stp_pbuf_len[cpu] == 0) return; @@ -85,7 +85,10 @@ void _stp_print_flush (void) seq = _stp_seq_inc(); scnprintf (buf, TIMESTAMP_SIZE, "%10d", seq); buf[TIMESTAMP_SIZE - 1] = ' '; - _stp_transport_write(_stp_tport, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1); + ret = _stp_transport_write(_stp_tport, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1); + if (unlikely(ret < 0)) + atomic_inc (&_stp_transport_failures); + _stp_pbuf_len[cpu] = 0; *ptr = 0; } |