* [PATCH 2/2] Make marker probe support listing mode -L
@ 2009-03-10 7:10 Wenji Huang
0 siblings, 0 replies; only message in thread
From: Wenji Huang @ 2009-03-10 7:10 UTC (permalink / raw)
To: systemtap; +Cc: Wenji Huang
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>
---
tapsets.cxx | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/tapsets.cxx b/tapsets.cxx
index b424492..533d849 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -8529,6 +8529,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 ();
};
@@ -8973,6 +8974,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)
--
1.5.6
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-10 3:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10 7:10 [PATCH 2/2] Make marker probe support listing mode -L Wenji Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).