summaryrefslogtreecommitdiffstats
path: root/tapset-perfmon.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-18 18:57:10 -0700
committerJosh Stone <jistone@redhat.com>2010-03-18 18:57:10 -0700
commit06d2888cc8c1eaea2cc17683975ed7d76797cd1e (patch)
treed6c513bc5d41201b2845a0c0d4547741c0c01a39 /tapset-perfmon.cxx
parent34fe8ec416abfb4355fcb1a9a015de7c9dfc9380 (diff)
downloadsystemtap-steved-06d2888cc8c1eaea2cc17683975ed7d76797cd1e.tar.gz
systemtap-steved-06d2888cc8c1eaea2cc17683975ed7d76797cd1e.tar.xz
systemtap-steved-06d2888cc8c1eaea2cc17683975ed7d76797cd1e.zip
Simplify the perf entry handlers
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls): Just pass an index from the individual entry handlers, and let handle_perf_probe figure out the pp and ph.
Diffstat (limited to 'tapset-perfmon.cxx')
-rw-r--r--tapset-perfmon.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/tapset-perfmon.cxx b/tapset-perfmon.cxx
index 98bc8fe6..65e28a08 100644
--- a/tapset-perfmon.cxx
+++ b/tapset-perfmon.cxx
@@ -84,8 +84,7 @@ perf_derived_probe_group::emit_module_decls (systemtap_session& s)
s.op->newline();
/* declarations */
- s.op->newline() << "static void handle_perf_probe (const char *pp, "
- << "void (*ph) (struct context*), struct pt_regs *regs);";
+ s.op->newline() << "static void handle_perf_probe (unsigned i, struct pt_regs *regs);";
for (unsigned i=0; i < probes.size(); i++)
s.op->newline() << "static void enter_perf_probe_" << i
<< " (struct perf_event *e, int nmi, "
@@ -120,19 +119,17 @@ perf_derived_probe_group::emit_module_decls (systemtap_session& s)
<< "struct perf_sample_data *data, "
<< "struct pt_regs *regs)";
s.op->newline() << "{";
- s.op->newline(1) << "handle_perf_probe(" << lex_cast_qstring (*probes[i]->sole_location())
- << ", " << probes[i]->name << ", regs);";
+ s.op->newline(1) << "handle_perf_probe(" << i << ", regs);";
s.op->newline(-1) << "}";
}
s.op->newline();
- s.op->newline() << "static void handle_perf_probe (const char *pp, "
- << "void (*ph) (struct context*), struct pt_regs *regs)";
+ s.op->newline() << "static void handle_perf_probe (unsigned i, struct pt_regs *regs)";
s.op->newline() << "{";
- s.op->indent(1);
- common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", "pp");
+ s.op->newline(1) << "struct stap_perf_probe* stp = & stap_perf_probes [i];";
+ common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", "stp->pp");
s.op->newline() << "c->regs = regs;";
- s.op->newline() << "(*ph) (c);";
+ s.op->newline() << "(*stp->ph) (c);";
common_probe_entryfn_epilogue (s.op);
s.op->newline(-1) << "}";
}