diff options
author | trz <trz> | 2005-06-21 14:13:01 +0000 |
---|---|---|
committer | trz <trz> | 2005-06-21 14:13:01 +0000 |
commit | aac3ed25e8dc7355b5f28fae2878f644df14ef7d (patch) | |
tree | c2d284ccffb7dd9a82b000bd9c7152e5abbf160f /runtime/print.c | |
parent | bd2b1e6816b486d5c85a4693f0b3579df4376ed5 (diff) | |
download | systemtap-steved-aac3ed25e8dc7355b5f28fae2878f644df14ef7d.tar.gz systemtap-steved-aac3ed25e8dc7355b5f28fae2878f644df14ef7d.tar.xz systemtap-steved-aac3ed25e8dc7355b5f28fae2878f644df14ef7d.zip |
Added merging/sorting of per-cpu data, transport config/selection by probe, etc
Diffstat (limited to 'runtime/print.c')
-rw-r--r-- | runtime/print.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/print.c b/runtime/print.c index 3c09e105..72846a24 100644 --- a/runtime/print.c +++ b/runtime/print.c @@ -56,8 +56,8 @@ void _stp_print_flush (void) #else /* ! STP_NETLINK_ONLY */ /* size of timestamp, in bytes, including space */ -#define TIMESTAMP_SIZE 19 -#define STP_PRINT_BUF_START (TIMESTAMP_SIZE + 1) +#define TIMESTAMP_SIZE 11 +#define STP_PRINT_BUF_START (TIMESTAMP_SIZE) /** Size of buffer, not including terminating NULL */ #ifndef STP_PRINT_BUF_LEN @@ -77,15 +77,15 @@ void _stp_print_flush (void) int cpu = smp_processor_id(); char *buf = &_stp_pbuf[cpu][0]; char *ptr = buf + STP_PRINT_BUF_START; - struct timeval tv; + int seq; if (_stp_pbuf_len[cpu] == 0) return; - - do_gettimeofday(&tv); - scnprintf (buf, TIMESTAMP_SIZE+1, "[%li.%06li] ", tv.tv_sec, tv.tv_usec); - buf[TIMESTAMP_SIZE] = ' '; - _stp_transport_write(t, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 2); + + seq = _stp_seq_inc(); + scnprintf (buf, TIMESTAMP_SIZE, "%10d", seq); + buf[TIMESTAMP_SIZE - 1] = ' '; + _stp_transport_write(t, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1); _stp_pbuf_len[cpu] = 0; *ptr = 0; } |