This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Bug 6731: improve -l (listing mode) to list probe/alias variables
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: systemtap at sources dot redhat dot com
- Date: Thu, 28 Aug 2008 17:05:49 +0800
- Subject: [PATCH] Bug 6731: improve -l (listing mode) to list probe/alias variables
- Reply-to: wenji dot huang at oracle dot com
This patch will print the variables name and type when stap is in
listing mode. Since there is no pass-2 intermediate state to be provided
by bug #3498, it is a simple and practicable method in current status.
The output is like:
[wjhuang@systemtap]$ stap -l syscall.b*
syscall.bdflush
name:string, func:long, data:long, data_str:string, argstr:string
syscall.bind
name:string, sockfd:long, my_addr_uaddr:long, addrlen:long, argstr:string
syscall.brk
name:string, brk:long, argstr:string
diff --git a/main.cxx b/main.cxx
index 8c99cf7..5cfef7c 100644
--- a/main.cxx
+++ b/main.cxx
@@ -179,6 +179,16 @@ printscript(systemtap_session& s, ostream& o)
if (seen.find (pp) == seen.end())
{
o << pp << endl;
+ if (p->locals.size()>0)
+ o << " ";
+ for (unsigned j=0; j<p->locals.size(); j++)
+ {
+ vardecl* v = p->locals[j];
+ if (j>0)
+ o << ", ";
+ v->printsig (o);
+ }
+ o << endl;
seen.insert (pp);
}
}
@@ -581,6 +591,7 @@ main (int argc, char * const argv [])
case 'l':
s.suppress_warnings = true;
s.listing_mode = true;
+ s.unoptimized = true;
s.last_pass = 2;
if (have_script)
{
Regards,
Wenji