public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/19265] New: finding out-of-tree kernel modules only works with full paths, not relative paths
@ 2015-11-18 19:36 dsmith at redhat dot com
  2015-11-19 14:57 ` [Bug translator/19265] " dsmith at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dsmith at redhat dot com @ 2015-11-18 19:36 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=19265

            Bug ID: 19265
           Summary: finding out-of-tree kernel modules only works with
                    full paths, not relative paths
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
  Target Milestone: ---

Let's say you have an out-of-tree kernel module, like the one from the
modules_out_of_tree.exp testcase.

If you refer to the full pathname of the module, things work correctly:

# stap -l
'module("/root/module/stap_modules_out_of_tree.ko").function("*_init")'
module("/root/module/stap_modules_out_of_tree.ko").function("stap_modules_out_of_tree_init@/root/module/stap_modules_out_of_tree.c:8")

However, a relative path doesn't work:

# pwd
/root/module
# stap -l 'module("./stap_modules_out_of_tree.ko").function("*_init")'

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/19265] finding out-of-tree kernel modules only works with full paths, not relative paths
  2015-11-18 19:36 [Bug translator/19265] New: finding out-of-tree kernel modules only works with full paths, not relative paths dsmith at redhat dot com
@ 2015-11-19 14:57 ` dsmith at redhat dot com
  2015-11-23 16:54 ` dsmith at redhat dot com
  2016-01-11 21:27 ` dsmith at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dsmith at redhat dot com @ 2015-11-19 14:57 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=19265

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
Here's another oddity reported by Nan Xiao in

<https://sourceware.org/ml/systemtap/2015-q4/msg00152.html>:

====
Another interesting thing: if there is a "-" in path, the SystemTap
also fail to parse:

# stap -v -l
'module("/root/Downloads/kernel-master/105.ops/kex.ko").function("*")'
Pass 1: parsed user script and 102 library script(s) using
78528virt/28740res/2700shr/26724data kb, in 170usr/20sys/183real ms.
Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0
global(s) using 79536virt/30480res/3164shr/27732data kb, in
0usr/50sys/53real ms.

Change kernel-master to kernel:

 # stap -v -l 'module("/root/Downloads/kernel/105.ops/kex.ko").function("*")'
Pass 1: parsed user script and 102 library script(s) using
78528virt/28732res/2700shr/26724data kb, in 180usr/10sys/189real ms.
module("/root/Downloads/kernel/105.ops/kex.ko").function("_open@/root/Downloads/kernel-master/105.ops/kex.c:21")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_read@/root/Downloads/kernel-master/105.ops/kex.c:45")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_release@/root/Downloads/kernel-master/105.ops/kex.c:33")
module("/root/Downloads/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/linux-3.12.49-6/arch/x86/include/asm/uaccess_64.h:72")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_cleanup@/root/Downloads/kernel-master/105.ops/kex.c:90")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_init@/root/Downloads/kernel-master/105.ops/kex.c:61")
Pass 2: analyzed script: 6 probe(s), 0 function(s), 0 embed(s), 0
global(s) using 79548virt/30624res/3304shr/27744data kb, in
20usr/30sys/56real ms.
====

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/19265] finding out-of-tree kernel modules only works with full paths, not relative paths
  2015-11-18 19:36 [Bug translator/19265] New: finding out-of-tree kernel modules only works with full paths, not relative paths dsmith at redhat dot com
  2015-11-19 14:57 ` [Bug translator/19265] " dsmith at redhat dot com
@ 2015-11-23 16:54 ` dsmith at redhat dot com
  2016-01-11 21:27 ` dsmith at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dsmith at redhat dot com @ 2015-11-23 16:54 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=19265

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
Looks like the "dash" problem mentioned in comment #1 comes from the following
code from dwarf_builder::build() in tapsets.cxx:

===============
  else if (get_param (parameters, TOK_MODULE, 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;                                                  
          string module_name2 = module_name; // copy out for replace operations 
          while((dash_pos=module_name2.find('-'))!=string::npos)                
            module_name2.replace(int(dash_pos),1,"_");                          
          module_name = module_name2;                                           
          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);                                      
    }                                                                           
===============

The code is replacing *all* the dashes with underscores, not just the ones in
the module file name itself.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/19265] finding out-of-tree kernel modules only works with full paths, not relative paths
  2015-11-18 19:36 [Bug translator/19265] New: finding out-of-tree kernel modules only works with full paths, not relative paths dsmith at redhat dot com
  2015-11-19 14:57 ` [Bug translator/19265] " dsmith at redhat dot com
  2015-11-23 16:54 ` dsmith at redhat dot com
@ 2016-01-11 21:27 ` dsmith at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dsmith at redhat dot com @ 2016-01-11 21:27 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=19265

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from David Smith <dsmith at redhat dot com> ---
Fixed in commit 51f0b23.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-11 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 19:36 [Bug translator/19265] New: finding out-of-tree kernel modules only works with full paths, not relative paths dsmith at redhat dot com
2015-11-19 14:57 ` [Bug translator/19265] " dsmith at redhat dot com
2015-11-23 16:54 ` dsmith at redhat dot com
2016-01-11 21:27 ` dsmith at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).