summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-03-09 10:05:42 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-03-10 21:01:18 -0400
commit89f3a1254ccf16a6828671c6e5bc407bc061f040 (patch)
treee2a6c4e0eb3fd1809be552e53fe9af0c8f9bf786 /tapsets.cxx
parente2086848b3b1e010249f68857ec10d6b9382446e (diff)
downloadsystemtap-steved-89f3a1254ccf16a6828671c6e5bc407bc061f040.tar.gz
systemtap-steved-89f3a1254ccf16a6828671c6e5bc407bc061f040.tar.xz
systemtap-steved-89f3a1254ccf16a6828671c6e5bc407bc061f040.zip
Make marker probe support listing mode -L
This patch is to enable displaying the arguments of marker probe for listing mode -L. The output is like, $stap -L 'kernel.mark("*")' kernel.mark("core_marker_format").format("name %s format %s") $arg1:string $arg2:string kernel.mark("jbd2_checkpoint").format("dev %s need_checkpoint %d") $arg1:string $arg2:long kernel.mark("jbd2_end_commit").format("dev %s transaction %d head %d") $arg1:string $arg2:long $arg3:long kernel.mark("jbd2_start_commit").format("dev %s transaction %d") $arg1:string $arg2:long Note: It's also possible to figure out the arguments according to the format. Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 71a9a768..b1d0b04e 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -8523,6 +8523,7 @@ struct mark_derived_probe: public derived_probe
void join_group (systemtap_session& s);
void emit_probe_context_vars (translator_output* o);
void initialize_probe_context_vars (translator_output* o);
+ void printargs (std::ostream &o) const;
void parse_probe_format ();
};
@@ -8967,6 +8968,27 @@ mark_derived_probe::initialize_probe_context_vars (translator_output* o)
o->newline() << "deref_fault: ;";
}
+void
+mark_derived_probe::printargs(std::ostream &o) const
+{
+ for (unsigned i = 0; i < mark_args.size(); i++)
+ {
+ string localname = "$arg" + lex_cast<string>(i+1);
+ switch (mark_args[i]->stp_type)
+ {
+ case pe_long:
+ o << " " << localname << ":long";
+ break;
+ case pe_string:
+ o << " " << localname << ":string";
+ break;
+ default:
+ o << " " << localname << ":unknown";
+ break;
+ }
+ }
+}
+
void
mark_derived_probe_group::emit_module_decls (systemtap_session& s)