summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-04-29 16:23:30 -0500
committerDavid Smith <dsmith@redhat.com>2008-04-29 16:26:50 -0500
commit8c392b1a21fbe01e785c20df6bd7a254f8e517d0 (patch)
treedbc4c9edb1b4c2e742a4fdd7a4facd7bb4763620 /tapsets.cxx
parent7fc1c0e73992fb10c1d5aab90622b54abcd0f797 (diff)
downloadsystemtap-steved-8c392b1a21fbe01e785c20df6bd7a254f8e517d0.tar.gz
systemtap-steved-8c392b1a21fbe01e785c20df6bd7a254f8e517d0.tar.xz
systemtap-steved-8c392b1a21fbe01e785c20df6bd7a254f8e517d0.zip
Made utrace probes more robust.
2008-04-29 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_derived_probe_group::emit_probe_decl): Added death event handlers to ensure that for every utrace_attach there is a corresponding utrace_detach. (utrace_derived_probe_group::emit_module_decls): Ditto. 2008-04-29 David Smith <dsmith@redhat.com> * task_finder.c: Made more robust by ensuring that all utrace attaches have a corresponding utrace detach.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index c10196e2..eac32b51 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4634,8 +4634,8 @@ utrace_derived_probe_group::emit_probe_decl (systemtap_session& s,
switch (p->flags)
{
case UDPF_CLONE:
- s.op->line() << " .ops={ .report_clone=stap_utrace_probe_clone },";
- s.op->line() << " .flags=(UTRACE_EVENT(CLONE)),";
+ s.op->line() << " .ops={ .report_clone=stap_utrace_probe_clone, .report_death=stap_utrace_task_finder_report_death },";
+ s.op->line() << " .flags=(UTRACE_EVENT(CLONE)|UTRACE_EVENT(DEATH)),";
break;
case UDPF_EXEC:
// Notice we're not setting up a .ops/.report_exec handler here.
@@ -4650,12 +4650,12 @@ utrace_derived_probe_group::emit_probe_decl (systemtap_session& s,
s.op->line() << " .flags=(UTRACE_EVENT(DEATH)),";
break;
case UDPF_SYSCALL_ENTRY:
- s.op->line() << " .ops={ .report_syscall_entry=stap_utrace_probe_syscall },";
- s.op->line() << " .flags=(UTRACE_EVENT(SYSCALL_ENTRY)),";
+ s.op->line() << " .ops={ .report_syscall_entry=stap_utrace_probe_syscall, .report_death=stap_utrace_task_finder_report_death },";
+ s.op->line() << " .flags=(UTRACE_EVENT(SYSCALL_ENTRY)|UTRACE_EVENT(DEATH)),";
break;
case UDPF_SYSCALL_EXIT:
- s.op->line() << " .ops={ .report_syscall_exit=stap_utrace_probe_syscall },";
- s.op->line() << " .flags=(UTRACE_EVENT(SYSCALL_EXIT)),";
+ s.op->line() << " .ops={ .report_syscall_exit=stap_utrace_probe_syscall, .report_death=stap_utrace_task_finder_report_death },";
+ s.op->line() << " .flags=(UTRACE_EVENT(SYSCALL_EXIT)|UTRACE_EVENT(DEATH)),";
break;
default:
throw semantic_error ("bad utrace probe flag");
@@ -4778,9 +4778,9 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
if (flags_seen[UDPF_CLONE] || flags_seen[UDPF_SYSCALL_ENTRY]
|| flags_seen[UDPF_SYSCALL_EXIT])
{
- s.op->newline() << "case UTRACE_EVENT(CLONE):";
- s.op->newline() << "case UTRACE_EVENT(SYSCALL_ENTRY):";
- s.op->newline() << "case UTRACE_EVENT(SYSCALL_EXIT):";
+ s.op->newline() << "case (UTRACE_EVENT(CLONE)|UTRACE_EVENT(DEATH)):";
+ s.op->newline() << "case (UTRACE_EVENT(SYSCALL_ENTRY)|UTRACE_EVENT(DEATH)):";
+ s.op->newline() << "case (UTRACE_EVENT(SYSCALL_EXIT)|UTRACE_EVENT(DEATH)):";
s.op->indent(1);
s.op->newline() << "engine = utrace_attach(tsk, UTRACE_ATTACH_CREATE, &p->ops, p);";
s.op->newline() << "if (IS_ERR(engine)) {";