From a58d79d097f6b801eb3a57cf928b515d8eccdf98 Mon Sep 17 00:00:00 2001 From: dsmith Date: Fri, 16 Mar 2007 15:29:34 +0000 Subject: 2007-03-16 David Smith PR 3545. * tapsets.cxx (common_probe_entryfn_prologue): Added 'overload_processing' parameter, which defaults to true. If overload_processing is set to false, doesn't output the STP_OVERLOAD code. (common_probe_entryfn_epilogue): Ditto. (be_derived_probe_group::emit_module_decl): Set overload_processing to false in calls to common_probe_entryfn_prologue and common_probe_entryfn_epilogue since begin/end probes shouldn't overload the system. * translate.cxx (c_unparser::emit_common_header): Emit STP_OVERLOAD global variables. (translate_pass): Emit STP_OVERLOAD defines. --- translate.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index 2d826dca..36530373 100644 --- a/translate.cxx +++ b/translate.cxx @@ -822,6 +822,10 @@ c_unparser::emit_common_header () o->newline() << "#ifdef STP_TIMING"; o->newline() << "Stat *statp;"; o->newline() << "#endif"; + o->newline() << "#ifdef STP_OVERLOAD"; + o->newline() << "cycles_t cycles_base;"; + o->newline() << "cycles_t cycles_sum;"; + o->newline() << "#endif"; o->newline() << "union {"; o->indent(1); @@ -4082,11 +4086,25 @@ translate_pass (systemtap_session& s) s.op->newline() << "#define MINSTACKSPACE 1024"; s.op->newline() << "#endif"; + // Overload processing + s.op->newline() << "#ifndef STP_OVERLOAD_INTERVAL"; + s.op->newline() << "#define STP_OVERLOAD_INTERVAL 1000000000LL"; + s.op->newline() << "#endif"; + s.op->newline() << "#ifndef STP_OVERLOAD_THRESHOLD"; + s.op->newline() << "#define STP_OVERLOAD_THRESHOLD 500000000LL"; + s.op->newline() << "#endif"; + // We allow the user to completely turn overload processing off + // (as opposed to tuning it by overriding the values above) by + // running: stap -DSTP_NO_OVERLOAD {other options} + s.op->newline() << "#ifndef STP_NO_OVERLOAD"; + s.op->newline() << "#define STP_OVERLOAD"; + s.op->newline() << "#endif"; + if (s.bulk_mode) s.op->newline() << "#define STP_BULKMODE"; if (s.timing) - s.op->newline() << "#define STP_TIMING" << " " << s.timing ; + s.op->newline() << "#define STP_TIMING"; if (s.perfmon) s.op->newline() << "#define STP_PERFMON"; -- cgit