From aac3ed25e8dc7355b5f28fae2878f644df14ef7d Mon Sep 17 00:00:00 2001 From: trz Date: Tue, 21 Jun 2005 14:13:01 +0000 Subject: Added merging/sorting of per-cpu data, transport config/selection by probe, etc --- runtime/print.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'runtime/print.c') 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; } -- cgit