]> sourceware.org Git - systemtap.git/commitdiff
module probes: allow full path to in-tree modules
authorJonathan Lebon <jlebon@redhat.com>
Wed, 9 Jul 2014 16:01:36 +0000 (12:01 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Thu, 10 Jul 2014 19:33:47 +0000 (15:33 -0400)
If the user provided a full path to an in-tree module, then we don't
want to modify the path in any way. The '-' to '_' will be done later on
as needed.

tapsets.cxx

index 37f772b94b87b85ff854951a8ca9b42efe3dd9c9..0052054478d2d706f54847b427c2fe98b0e1c64c 100644 (file)
@@ -7543,10 +7543,16 @@ dwarf_builder::build(systemtap_session & sess,
     }
   else if (get_param (parameters, TOK_MODULE, module_name))
     {
-      size_t dash_pos = 0;
-      while((dash_pos=module_name.find('-'))!=string::npos)
-        module_name.replace(int(dash_pos),1,"_");
-      filled_parameters[TOK_MODULE] = new literal_string(module_name);
+      // If not a full path was given, then it's an in-tree module. Replace any
+      // dashes with underscores.
+      if (!is_fully_resolved(module_name, sess.sysroot, sess.sysenv))
+        {
+          size_t dash_pos = 0;
+          while((dash_pos=module_name.find('-'))!=string::npos)
+            module_name.replace(int(dash_pos),1,"_");
+          filled_parameters[TOK_MODULE] = new literal_string(module_name);
+        }
+
       // NB: glob patterns get expanded later, during the offline
       // elfutils module listing.
       dw = get_kern_dw(sess, module_name);
This page took 0.045081 seconds and 5 git commands to generate.