public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] searching all Dwarf_Die for kernel.statement
@ 2008-05-22 12:48 Wenji Huang
  2008-05-22 15:55 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Wenji Huang @ 2008-05-22 12:48 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 1940 bytes --]

Hi,
In recent systemtap source, the script kernel.statement(xxx) couldn't 
work well due to failing in founding matched probe point. Also the 
testcase systemtap.base/stmtvars.exp won't pass in machines. It came 
from the commit 6561773f763d40c00a115b53493ecf2d4f425d0d "PR5643: 
function caching for much faster syscall.* pass-2 processing".

The problem is like:

#stap -u -p2 -vve 'probe kernel.function("__kmalloc") {abc}'
SystemTap translator/driver (version 0.7/0.131 git branch master, commit 
dbb280c7)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapvBKkFm"
Searched '/usr/local/share/systemtap/tapset/i686/*.stp', found 2
Searched '/usr/local/share/systemtap/tapset/*.stp', found 40
Pass 1: parsed user script and 42 library script(s) in 
380usr/40sys/421real ms.
probe __kmalloc@mm/slab.c:3747 kernel section=.text pc=0xc0140b30
semantic error: probe_1450 with unresolved type: identifier 'abc' at 
<input>:1:37

But if we run kernel.statement() with the pc equaling to the address of 
function __kmalloc

# stap -u -p2 -vve 'probe kernel.statement(0xc0140b30) {}'
SystemTap translator/driver (version 0.7/0.131 git branch master, commit 
dbb280c7)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapV2mvpd"
Searched '/usr/local/share/systemtap/tapset/i686/*.stp', found 2
Searched '/usr/local/share/systemtap/tapset/*.stp', found 40
Pass 1: parsed user script and 42 library script(s) in 
420usr/30sys/453real ms.
semantic error: no match while resolving probe point 
kernel.statement(3222539056)
semantic error: no probes found

In fact, the probe point is there. The error message is not correct.
The following patch will solve the problem which enables searching all 
vectors in case of kernel.statement.

Best regards,
Wenji

[-- Attachment #2: statement.patch --]
[-- Type: text/x-patch, Size: 625 bytes --]

diff --git a/tapsets.cxx b/tapsets.cxx
index f3f9b59..d61aa72 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2527,6 +2527,15 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg),
             }
         }
     }
+  else if (q->has_statement_num) // searching all for kernel.statement
+   {
+      for (cu_function_cache_t::iterator it = v->begin(); it != v->end(); it++)
+        {
+         Dwarf_Die die = it->second;
+         rc = (*callback)(& die, data);
+         if (rc != DWARF_CB_OK) break;
+        }
+   }
   else // not a wildcard and no match in this CU
     {
       // do nothing

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

* Re: [PATCH] searching all Dwarf_Die for kernel.statement
  2008-05-22 12:48 [PATCH] searching all Dwarf_Die for kernel.statement Wenji Huang
@ 2008-05-22 15:55 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2008-05-22 15:55 UTC (permalink / raw)
  To: Wenji Huang; +Cc: systemtap

Wenji Huang <wenji.huang@oracle.com> writes:

> [...]
> systemtap.base/stmtvars.exp won't pass in machines. It came
> from the commit 6561773f763d40c00a115b53493ecf2d4f425d0d "PR5643:
> function caching for much faster syscall.* pass-2 processing".
> [...]

Thanks, good analysis and good patch.  I'm sorry about not recognizing
the regression right away.

- FChE

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

end of thread, other threads:[~2008-05-22 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-22 12:48 [PATCH] searching all Dwarf_Die for kernel.statement Wenji Huang
2008-05-22 15:55 ` Frank Ch. Eigler

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