From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26145 invoked by alias); 4 Apr 2006 00:38:12 -0000 Received: (qmail 26137 invoked by uid 22791); 4 Apr 2006 00:38:12 -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 00:38:11 +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 k340c9QT027155; Mon, 3 Apr 2006 20:38:09 -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 k340c9on030933; Mon, 3 Apr 2006 20:38:09 -0400 Received: from vpn83-180.boston.redhat.com (vpn83-180.boston.redhat.com [172.16.83.180]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k340c8FA031989; Mon, 3 Apr 2006 20:38:09 -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: <20060403034347.11857.qmail@sourceware.org> References: <20060330093952.2497.guanglei@cn.ibm.com> <20060403034347.11857.qmail@sourceware.org> Content-Type: text/plain Organization: Red Hat Inc. Date: Tue, 04 Apr 2006 00:38:00 -0000 Message-Id: <1144111087.4747.5.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/msg00024.txt.bz2 On Mon, 2006-04-03 at 03:43 +0000, guanglei at cn dot ibm dot com wrote: > I can call print_backtrace() to print the backtrace, but in fact I > want to > combine the string of backtrace with other information to generate the > output of > a specific event, like the following: > > String str = _stp_string_init (0); > _stp_stack_sprint (str, CONTEXT->regs, 0); > _lket_trace(THIS->var_id, "%1b%4b%1b%ld%4b%4b%s", > cmd->device->sdev_state, > scsi_info, > cmd->sc_data_direction, cmd->request_buffer, > cmd->request_bufflen, > cmd->device->host->cmd_pid, _stp_string_ptr(str)); > > So what I want is a larger String obtained by _stp_string_init, while > keep all other strings used by stap the same as before. But aren't there just two possibilities? 1. You print the backtrace. 2. You get the backtrace in a string and save it in an array. For #1, you use print_backtrace. For #2, you need to have all strings be larger, as it is done now. In your example above, you would just write something like this in script: bin_write("%1b%4b%1b%ld%4b%4b", cmd->device->sdev_state, [...]) print_backtrace() Martin