This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [Bug runtime/2497] STP_STRING_SIZE set by stap is too small
- From: Martin Hunt <hunt at redhat dot com>
- To: sourceware-bugzilla at sourceware dot org
- Cc: systemtap at sources dot redhat dot com
- Date: Tue, 04 Apr 2006 12:31:15 -0700
- Subject: Re: [Bug runtime/2497] STP_STRING_SIZE set by stap is too small
- Organization: Red Hat Inc.
- References: <20060330093952.2497.guanglei@cn.ibm.com> <20060404020819.15824.qmail@sourceware.org>
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