aboutsummaryrefslogtreecommitdiff
path: root/handle_event.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2011-11-02 13:25:49 +0100
committerPetr Machata <pmachata@redhat.com>2011-11-02 13:25:49 +0100
commit43d2fe5436d39da0b1ff6648fc0dfd766d28243e (patch)
tree212f2e0a4ad114356d74be339fbdddf96c4b96bc /handle_event.c
parent06986d5432c92337dc2fc0bd81fa43640b48d1e2 (diff)
downloadltrace-43d2fe5436d39da0b1ff6648fc0dfd766d28243e.tar.gz
Don't queue sysret events
- That's because on s390x, we use process call stack to actually figure out whether it's a syscall/sysret event, and if it's sysret, then what syscall it returns from. So we need to keep the stack in sync with reality.
Diffstat (limited to 'handle_event.c')
-rw-r--r--handle_event.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/handle_event.c b/handle_event.c
index f56c537..e527c0f 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -70,7 +70,9 @@ handle_event(Event *event) {
/* Note: the previous handler has a chance to alter
* the event. */
- if (event->proc->leader != NULL) {
+ if (event->proc != NULL
+ && event->proc->leader != NULL
+ && event->proc != event->proc->leader) {
event = call_handler(event->proc->leader, event);
if (event == NULL)
return;
@@ -454,7 +456,7 @@ handle_syscall(Event *event) {
enable_all_breakpoints(event->proc);
}
}
- continue_process(event->proc->pid);
+ continue_after_syscall(event->proc, event->e_un.sysnum, 0);
}
static void
@@ -533,9 +535,12 @@ handle_sysret(Event *event) {
output_right(LT_TOF_SYSCALLR, event->proc,
sysname(event->proc, event->e_un.sysnum));
}
+ assert(event->proc->callstack_depth > 0);
+ unsigned d = event->proc->callstack_depth - 1;
+ assert(event->proc->callstack[d].is_syscall);
callstack_pop(event->proc);
}
- continue_process(event->proc->pid);
+ continue_after_syscall(event->proc, event->e_un.sysnum, 1);
}
static void