This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/2497] STP_STRING_SIZE set by stap is too small
- From: "guanglei at cn dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 31 Mar 2006 13:35:25 -0000
- Subject: [Bug runtime/2497] STP_STRING_SIZE set by stap is too small
- References: <20060330093952.2497.guanglei@cn.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From guanglei at cn dot ibm dot com 2006-03-31 13:35 -------
(In reply to comment #2)
> When I use backtrace(), I usually run stap with -DMAXSTRINGLEN=256. This seems
> to cover back traces on PPC64 very well. As for changing the default, why would
> the default of MAXSTRINGLEN=128 need to change if can be tune this way?
It seems not a good idea to simplily increase MAXSTRINGLEN, which will cause a
lot of unecessary additional memory consumption.
MAXSTRINGLEN =128 is ok. But I think we should slightly change the translator:
-bash-3.00# diff -uprN translate.cxx.ori translate.cxx
--- translate.cxx.ori 2006-03-31 13:26:20.000000000 -0500
+++ translate.cxx 2006-03-31 13:21:29.000000000 -0500
@@ -3774,7 +3774,9 @@ translate_pass (systemtap_session& s)
s.op->newline() << "#endif";
// impedance mismatch
+ s.op->newline() << "#ifndef STP_STRING_SIZE";
s.op->newline() << "#define STP_STRING_SIZE MAXSTRINGLEN";
+ s.op->newline() << "#endif";
s.op->newline() << "#define STP_NUM_STRINGS 1";
if (s.bulk_mode)
Increasing STP_STRING_SIZE by -D will cause the size of "struct string" defined
in runtime/string.h to increase, while keep the size of other types of strings
unchanged.
So now if I want to print backtrace or want some large _stp_string inside my
codes, I can:
stap -D STP_STRING_SIZE=2048 ...
I tested it and it worked well for me.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=2497
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.