From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30075 invoked by alias); 1 Jun 2006 23:22:44 -0000 Received: (qmail 30057 invoked by uid 22791); 1 Jun 2006 23:22:43 -0000 X-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 Jun 2006 23:22:38 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k51NMXS6019725; Thu, 1 Jun 2006 19:22:33 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k51NMXcf021679; Thu, 1 Jun 2006 19:22:33 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k51NMX7L007331; Thu, 1 Jun 2006 19:22:33 -0400 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id C814F80004C; Thu, 1 Jun 2006 19:22:32 -0400 (EDT) Received: from ton.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by ton.toronto.redhat.com (8.13.1/8.13.1) with ESMTP id k51NMWf7005628; Thu, 1 Jun 2006 19:22:32 -0400 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id k51NMWgn005625; Thu, 1 Jun 2006 19:22:32 -0400 X-Authentication-Warning: ton.toronto.redhat.com: fche set sender to fche@redhat.com using -f To: Li Guanglei Cc: systemtap@sourceware.org Subject: Re: Customization of LKET References: <447C590D.10004@cn.ibm.com> From: fche@redhat.com (Frank Ch. Eigler) Date: Thu, 01 Jun 2006 23:22:00 -0000 In-Reply-To: <447C590D.10004@cn.ibm.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00541.txt.bz2 Li Guanglei writes: > I had a talk with Jose last week and we think it would be useful to > make the user able to append extra data on the trace at script > level. It was this kind of flexibility in mind that I proposed the "compiled" binary tracing alternative in . It was more recently been mentioned indirectly by Tom in . This would be a more general solution to flexible & incremental construction of binary trace records. > Of course the user could modify the tapsets in tapset/LKET to let > _lket_trace() log more data. But it's not a convenient way. It's > obvious that a function like printf() at script level is better, i.e: > [...] > lket_trace_extra("%4b", $numa_node) > [...] > #define _lket_trace_extra(fmt, args...) do {\ > _stp_printf("%1b%2n%0s"fmt, LKET_PKT_USER, fmt, args);\ > } while(0) I must say I don't much like this approach. Is the only point here to add "LKET_PKT_USER" as a constant byte into the printf? > I modified systemtap to make it able to support lket_trace_extra at > script level. [...] Modify LKET tapset sources at will, but please consider application-specific changes to the translator proper as possibly controversial, and allow more time for review. > [...] > probe addevent.pagefault > { > lket_trace_extra("%4b%0s", $numa_node, backtrace()) > } > But there is trouble that MAXSTRINGLEN is defined as 128 so backtrace > string will be truncated. Simply raising MAXSTRINGLEN will cause a lot > of waste of memory. It would be wise to test that assumption. Remember that the translator uses a statically allocated array for local values like string temporaries. Temporaries for adjacent statements are overlaid. The overall size of the context structure may be small enough even with a quadrupled MAXSTRINGLEN for it to work out fine. Test it and see. > Then the user could: > probe addevent.pagefault > { > lket_backtrace() > lket_trace_extra("%4b%0s", $numa_node, backtrace()) > } > Then he can add as more extra data by lket_trace_extra() as he like > and the post-processing app(lket-b2a) could recognize the format of > these extra data. This whole area seems pretty messy. Let's think about it for a little longer before committing to a solution. - FChE