From 9c6b0ab8562140ffda6d9b5aba1dafcf73fc9774 Mon Sep 17 00:00:00 2001 From: guanglei Date: Thu, 29 Jun 2006 08:24:19 +0000 Subject: _lket_trace() won't log ppid and tgid any more. I use some bit-OPs to make _lket_trace's format string shorter for better performance. I also modified lket-b2a to be sync with _lket_trace() --- tapset/LKET/Changelog | 7 +++++++ tapset/LKET/lket_trace.stp | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'tapset') diff --git a/tapset/LKET/Changelog b/tapset/LKET/Changelog index 965cbf36..c31e072f 100644 --- a/tapset/LKET/Changelog +++ b/tapset/LKET/Changelog @@ -1,3 +1,10 @@ +2006-06-29 Li Guanglei + + * lket_trace.stp: + _lket_trace() won't log ppid and tgid any more. + Using bit-OP to make _lket_trace's format string shorter + for better performance. + 2006-06-26 Li Guanglei * aio.stp: new event hooks for AIO diff --git a/tapset/LKET/lket_trace.stp b/tapset/LKET/lket_trace.stp index 442976a5..4336377c 100755 --- a/tapset/LKET/lket_trace.stp +++ b/tapset/LKET/lket_trace.stp @@ -126,11 +126,10 @@ static inline int this_event_len(void) #define _lket_trace(GroupID, hookID, fmt, args...) do { \ struct timeval tv; \ do_gettimeofday (&tv); \ - _stp_printf("%2b%2n%1b%1b%4b%4b%4b%4b%4b%1b"fmt, \ - (_FMT_)0, (_FMT_)GroupID, (_FMT_)hookID, \ - (_FMT_)tv.tv_sec, (_FMT_)tv.tv_usec, (_FMT_)current->tgid, \ - (_FMT_)current->parent->pid, (_FMT_)current->pid, \ - (_FMT_)current->thread_info->cpu, args);\ + _stp_printf("%2b%2n%8b%8b"fmt, (_FMT_)0, \ + (_FMT_)(tv.tv_sec*1000000LL + tv.tv_usec),\ + (_FMT_)((int64_t)current->pid << 32 | (int32_t)GroupID << 24 |\ + (int32_t)hookID << 16 | (int16_t)current->thread_info->cpu << 8), args);\ } while(0) #endif -- cgit