This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Fix redundant implicit probe points in listing mode.
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap <systemtap at sourceware dot org>
- Date: Mon, 08 Sep 2008 15:28:38 +0800
- Subject: Re: [PATCH] Fix redundant implicit probe points in listing mode.
- References: <48C0EB0F.4060604@oracle.com> <y0m8wu6vi2j.fsf@ton.toronto.redhat.com>
- Reply-to: wenji dot huang at oracle dot com
Frank Ch. Eigler wrote:
[...]
@@ -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;
That's not too bad, though perhaps a session flag for
global_var_display per se could be used instead. (It'd default to
"on"; not have any command line option to disable it directly yet; but
"-l"/'-L" would clear it.)
@@ -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;
+
This one can't go in. Instead, the tapset that includes that
begin(-1) probe could be changed to do the initialization in a
function (with a private initted-already? flag) rather than the begin
probe. Future listings based on PR 3498 should make that workaround
unnecessary.
Thanks for your comments.
The begin(-1) probe is only included in tapset/signal.stp. So only
stap -l signal.* will list begin(-1) probe.
Updated the signal tapset and change begin(-1) to local function to
avoid the redundant one.
---
elaborate.cxx | 2 ++
tapset/signal.stp | 7 +------
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/elaborate.cxx b/elaborate.cxx
index 3dfc718..15ced84 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; //avoid end probe in listing_mode
for (unsigned i=0; i<s.probes.size(); i++)
{
s.probes[i]->body->visit (& vut);
diff --git a/tapset/signal.stp b/tapset/signal.stp
index 1128e6f..d08c0c1 100644
--- a/tapset/signal.stp
+++ b/tapset/signal.stp
@@ -609,12 +609,6 @@ function sa_handler_str(handler) {
* Signals start from 1 not 0.
*/
function signal_str(num) {
- return __sig[num]
-}
-
-global __sig[64]
-
-probe begin(-1) {
__sig[1] = "HUP"
__sig[2] = "INT"
__sig[3] = "QUIT"
@@ -679,4 +673,5 @@ probe begin(-1) {
__sig[62] = "RTMIN+30"
__sig[63] = "RTMIN+31"
__sig[64] = "RTMIN+32"
+ return __sig[num]
}
--
Regards,
Wenji