]> sourceware.org Git - systemtap.git/commitdiff
PR6503: actually allow module init/exit probes
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 9 Sep 2011 21:29:12 +0000 (17:29 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 9 Sep 2011 21:59:08 +0000 (17:59 -0400)
* dwflpp.cxx (dwflpp::blacklisted_p): Skip blacklist_section
  processing for modules, since we can (sometimes) probe their
  .init / .exit sections now.
* runtime/staprun/staprun.c (send_relocation_modules): Hey, we
  only said "sometimes".  Preexisting modules lie in /sys/module/...
  about having their init stuff still in memory.  Skip those.

dwflpp.cxx
runtime/staprun/staprun.c

index 97c6ae38deff36f54b0d94c0ebdee184733df383..e0264b9657b2fdcd1b6f57e99e65457b239ce799 100644 (file)
@@ -2890,7 +2890,8 @@ dwflpp::blacklisted_p(const string& funcname,
 
   // check against section blacklist
   string section = get_blacklist_section(addr);
-  if (!regexec (&blacklist_section, section.c_str(), 0, NULL, 0))
+  // PR6503: modules don't need special init/exit treatment
+  if (module == TOK_KERNEL && !regexec (&blacklist_section, section.c_str(), 0, NULL, 0))
     {
       blacklisted = true;
       if (sess.verbose>1)
index 3249de1eb8edd27132d10e92eec0dd9c4d47f4e5..3de92bccee01797aec1c0766a3dbedd3ac47efbd 100644 (file)
@@ -2,7 +2,7 @@
  *
  * staprun.c - SystemTap module loader
  *
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -473,6 +473,12 @@ void send_relocation_modules ()
              is open so we won't need the full name again. */
           *module_name_end = '\0';
 
+          /* PR6503.  /sys/module/.../sections/...init.... sometimes contain
+             non-0 addresses, even though the respective module-initialization
+             sections were already unloaded.  We override the addresses here. */
+          if (strstr (section_name, "init.") != NULL) /* .init.text, .devinit.rodata, ... */
+             section_address = 0;
+
           send_a_relocation (module_name, section_name, section_address);
         }
 
This page took 0.03757 seconds and 5 git commands to generate.