public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix redundant implicit probe points in listing mode.
@ 2008-09-05  8:20 Wenji Huang
  2008-09-05 13:29 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Wenji Huang @ 2008-09-05  8:20 UTC (permalink / raw)
  To: systemtap

Hi,

There are redundant probe points those will be outputted in listing 
mode. Such as:
[wjhuang@systemtap]$ stap -l signal.d*
signal.do_action
begin(-1)
end idx0:long

This will just happen when functions calling included in definition of 
probe alias. There are initialization works done on implicitly 
begin(-1). And some operations on global variables are also processed on 
implicit end one. Those could enlarge the retrieved s.probes.

There is workaround to solve it.

[PATCH 1/1] Fix redundant implicit probe points in listing mode.

---
  elaborate.cxx |    2 ++
  main.cxx      |    3 ++-
  2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/elaborate.cxx b/elaborate.cxx
index 44b6e24..7014928 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1148,6 +1148,8 @@ semantic_pass_symbols (systemtap_session& s)
  void add_global_var_display (systemtap_session& s)
  {
    varuse_collecting_visitor vut;
+
+  if (s.listing_mode)  return;
    for (unsigned i=0; i<s.probes.size(); i++)
      {
        s.probes[i]->body->visit (& vut);
diff --git a/main.cxx b/main.cxx
index 83afb91..74fba86 100644
--- a/main.cxx
+++ b/main.cxx
@@ -173,7 +173,8 @@ printscript(systemtap_session& s, ostream& o)
                second->locations[0]->print(tmps); // XXX: [0] is less 
arbitrary here, but still ...
              }
            string pp = tmps.str();
-
+          if (!pp.compare("begin(-1)")) continue;
+
            // Now duplicate-eliminate.  An alias may have expanded to
            // several actual derived probe points, but we only want to
            // print the alias head name once.

Regards,
Wenji

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

end of thread, other threads:[~2008-09-08  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-05  8:20 [PATCH] Fix redundant implicit probe points in listing mode Wenji Huang
2008-09-05 13:29 ` Frank Ch. Eigler
2008-09-08  7:32   ` Wenji Huang

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