public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Martin Hunt <hunt@redhat.com>
To: sourceware-bugzilla@sourceware.org
Cc: systemtap@sources.redhat.com
Subject: Re: [Bug runtime/2497] STP_STRING_SIZE set by stap is too small
Date: Tue, 04 Apr 2006 00:38:00 -0000	[thread overview]
Message-ID: <1144111087.4747.5.camel@dragon> (raw)
In-Reply-To: <20060403034347.11857.qmail@sourceware.org>

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

  reply	other threads:[~2006-04-04  0:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30  9:39 [Bug runtime/2497] New: " guanglei at cn dot ibm dot com
2006-03-30 11:45 ` [Bug runtime/2497] " fche at redhat dot com
2006-03-30 14:29 ` jrs at us dot ibm dot com
2006-03-31  2:50 ` bibo dot mao at intel dot com
2006-03-31 13:35 ` guanglei at cn dot ibm dot com
2006-03-31 14:35 ` fche at redhat dot com
2006-03-31 14:49 ` guanglei at cn dot ibm dot com
2006-03-31 17:49 ` hunt at redhat dot com
2006-04-03  3:43 ` guanglei at cn dot ibm dot com
2006-04-04  0:38   ` Martin Hunt [this message]
2006-04-04  0:38 ` hunt at redhat dot com
2006-04-04 14:56   ` Frank Ch. Eigler
2006-04-04  2:08 ` guij at cn dot ibm dot com
2006-04-04 19:31   ` Martin Hunt
2006-04-04 19:31 ` hunt at redhat dot com
2006-04-05  0:17 ` guanglei at cn dot ibm dot com
2006-04-12 19:21 ` hunt at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1144111087.4747.5.camel@dragon \
    --to=hunt@redhat.com \
    --cc=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).