From a76c46d5d96b24f2d2b9f1c0f960af8d1f9c6e1f Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 19 Jul 2005 18:24:16 +0000 Subject: 2005-07-19 Frank Ch. Eigler * translate.cxx (emit_module_init/exit, translate_pass): Conform to newer runtime startup/shutdown hooks. --- ChangeLog | 5 +++++ translate.cxx | 32 +++++++------------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 961e903b..ee637899 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-19 Frank Ch. Eigler + + * translate.cxx (emit_module_init/exit, translate_pass): Conform + to newer runtime startup/shutdown hooks. + 2005-07-15 Frank Ch. Eigler * Makefile.am (install-data-local): Correct typo. diff --git a/translate.cxx b/translate.cxx index 30bff04b..f55b677e 100644 --- a/translate.cxx +++ b/translate.cxx @@ -327,11 +327,6 @@ c_unparser::emit_module_init () o->newline(1) << "int anyrc = 0;"; o->newline() << "int rc;"; - // XXX: yuck runtime - o->newline() << "#if !TEST_MODE"; - o->newline() << "TRANSPORT_OPEN;"; - o->newline() << "#endif"; - for (unsigned i=0; iglobals.size(); i++) { vardecl* v = session->globals[i]; @@ -370,13 +365,6 @@ c_unparser::emit_module_init () void c_unparser::emit_module_exit () { - // XXX: double-yuck runtime - o->newline() << "void probe_exit () {"; - // need to reference these static functions for -Werror avoidance - o->newline(1) << "if (0) next_fmt ((void *) 0, (void *) 0);"; - o->newline() << "if (0) _stp_dbug(\"\", 0, \"\");"; - o->newline(-1) << "}"; - // o->newline() << "static void systemtap_module_exit (void);"; o->newline() << "void systemtap_module_exit () {"; o->newline(1) << "int anyrc = 0;"; @@ -388,12 +376,6 @@ c_unparser::emit_module_exit () } // XXX: uninitialize globals - - // XXX: yuck runtime - o->newline() << "#if !TEST_MODE"; - o->newline() << "_stp_transport_close ();"; - o->newline() << "#endif"; - // XXX: if anyrc, log badness o->newline(-1) << "}" << endl; } @@ -1541,20 +1523,20 @@ translate_pass (systemtap_session& s) s.op->newline() << "#else"; s.op->newline(); - s.op->newline() << "static int __init _systemtap_module_init (void);"; - s.op->newline() << "int _systemtap_module_init () {"; + // XXX + s.op->newline() << "int probe_start () {"; s.op->newline(1) << "return systemtap_module_init ();"; s.op->newline(-1) << "}"; s.op->newline(); - s.op->newline() << "static void __exit _systemtap_module_exit (void);"; - s.op->newline() << "void _systemtap_module_exit () {"; - s.op->newline(1) << "systemtap_module_exit ();"; + s.op->newline() << "void probe_exit () {"; + // XXX: need to reference these static functions for -Werror avoidance + s.op->newline(1) << "if (0) next_fmt ((void *) 0, (void *) 0);"; + s.op->newline() << "if (0) _stp_dbug(\"\", 0, \"\");"; + s.op->newline() << "systemtap_module_exit ();"; s.op->newline(-1) << "}"; s.op->newline(); - s.op->newline() << "module_init (_systemtap_module_init);"; - s.op->newline() << "module_exit (_systemtap_module_exit);"; s.op->newline() << "MODULE_DESCRIPTION(\"systemtap probe\");"; s.op->newline() << "MODULE_LICENSE(\"GPL\");"; // XXX -- cgit