diff options
author | Stan Cox <scox@redhat.com> | 2009-10-01 09:18:21 -0400 |
---|---|---|
committer | Stan Cox <scox@redhat.com> | 2009-10-01 09:18:21 -0400 |
commit | 903b9fcdc3f5bf294514376e2e428bd45c647290 (patch) | |
tree | cb7506ec87cad398abc7476622433cbe70134450 /tapsets.cxx | |
parent | 28b768e153364537aa84bd3f3143b961ec3d5fd8 (diff) | |
download | systemtap-steved-903b9fcdc3f5bf294514376e2e428bd45c647290.tar.gz systemtap-steved-903b9fcdc3f5bf294514376e2e428bd45c647290.tar.xz systemtap-steved-903b9fcdc3f5bf294514376e2e428bd45c647290.zip |
Add DEBUG_UPROBES for sdt semaphores.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Add
DEBUG_UPROBES for sdt semaphores
* dtrace.in (main): Add -k option to keep around the temp files.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index fdbddd9e..4433af3f 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4601,6 +4601,10 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "sup->sdt_sem_address = relocation + sups->sdt_sem_address;"; s.op->newline() << "(void) __access_process_vm (tsk, sup->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 0);"; s.op->newline() << "sdt_semaphore ++;"; + s.op->newline() << "#ifdef DEBUG_UPROBES"; + s.op->newline() << "_stp_dbug (__FUNCTION__,__LINE__, \"+semaphore %#x @ %#lx\\n\", sdt_semaphore, sup->sdt_sem_address);"; + s.op->newline() << "#endif"; + s.op->newline() << "(void) __access_process_vm (tsk, sup->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 1);"; // XXX: error handling in __access_process_vm! // XXX: need to analyze possibility of race condition @@ -4864,6 +4868,9 @@ uprobe_derived_probe_group::emit_module_exit (systemtap_session& s) s.op->newline() << "if (tsk) {"; // just in case the thing exited while we weren't watching s.op->newline(1) << "(void) __access_process_vm (tsk, sup->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 0);"; s.op->newline() << "sdt_semaphore --;"; + s.op->newline() << "#ifdef DEBUG_UPROBES"; + s.op->newline() << "_stp_dbug (__FUNCTION__,__LINE__, \"-semaphore %#x @ %#lx\\n\", sdt_semaphore, sup->sdt_sem_address);"; + s.op->newline() << "#endif"; s.op->newline() << "(void) __access_process_vm (tsk, sup->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 1);"; // XXX: error handling in __access_process_vm! // XXX: need to analyze possibility of race condition |