public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* RE: patch for module function probe
@ 2006-04-03 21:47 Stone, Joshua I
  0 siblings, 0 replies; 7+ messages in thread
From: Stone, Joshua I @ 2006-04-03 21:47 UTC (permalink / raw)
  To: Roland McGrath, Frank Ch. Eigler; +Cc: systemtap

Roland McGrath wrote:
>> Yes, it might be.  It would be best if there was a way of
>> automagically supporting module("foo") for a foo that's compiled
>> into vmlinux with a CONFIG_FOO=y instead of CONFIG_FOO=m.  Does
>> kbuild leave any traces of the module ancestry in object files
>> produced this way? 
> 
> I don't think there is any way to recover that information.

Even if there were a way, this justs exacerbate the problem that started
this thread.  If CONFIG_FOO=y and someone also compiles and loads an
unrelated module foo, which would you turn to for resolving
module("foo")?


Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread
* patch for module function probe
@ 2006-04-03  8:56 Mao, Bibo
  2006-04-03  9:06 ` Li Guanglei
  0 siblings, 1 reply; 7+ messages in thread
From: Mao, Bibo @ 2006-04-03  8:56 UTC (permalink / raw)
  To: systemtap

Hi,
	Currently systemtap has some problem when searching module
function, which is reported in
http://sourceware.org/ml/systemtap/2006-q1/msg00674.html. Kernel is
treated as one module whose name is TOK_KERNEL "kernel". So this script
will pass to compile, it indeed will probe kernel function:
	probe module("kernel").function("sys_read"){
	}
But there will be problem when there is actually one module named
kernel.ko though its name is weird.

Bibo,mao

Here is patch for systemtap
--- src.org/tapsets.cxx 2006-04-03 16:19:09.000000000 +0800
+++ src/tapsets.cxx     2006-04-03 16:03:03.000000000 +0800
@@ -714,9 +714,13 @@ dwflpp
   void iterate_over_modules(int (* callback)(Dwfl_Module *, void **,
                                             const char *, Dwarf_Addr,
                                             void *),
-                           void * data)
+                           void * data, int has_module)
   {
-    ptrdiff_t off = 0;
+    ptrdiff_t off;
+
+    if (has_module)
+       off = 1;
+    else off = 0;
     do
       {
        off = dwfl_getmodules (dwfl, callback, data, off);
@@ -3204,12 +3208,12 @@ dwarf_builder::build(systemtap_session &
       if (q.has_kernel)
        {
          int flag = 0;
-         dw->iterate_over_modules(&query_kernel_exists, &flag);
+         dw->iterate_over_modules(&query_kernel_exists, &flag,
q.has_module);
          if (! flag)
            throw semantic_error ("cannot find kernel debuginfo");
        }

-      dw->iterate_over_modules(&query_module, &q);
+      dw->iterate_over_modules(&query_module, &q, q.has_module);
     }
 }

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

end of thread, other threads:[~2006-04-03 21:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-03 21:47 patch for module function probe Stone, Joshua I
  -- strict thread matches above, loose matches on Subject: below --
2006-04-03  8:56 Mao, Bibo
2006-04-03  9:06 ` Li Guanglei
2006-04-03  9:24   ` bibo mao
2006-04-03 10:03     ` Li Guanglei
2006-04-03 16:14   ` Frank Ch. Eigler
2006-04-03 19:16     ` Roland McGrath

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).