From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22760 invoked by alias); 4 Apr 2006 19:31:22 -0000 Received: (qmail 22750 invoked by uid 22791); 4 Apr 2006 19:31:21 -0000 X-Spam-Status: No, hits=-2.5 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; Tue, 04 Apr 2006 19:31:20 +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 k34JVIBU013107; Tue, 4 Apr 2006 15:31:18 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id k34JVIUn003001; Tue, 4 Apr 2006 15:31:18 -0400 Received: from vpn83-167.boston.redhat.com (vpn83-167.boston.redhat.com [172.16.83.167]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k34JVGfk024291; Tue, 4 Apr 2006 15:31:17 -0400 Subject: Re: [Bug runtime/2497] STP_STRING_SIZE set by stap is too small From: Martin Hunt To: sourceware-bugzilla@sourceware.org Cc: systemtap@sources.redhat.com In-Reply-To: <20060404020819.15824.qmail@sourceware.org> References: <20060330093952.2497.guanglei@cn.ibm.com> <20060404020819.15824.qmail@sourceware.org> Content-Type: text/plain Organization: Red Hat Inc. Date: Tue, 04 Apr 2006 19:31:00 -0000 Message-Id: <1144179075.5417.9.camel@dragon> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 (2.6.0-1) Content-Transfer-Encoding: 7bit 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/msg00031.txt.bz2 On Tue, 2006-04-04 at 02:08 +0000, guij at cn dot ibm dot com wrote: > I think _lket_trace() is more like: > bin_write("%n%1b%4b%1b%ld%4b%4b%s",this_event_len(), cmd->device->sdev_state, > [...], _stp_string_ptr(str)) > The total length of the trace record (including backtrace string) is to be > calculated and filled by bin_write(), thus only #2 can work. OK, I see the problem. It seems the simplest thing is to just do what you proposed and either increase STP_STRING_SIZE or make it definable on the command line, or both The only remaining use of STP_STRING_SIZE is for strings used while doing stack traces, so it seems like a good idea to set it higher by default, because the current default is not useful. Maybe 512 or 1024? You can check in the change, or I will if you prefer. By the way, in the above example, what is the purpose of this_event_len()? It seems that you have defined "%n" to write the length of the finished string to that location, but why does that need an argument? Martin