]> sourceware.org Git - systemtap.git/commitdiff
2005-12-01 Frank Ch. Eigler <fche@redhat.com>
authorfche <fche>
Thu, 1 Dec 2005 21:10:30 +0000 (21:10 +0000)
committerfche <fche>
Thu, 1 Dec 2005 21:10:30 +0000 (21:10 +0000)
PR 1944 quick hack.
* translator.cxx (translate_pass): Reduce default MAXNESTING to 10.
(emit_module_init): Add a paranoid check against oversize contexts.
* stap.1.in: Document MAXNESTING change.

2005-12-01  Frank Ch. Eigler  <fche@redhat.com>

PR 1944 quick hack.
* testsuite/systemtap.sample/control_limits.*: Adapt to new
MAXNESTING default.

ChangeLog
stap.1.in
translate.cxx

index aca98f51d208168d663e07104dc37f9deb77de9a..2fe5bebf895e3def53148b6d31670af2dafbf125 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-01  Frank Ch. Eigler  <fche@redhat.com>
+
+       PR 1944 quick hack.
+       * translator.cxx (translate_pass): Reduce default MAXNESTING to 10.
+       (emit_module_init): Add a paranoid check against oversize contexts.
+       * stap.1.in: Document MAXNESTING change.
+
 2005-11-30  Frank Ch. Eigler  <fche@redhat.com>
 
        PR 1276
index 28c20dd5ba650549139b869b3a5ff603a9476518..407f8842d2368ab64c29c05f44028b699e1f6eb9 100644 (file)
--- a/stap.1.in
+++ b/stap.1.in
@@ -408,7 +408,7 @@ function thatfn:string (arg1:long, arg2) {
 .ESAMPLE
 Functions may call others or themselves
 recursively, up to a fixed nesting limit.  This limit is defined by
-a macro in the translated C code and is in the neighbourhood of 30.
+a macro in the translated C code and is in the neighbourhood of 10.
 
 .SS EMBEDDED C
 When in guru mode, the translator accepts embedded code in the
index 67c79c4bc36320807e8586846fdcaea18097483e..a55d48a886c85bbb8eee6dc289ae7bc9769def3b 100644 (file)
@@ -888,7 +888,7 @@ c_unparser::emit_common_header ()
     }
   o->newline(-1) << "} locals [MAXNESTING];";
   o->newline(-1) << "};" << endl;
-  o->newline() << "void *contexts; /* alloc_percpu */" << endl;
+  o->newline() << "void *contexts = NULL; /* alloc_percpu */" << endl;
 
   emit_map_type_instantiations ();
 
@@ -936,8 +936,9 @@ c_unparser::emit_module_init ()
   // terminate.  These may set STAP_SESSION_ERROR!
 
   // per-cpu context
-  o->newline() << "contexts = alloc_percpu (struct context);";
-  o->newline() << "if (contexts == NULL) {";
+  o->newline() << "if (sizeof (struct context) <= 131072)";
+  o->newline(1) << "contexts = alloc_percpu (struct context);";
+  o->newline(-1) << "if (contexts == NULL) {";
   o->newline() << "_stp_error (\"percpu context (size %lu) allocation failed\", sizeof (struct context));";
   o->newline(1) << "rc = -ENOMEM;";
   o->newline() << "goto out;";
@@ -3212,7 +3213,7 @@ translate_pass (systemtap_session& s)
       s.op->line() << "#define TEST_MODE " << (s.test_mode ? 1 : 0) << endl;
 
       s.op->newline() << "#ifndef MAXNESTING";
-      s.op->newline() << "#define MAXNESTING 30";
+      s.op->newline() << "#define MAXNESTING 10";
       s.op->newline() << "#endif";
       s.op->newline() << "#ifndef MAXSTRINGLEN";
       s.op->newline() << "#define MAXSTRINGLEN 128";
This page took 0.049342 seconds and 5 git commands to generate.