From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1462 invoked by alias); 7 Jun 2006 02:00:45 -0000 Received: (qmail 1454 invoked by uid 22791); 7 Jun 2006 02:00:44 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ausmtp06.au.ibm.com (HELO ausmtp06.au.ibm.com) (202.81.18.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Jun 2006 02:00:39 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp06.au.ibm.com (8.13.6/8.13.6) with ESMTP id k5722ami7119024 for ; Wed, 7 Jun 2006 12:02:36 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k5723oim135176 for ; Wed, 7 Jun 2006 12:03:50 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k5720TJD015980 for ; Wed, 7 Jun 2006 12:00:29 +1000 Received: from [127.0.0.1] ([9.181.133.250]) by d23av03.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5720PaR015712; Wed, 7 Jun 2006 12:00:27 +1000 Message-ID: <44863368.9060805@cn.ibm.com> Date: Wed, 07 Jun 2006 02:00:00 -0000 From: Li Guanglei Organization: IBM CSTL User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: "systemtap@sourceware.org" CC: "Frank Ch. Eigler" Subject: Re: Customization of LKET References: <447C590D.10004@cn.ibm.com> <447FAE49.6090900@cn.ibm.com> In-Reply-To: <447FAE49.6090900@cn.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00575.txt.bz2 Li Guanglei ??: > Frank Ch. Eigler ??: > > lket_trace_extra is actually a wrapper around printf > [...] > I am thinking of revert my changes of lket_trace_extra() to > translator. I though of another way of allowing the user add arbitrary extra trace data using just printf. It has the same convenience as deprecated lket_trace_extra(), no flag/%2n is needed, no changes to translator is needed, and user can call printf() multiple times. I implemented it and tested it for a while, and it worked fine for me. And I think we can also add a function register_user_event() whose signature is: function register_user_event(grpid:long, hookid:long, fmt:string, name:string) Then event register provides a way to tell the post-processing app the data/name of the extra trace data The following shows an example of the above: probe addevent.regevt { register_user_event(GROUP_NETDEV, HOOKID_NETDEV_RECEIVE, "STRING:INT8:INT16", "sample string:sample id1:sample id2") } probe addevent.netdev.receive { printf("%0s%1b%2b", "sample str", 11, 112) } Basically, this new way of user customizable tracing is done by a function named update_record() which will is called in a epilogue mode alias so it will be the last one to be called and it will update the total length of the trace data according to _stp_pbuf_len[cpu], including those logged by _lket_trace() and printf(). Every trace record has the format of: total_len, sys_len(without user trace data), groupid, hookid, ... > it shows that the size of context will increase from 6608 to 51408 if > MAXSTRINGLEN is defined as 1024. Seems acceptable, right? > I want also delete backtrace() function now. If a user want to print backtrace, he can just use printf and backtrace() function, e.g: printf("%1b%0s", 11, backtrace()) Any comments? - Guanglei