summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-08-18 12:26:26 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-08-18 12:26:26 -0400
commit18e5ffd4405633ea2cef102d01890dfbb159b363 (patch)
tree105ac469c6f02a8fdb23a982fd4b1850793bbaf2 /translate.cxx
parent412e1bf7de63114d4432382a08eb21f1301a241c (diff)
downloadsystemtap-steved-18e5ffd4405633ea2cef102d01890dfbb159b363.tar.gz
systemtap-steved-18e5ffd4405633ea2cef102d01890dfbb159b363.tar.xz
systemtap-steved-18e5ffd4405633ea2cef102d01890dfbb159b363.zip
PR10516: reduce context size
* translate.cxx (emit_common_header): Emit probe locals into a separate union, not into the locals[] array. (emit_probe): Adapt.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/translate.cxx b/translate.cxx
index 8d20e8f6..2e2716e2 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -897,6 +897,9 @@ c_unparser::emit_common_header ()
o->newline() << "cycles_t cycles_base;";
o->newline() << "cycles_t cycles_sum;";
o->newline() << "#endif";
+
+
+ // PR10516: probe locals
o->newline() << "union {";
o->indent(1);
@@ -927,8 +930,6 @@ c_unparser::emit_common_header ()
{
tmp_probe_contents[oss.str()] = dp->name; // save it
- // XXX: probe locals need not be recursion-nested, only function locals
-
o->newline() << "struct " << dp->name << "_locals {";
o->indent(1);
for (unsigned j=0; j<dp->locals.size(); j++)
@@ -954,6 +955,11 @@ c_unparser::emit_common_header ()
o->newline(-1) << "} " << dp->name << ";";
}
}
+ o->newline(-1) << "} probe_locals;";
+
+ // PR10516: function locals
+ o->newline() << "union {";
+ o->indent(1);
for (map<string,functiondecl*>::iterator it = session->functions.begin(); it != session->functions.end(); it++)
{
@@ -1603,7 +1609,7 @@ c_unparser::emit_probe (derived_probe* v)
// initialize frame pointer
o->newline() << "struct " << v->name << "_locals * __restrict__ l =";
- o->newline(1) << "& c->locals[0]." << v->name << ";";
+ o->newline(1) << "& c->probe_locals." << v->name << ";";
o->newline(-1) << "(void) l;"; // make sure "l" is marked used
o->newline() << "#ifdef STP_TIMING";