diff options
author | Wenji Huang <wenji.huang@oracle.com> | 2009-03-09 08:17:27 -0400 |
---|---|---|
committer | Wenji Huang <wenji.huang@oracle.com> | 2009-03-10 21:01:06 -0400 |
commit | e2086848b3b1e010249f68857ec10d6b9382446e (patch) | |
tree | 15b93360494f47795416cf017a76516fe7da1dcb | |
parent | f400d6e427cb7494d072ad124e7996925015bdf4 (diff) | |
download | systemtap-steved-e2086848b3b1e010249f68857ec10d6b9382446e.tar.gz systemtap-steved-e2086848b3b1e010249f68857ec10d6b9382446e.tar.xz systemtap-steved-e2086848b3b1e010249f68857ec10d6b9382446e.zip |
Make tracepoint probe support listing mode -L
This patch is to enable displaying arguments of tracepoint
probe in listing mode -L. The example output is like
$stap -L 'kernel.trace("block_bio*")'
kernel.trace("block_bio_bounce") $q:struct request_queue* $bio:struct bio*
kernel.trace("block_bio_backmerge") $q:struct request_queue* $bio:struct bio*
kernel.trace("block_bio_complete") $q:struct request_queue* $bio:struct bio*
kernel.trace("block_bio_queue") $q:struct request_queue* $bio:struct bio*
kernel.trace("block_bio_frontmerge") $q:struct request_queue* $bio:struct bio*
Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
-rw-r--r-- | elaborate.h | 2 | ||||
-rw-r--r-- | main.cxx | 5 | ||||
-rw-r--r-- | tapsets.cxx | 7 |
3 files changed, 13 insertions, 1 deletions
diff --git a/elaborate.h b/elaborate.h index 1e05444f..0ad5b4b2 100644 --- a/elaborate.h +++ b/elaborate.h @@ -124,6 +124,8 @@ struct derived_probe: public probe virtual void join_group (systemtap_session& s) = 0; virtual probe_point* sole_location () const; virtual void printsig (std::ostream &o) const; + //for print arguments of probe if there + virtual void printargs (std::ostream &o) const {} void printsig_nested (std::ostream &o) const; virtual void collect_derivation_chain (std::vector<probe*> &probes_list); @@ -187,13 +187,16 @@ printscript(systemtap_session& s, ostream& o) { o << pp; // Print the locals for -L mode only - if (s.unoptimized) + if (s.unoptimized) { for (unsigned j=0; j<p->locals.size(); j++) { o << " "; vardecl* v = p->locals[j]; v->printsig (o); } + // Print arguments of probe if there + p->printargs(o); + } o << endl; seen.insert (pp); } diff --git a/tapsets.cxx b/tapsets.cxx index b66dd123..71a9a768 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -9217,6 +9217,7 @@ struct tracepoint_derived_probe: public derived_probe vector <struct tracepoint_arg> args; void build_args(dwflpp& dw, Dwarf_Die& func_die); + void printargs (std::ostream &o) const; void join_group (systemtap_session& s); void emit_probe_context_vars (translator_output* o); }; @@ -9665,6 +9666,12 @@ tracepoint_derived_probe::build_args(dwflpp& dw, Dwarf_Die& func_die) while (dwarf_siblingof(&arg, &arg) == 0); } +void +tracepoint_derived_probe::printargs(std::ostream &o) const +{ + for (unsigned i = 0; i < args.size(); ++i) + o << " $" << args[i].name << ":" << args[i].c_type; +} void tracepoint_derived_probe::join_group (systemtap_session& s) |