summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorhunt <hunt>2007-01-29 20:45:59 +0000
committerhunt <hunt>2007-01-29 20:45:59 +0000
commitcbc32000c21cde6ee7eadcd04726c75bd3410ea3 (patch)
tree86e5360a4b4c219615e5a00b8ad1a761bf7d3850 /translate.cxx
parent45cf0d811a60287a12ce1641e569034753962ade (diff)
downloadsystemtap-steved-cbc32000c21cde6ee7eadcd04726c75bd3410ea3.tar.gz
systemtap-steved-cbc32000c21cde6ee7eadcd04726c75bd3410ea3.tar.xz
systemtap-steved-cbc32000c21cde6ee7eadcd04726c75bd3410ea3.zip
2007-01-29 Martin Hunt <hunt@redhat.com>
* translate.cxx (emit_module_init): BZ3888. Add memory usage for the runtime to the printk.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx35
1 files changed, 19 insertions, 16 deletions
diff --git a/translate.cxx b/translate.cxx
index 34591c24..2955cf62 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -995,21 +995,6 @@ c_unparser::emit_module_init ()
o->newline() << "int i=0, j=0;"; // for derived_probe_group use
o->newline() << "const char *probe_point = \"\";";
- // Print a message to the kernel log about this module. This is
- // intended to help debug problems with systemtap modules.
- o->newline() << "printk (KERN_DEBUG \"%s: "
- << "systemtap: " << VERSION
- << ", base: %p"
- << ", memory: %lu+%lu data+text" // XXX: + runtime dynamic memory
- << ", probes: " << session->probes.size()
- << "\\n\""
- // printk arguments
- << ", THIS_MODULE->name"
- << ", THIS_MODULE->module_core"
- << ", (unsigned long) THIS_MODULE->core_size"
- << ", (unsigned long) THIS_MODULE->core_text_size"
- << ");";
-
// Compare actual and targeted kernel releases/machines. Sometimes
// one may install the incorrect debuginfo or -devel RPM, and try to
// run a probe compiled for a different version. Catch this early,
@@ -1065,7 +1050,7 @@ c_unparser::emit_module_init ()
o->newline() << "rc = -ENOMEM;";
o->newline() << "goto out;";
o->newline(-1) << "}";
-
+
for (unsigned i=0; i<session->globals.size(); i++)
{
vardecl* v = session->globals[i];
@@ -1115,6 +1100,24 @@ c_unparser::emit_module_init ()
o->newline(-1) << "}";
}
+ // Print a message to the kernel log about this module. This is
+ // intended to help debug problems with systemtap modules.
+ o->newline() << "printk (KERN_DEBUG \"%s: "
+ << "systemtap: " << VERSION
+ << ", base: %p"
+ << ", memory: %lu+%lu+%u+%u+%u data+text+ctx+io+glob"
+ << ", probes: " << session->probes.size()
+ << "\\n\""
+ // printk arguments
+ << ", THIS_MODULE->name"
+ << ", THIS_MODULE->module_core"
+ << ", (unsigned long) (THIS_MODULE->core_size - THIS_MODULE->core_text_size)"
+ << ", (unsigned long) THIS_MODULE->core_text_size"
+ << ", num_online_cpus() * sizeof(struct context)"
+ << ", _stp_allocated_net_memory"
+ << ", _stp_allocated_memory"
+ << ");";
+
// All registrations were successful. Consider the system started.
o->newline() << "atomic_set (&session_state, STAP_SESSION_RUNNING);";
o->newline() << "return 0;";