This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch for module function probe


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);
     }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]