• Home
  • Raw
  • Download

Lines Matching refs:event

47 static void handle_signal(Event *event);
48 static void handle_exit(Event *event);
49 static void handle_exit_signal(Event *event);
50 static void handle_syscall(Event *event);
51 static void handle_arch_syscall(Event *event);
52 static void handle_sysret(Event *event);
53 static void handle_arch_sysret(Event *event);
54 static void handle_clone(Event *event);
55 static void handle_exec(Event *event);
56 static void handle_breakpoint(Event *event);
57 static void handle_new(Event *event);
71 call_handler(struct process *proc, Event *event) in call_handler() argument
77 return event; in call_handler()
79 return (*handler->on_event) (handler, event); in call_handler()
83 handle_event(Event *event) in handle_event() argument
91 event->proc ? event->proc->pid : -1, event->type); in handle_event()
97 if (event->proc != NULL) { in handle_event()
98 event = call_handler(event->proc, event); in handle_event()
99 if (event == NULL) in handle_event()
105 if (event->proc != NULL in handle_event()
106 && event->proc->leader != NULL in handle_event()
107 && event->proc != event->proc->leader) { in handle_event()
108 event = call_handler(event->proc->leader, event); in handle_event()
109 if (event == NULL) in handle_event()
114 switch (event->type) { in handle_event()
120 assert(event->proc != NULL); in handle_event()
122 event->proc->pid, in handle_event()
123 shortsignal(event->proc, event->e_un.signum), in handle_event()
124 event->e_un.signum); in handle_event()
125 handle_signal(event); in handle_event()
129 assert(event->proc != NULL); in handle_event()
131 event->proc->pid, in handle_event()
132 event->e_un.ret_val); in handle_event()
133 handle_exit(event); in handle_event()
137 assert(event->proc != NULL); in handle_event()
139 event->proc->pid, in handle_event()
140 shortsignal(event->proc, event->e_un.signum), in handle_event()
141 event->e_un.signum); in handle_event()
142 handle_exit_signal(event); in handle_event()
146 assert(event->proc != NULL); in handle_event()
148 event->proc->pid, in handle_event()
149 sysname(event->proc, event->e_un.sysnum), in handle_event()
150 event->e_un.sysnum); in handle_event()
151 handle_syscall(event); in handle_event()
155 assert(event->proc != NULL); in handle_event()
157 event->proc->pid, in handle_event()
158 sysname(event->proc, event->e_un.sysnum), in handle_event()
159 event->e_un.sysnum); in handle_event()
160 handle_sysret(event); in handle_event()
164 assert(event->proc != NULL); in handle_event()
166 event->proc->pid, in handle_event()
167 arch_sysname(event->proc, event->e_un.sysnum), in handle_event()
168 event->e_un.sysnum); in handle_event()
169 handle_arch_syscall(event); in handle_event()
173 assert(event->proc != NULL); in handle_event()
175 event->proc->pid, in handle_event()
176 arch_sysname(event->proc, event->e_un.sysnum), in handle_event()
177 event->e_un.sysnum); in handle_event()
178 handle_arch_sysret(event); in handle_event()
183 assert(event->proc != NULL); in handle_event()
185 event->proc->pid, event->e_un.newpid); in handle_event()
186 handle_clone(event); in handle_event()
190 assert(event->proc != NULL); in handle_event()
192 event->proc->pid); in handle_event()
193 handle_exec(event); in handle_event()
197 assert(event->proc != NULL); in handle_event()
199 event->proc->pid, event->e_un.brk_addr); in handle_event()
200 handle_breakpoint(event); in handle_event()
205 event->e_un.newpid); in handle_event()
206 handle_new(event); in handle_event()
269 handle_clone(Event *event) in handle_clone() argument
271 debug(DEBUG_FUNCTION, "handle_clone(pid=%d)", event->proc->pid); in handle_clone()
274 pid_t newpid = event->e_un.newpid; in handle_clone()
276 || process_clone(proc, event->proc, newpid) < 0) { in handle_clone()
284 proc->parent = event->proc; in handle_clone()
296 if (event->proc->state == STATE_ATTACHED in handle_clone()
309 if (event->type != EVENT_VFORK) in handle_clone()
310 continue_process(event->proc->pid); in handle_clone()
318 handle_new(Event *event) in handle_new() argument
320 debug(DEBUG_FUNCTION, "handle_new(pid=%d)", event->e_un.newpid); in handle_new()
322 struct process *proc = pid2proc(event->e_un.newpid); in handle_new()
324 pending_new_insert(event->e_un.newpid); in handle_new()
412 handle_signal(Event *event) { in handle_signal() argument
413 debug(DEBUG_FUNCTION, "handle_signal(pid=%d, signum=%d)", event->proc->pid, event->e_un.signum); in handle_signal()
414 if (event->proc->state != STATE_IGNORED && !options.no_signals) { in handle_signal()
415 output_line(event->proc, "--- %s (%s) ---", in handle_signal()
416 shortsignal(event->proc, event->e_un.signum), in handle_signal()
417 strsignal(event->e_un.signum)); in handle_signal()
419 continue_after_signal(event->proc->pid, event->e_un.signum); in handle_signal()
501 handle_exit(Event *event) { in handle_exit() argument
502 debug(DEBUG_FUNCTION, "handle_exit(pid=%d, status=%d)", event->proc->pid, event->e_un.ret_val); in handle_exit()
503 if (event->proc->state != STATE_IGNORED) { in handle_exit()
504 output_line(event->proc, "+++ exited (status %d) +++", in handle_exit()
505 event->e_un.ret_val); in handle_exit()
508 account_current_callstack(event->proc); in handle_exit()
509 remove_process(event->proc); in handle_exit()
513 handle_exit_signal(Event *event) { in handle_exit_signal() argument
514 …debug(DEBUG_FUNCTION, "handle_exit_signal(pid=%d, signum=%d)", event->proc->pid, event->e_un.signu… in handle_exit_signal()
515 if (event->proc->state != STATE_IGNORED) { in handle_exit_signal()
516 output_line(event->proc, "+++ killed by %s +++", in handle_exit_signal()
517 shortsignal(event->proc, event->e_un.signum)); in handle_exit_signal()
520 account_current_callstack(event->proc); in handle_exit_signal()
521 remove_process(event->proc); in handle_exit_signal()
560 handle_syscall(Event *event) in handle_syscall() argument
562 debug(DEBUG_FUNCTION, "handle_syscall(pid=%d, sysnum=%d)", event->proc->pid, event->e_un.sysnum); in handle_syscall()
563 if (event->proc->state != STATE_IGNORED) { in handle_syscall()
564 callstack_push_syscall(event->proc, event->e_un.sysnum); in handle_syscall()
566 output_syscall_left(event->proc, in handle_syscall()
567 sysname(event->proc, in handle_syscall()
568 event->e_un.sysnum)); in handle_syscall()
570 continue_after_syscall(event->proc, event->e_un.sysnum, 0); in handle_syscall()
574 handle_exec(Event *event) in handle_exec() argument
576 struct process *proc = event->proc; in handle_exec()
603 handle_arch_syscall(Event *event) { in handle_arch_syscall() argument
604 …debug(DEBUG_FUNCTION, "handle_arch_syscall(pid=%d, sysnum=%d)", event->proc->pid, event->e_un.sysn… in handle_arch_syscall()
605 if (event->proc->state != STATE_IGNORED) { in handle_arch_syscall()
606 callstack_push_syscall(event->proc, 0xf0000 + event->e_un.sysnum); in handle_arch_syscall()
608 output_syscall_left(event->proc, in handle_arch_syscall()
609 arch_sysname(event->proc, in handle_arch_syscall()
610 event->e_un.sysnum)); in handle_arch_syscall()
613 continue_process(event->proc->pid); in handle_arch_syscall()
617 handle_x_sysret(Event *event, char *(*name_cb)(struct process *, int)) in handle_x_sysret() argument
620 event->proc->pid, event->e_un.sysnum); in handle_x_sysret()
622 unsigned d = event->proc->callstack_depth; in handle_x_sysret()
624 struct callstack_element *elem = &event->proc->callstack[d - 1]; in handle_x_sysret()
627 if (event->proc->state != STATE_IGNORED) { in handle_x_sysret()
630 output_syscall_right(event->proc, in handle_x_sysret()
631 name_cb(event->proc, in handle_x_sysret()
632 event->e_un.sysnum), in handle_x_sysret()
635 callstack_pop(event->proc); in handle_x_sysret()
637 continue_after_syscall(event->proc, event->e_un.sysnum, 1); in handle_x_sysret()
641 handle_sysret(Event *event) in handle_sysret() argument
643 handle_x_sysret(event, &sysname); in handle_sysret()
647 handle_arch_sysret(Event *event) in handle_arch_sysret() argument
649 handle_x_sysret(event, &arch_sysname); in handle_arch_sysret()
677 handle_breakpoint(Event *event) in handle_breakpoint() argument
681 struct process *leader = event->proc->leader; in handle_breakpoint()
682 void *brk_addr = event->e_un.brk_addr; in handle_breakpoint()
686 continue_process(event->proc->pid); in handle_breakpoint()
691 event->proc->pid, brk_addr); in handle_breakpoint()
694 for (i = event->proc->callstack_depth - 1; i >= 0; i--) { in handle_breakpoint()
695 if (brk_addr == event->proc->callstack[i].return_addr) { in handle_breakpoint()
696 for (j = event->proc->callstack_depth - 1; j > i; j--) in handle_breakpoint()
697 callstack_pop(event->proc); in handle_breakpoint()
700 event->proc->callstack[i].c_un.libfunc; in handle_breakpoint()
702 arch_symbol_ret(event->proc, libsym); in handle_breakpoint()
703 output_right_tos(event->proc); in handle_breakpoint()
704 callstack_pop(event->proc); in handle_breakpoint()
712 while (event->proc->callstack_depth > 0) { in handle_breakpoint()
714 size_t d = event->proc->callstack_depth; in handle_breakpoint()
715 prev = &event->proc->callstack[d - 1]; in handle_breakpoint()
721 arch_symbol_ret(event->proc, in handle_breakpoint()
723 output_right_tos(event->proc); in handle_breakpoint()
724 callstack_pop(event->proc); in handle_breakpoint()
732 continue_after_breakpoint(event->proc, sbp); in handle_breakpoint()
734 set_instruction_pointer(event->proc, brk_addr); in handle_breakpoint()
735 continue_process(event->proc->pid); in handle_breakpoint()
742 breakpoint_on_hit(sbp, event->proc); in handle_breakpoint()
743 else if (event->proc->state != STATE_IGNORED) in handle_breakpoint()
744 output_line(event->proc, in handle_breakpoint()
751 if (event->proc->state != STATE_IGNORED in handle_breakpoint()
753 event->proc->stack_pointer = get_stack_pointer(event->proc); in handle_breakpoint()
754 callstack_push_symfunc(event->proc, sbp); in handle_breakpoint()
756 output_left(LT_TOF_FUNCTION, event->proc, in handle_breakpoint()
760 breakpoint_on_continue(sbp, event->proc); in handle_breakpoint()
763 set_instruction_pointer(event->proc, brk_addr); in handle_breakpoint()
766 continue_process(event->proc->pid); in handle_breakpoint()