From 8e30940ddf220fed95e73012c3cd307031db35ac Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 9 Jul 2014 12:01:36 -0400 Subject: [PATCH] module probes: allow full path to in-tree modules 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 37f772b94..005205447 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -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); -- 2.43.5