From b96baad9f8f5bf04c3d136ed16fe59270ae947e9 Mon Sep 17 00:00:00 2001 From: guanglei Date: Tue, 19 Sep 2006 08:01:26 +0000 Subject: lket_trace.stp,process.stp,register_event.stp: Be sync with the runtime printing changes made by Martin lket/b2a/lket_b2a.c, lket/b2a/lket_b2a.h: Be sync with the recent runtime printing changes made by Martin. Some clean up work before adding the support of dumping data into MySQL Bug fix of segment fault when an event is not registered. --- tapset/LKET/Changelog | 8 ++++++++ tapset/LKET/lket_trace.stp | 6 +++--- tapset/LKET/process.stp | 6 ++++-- tapset/LKET/register_event.stp | 6 ++++-- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'tapset') diff --git a/tapset/LKET/Changelog b/tapset/LKET/Changelog index 99e8d3ab..7bdae3fa 100644 --- a/tapset/LKET/Changelog +++ b/tapset/LKET/Changelog @@ -1,3 +1,11 @@ +2006-09-19 Li Guanglei + + From Gui Jian + + * lket_trace.stp,process.stp,register_event.stp: Be + sync with the runtime printing changes made by Martin + + 2006-09-19 Li Guanglei From Gui Jian diff --git a/tapset/LKET/lket_trace.stp b/tapset/LKET/lket_trace.stp index 5764892a..57c4c96d 100755 --- a/tapset/LKET/lket_trace.stp +++ b/tapset/LKET/lket_trace.stp @@ -183,9 +183,9 @@ static inline int this_event_len(void) function update_record() %{ #if !defined(ASCII_TRACE) - int cpu = smp_processor_id(); - char *total_length = &_stp_pbuf[cpu][STP_PRINT_BUF_START]; - *(int16_t *)total_length = _stp_pbuf_len[cpu] - 4; + _stp_pbuf *pb = &__get_cpu_var(Stp_pbuf); + char *total_length = &pb->buf[0]; + *(int16_t *)total_length = pb->len - 4; #endif %} diff --git a/tapset/LKET/process.stp b/tapset/LKET/process.stp index 238f1b20..84a2bd80 100755 --- a/tapset/LKET/process.stp +++ b/tapset/LKET/process.stp @@ -36,6 +36,7 @@ function process_snapshot() %{ struct task_struct *tsk; struct list_head *cur, *head; + _stp_pbuf *pb; int cpu = smp_processor_id(); char *total_length; head = &(current->tasks); @@ -47,8 +48,9 @@ function process_snapshot() _lket_trace(_GROUP_PROCESS, _HOOKID_PROCESS_SNAPSHOT, "%4b%4b%4b%0s", (_FMT_)tsk->pid, (_FMT_)tsk->tgid, (_FMT_)tsk->parent->tgid, tsk->comm); #if !defined(ASCII_TRACE) - total_length = &_stp_pbuf[cpu][STP_PRINT_BUF_START]; - *(int16_t *)total_length = _stp_pbuf_len[cpu] - 4; + pb = &__get_cpu_var(Stp_pbuf); + total_length = &pb->buf[0]; + *(int16_t *)total_length = pb->len - 4; #endif _stp_print_flush(); } diff --git a/tapset/LKET/register_event.stp b/tapset/LKET/register_event.stp index 8579e9c3..ac05b71a 100755 --- a/tapset/LKET/register_event.stp +++ b/tapset/LKET/register_event.stp @@ -70,6 +70,7 @@ function register_event(grpid:long, hookid:long, evt_type:long, fmt:string, name char in_fmt[512], in_name[512]; char *p_in_fmt, *p_in_name; char *fmt, *name; + _stp_pbuf * pb; int cpu = smp_processor_id(); char *total_length; p_in_fmt = in_fmt; @@ -112,8 +113,9 @@ function register_event(grpid:long, hookid:long, evt_type:long, fmt:string, name THIS->hookid, THIS->fmt, THIS->names); #if !defined(ASCII_TRACE) - total_length = &_stp_pbuf[cpu][STP_PRINT_BUF_START]; - *(int16_t *)total_length = _stp_pbuf_len[cpu] - 4; + pb = &__get_cpu_var(Stp_pbuf); + total_length = &pb->buf[0]; + *(int16_t *)total_length = pb->len - 4; #endif _stp_print_flush(); -- cgit