]> sourceware.org Git - systemtap.git/commitdiff
PR10486 Raise default MAXSTRINGLEN.
authorMark Wielaard <mjw@redhat.com>
Thu, 6 Aug 2009 22:01:04 +0000 (00:01 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 6 Aug 2009 22:04:09 +0000 (00:04 +0200)
* translate.cxx (translate_pass): Raise MAXSTRINGLEN to 256 for 32bit arches
  and to 512 for 64bit arches.
* testsuite/systemtap.context/backtrace.tcl: Don't set MAXSTRINGLEN.
* testsuite/systemtap.exelib/ustack.tcl: Likewise.
* testsuite/systemtap.string/str_replace.exp: Explicitly set MAXSTRINGLEN.

testsuite/systemtap.context/backtrace.tcl
testsuite/systemtap.exelib/ustack.tcl
testsuite/systemtap.string/str_replace.exp
translate.cxx

index 975e6c4d2e780bdbdf2138a246c895fd8cf9a1b4..d401d89fdf386e1dee1acc179c7b583b5ed1b065 100644 (file)
@@ -5,8 +5,8 @@ set m4 0
 set m5 0
 set m6 0
 
-#spawn stap -d kernel -d systemtap_test_module1 -DMAXSTRINGLEN=256 $srcdir/$subdir/backtrace.stp
-spawn stap -DMAXSTRINGLEN=256 $srcdir/$subdir/backtrace.stp
+#spawn stap -d kernel -d systemtap_test_module1 $srcdir/$subdir/backtrace.stp
+spawn stap $srcdir/$subdir/backtrace.stp
 #exp_internal 1
 expect {
     -timeout 60
index a670213ae2a7d38083c227f14527be3ca137d7c3..257d0b9f5ca5a5010e340ec030da0f0cf9f00dc6 100644 (file)
@@ -31,11 +31,8 @@ set main 0
 set main_func 0
 set lib_main 0
 set lib_func 0
-# Needs extra space since on 64bit the last ubacktrace string is
-# 7 entries * (16 hex + 2 for 0x + 1 space) = 133 chars.
-# Default MAXSTRINGLEN is 128 chars.
-send_log "Running: stap -DMAXSTRINGLEN=133 $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe\n"
-spawn stap -DMAXSTRINGLEN=133 $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe
+send_log "Running: stap $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe\n"
+spawn stap $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe
 
 wait
 expect {
index 4eedf1c620a31c7a92347ebddf4e2641e8cd5592..e6526ef9c3c1818c5259b4f3446a76c41f973677 100644 (file)
@@ -10,5 +10,7 @@ Result = hello  tap
 Result = hello system tap
 Result = 
 Result = }
-stap_run2 $srcdir/$subdir/$test.stp
+
+# Expect strings to be cut off if they are too long.
+stap_run2 $srcdir/$subdir/$test.stp -DMAXSTRINGLEN=128
 
index 4a6a10b57d0e477296190551a10fd1112acc0a72..1ddc1778bef1414c854128cbe3640d3725f8c617 100644 (file)
@@ -5106,9 +5106,18 @@ translate_pass (systemtap_session& s)
       s.op->newline() << "#ifndef MAXNESTING";
       s.op->newline() << "#define MAXNESTING 10";
       s.op->newline() << "#endif";
+
+      // Strings are used for storing backtraces, they are larger on 64bit
+      // so raise the size on 64bit architectures. PR10486
+      s.op->newline() << "#include <asm/types.h>";
       s.op->newline() << "#ifndef MAXSTRINGLEN";
-      s.op->newline() << "#define MAXSTRINGLEN 128";
+      s.op->newline() << "#if BITS_PER_LONG == 32";
+      s.op->newline() << "#define MAXSTRINGLEN 256";
+      s.op->newline() << "#else";
+      s.op->newline() << "#define MAXSTRINGLEN 512";
+      s.op->newline() << "#endif";
       s.op->newline() << "#endif";
+
       s.op->newline() << "#ifndef MAXACTION";
       s.op->newline() << "#define MAXACTION 1000";
       s.op->newline() << "#endif";
This page took 0.043399 seconds and 5 git commands to generate.