This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Fix redundant implicit probe points in listing mode.
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: systemtap <systemtap at sourceware dot org>
- Date: Fri, 05 Sep 2008 16:17:19 +0800
- Subject: [PATCH] Fix redundant implicit probe points in listing mode.
- Reply-to: wenji dot huang at oracle dot com
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