diff options
author | Roland McGrath <roland@redhat.com> | 2008-07-25 22:45:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:09 -0400 |
commit | 7bcf6a2ca5f639b038c48711ebe6c4eca2036641 (patch) | |
tree | 4219a0725d581310f729d4616361febd700f0574 /include/linux/tracehook.h | |
parent | 283d7559e7712f95a05331eb0a85394c6368101b (diff) |
tracehook: get_signal_to_deliver
This defines the tracehook_get_signal() hook to allow tracing code to slip
in before normal signal dequeuing. This lays the groundwork for new
tracing features that can inject synthetic signals outside the normal
queue or control the disposition of delivered signals. The calling
convention lets tracehook_get_signal() decide both exactly what will
happen and what signal number to report in the handler/exit.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/tracehook.h')
-rw-r--r-- | include/linux/tracehook.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 3548694a24d..42a0d7b1195 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -422,4 +422,33 @@ static inline int tracehook_consider_fatal_signal(struct task_struct *task, | |||
422 | return (task_ptrace(task) & PT_PTRACED) != 0; | 422 | return (task_ptrace(task) & PT_PTRACED) != 0; |
423 | } | 423 | } |
424 | 424 | ||
425 | /** | ||
426 | * tracehook_get_signal - deliver synthetic signal to traced task | ||
427 | * @task: @current | ||
428 | * @regs: task_pt_regs(@current) | ||
429 | * @info: details of synthetic signal | ||
430 | * @return_ka: sigaction for synthetic signal | ||
431 | * | ||
432 | * Return zero to check for a real pending signal normally. | ||
433 | * Return -1 after releasing the siglock to repeat the check. | ||
434 | * Return a signal number to induce an artifical signal delivery, | ||
435 | * setting *@info and *@return_ka to specify its details and behavior. | ||
436 | * | ||
437 | * The @return_ka->sa_handler value controls the disposition of the | ||
438 | * signal, no matter the signal number. For %SIG_DFL, the return value | ||
439 | * is a representative signal to indicate the behavior (e.g. %SIGTERM | ||
440 | * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop, | ||
441 | * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number | ||
442 | * reported will be @info->si_signo instead. | ||
443 | * | ||
444 | * Called with @task->sighand->siglock held, before dequeuing pending signals. | ||
445 | */ | ||
446 | static inline int tracehook_get_signal(struct task_struct *task, | ||
447 | struct pt_regs *regs, | ||
448 | siginfo_t *info, | ||
449 | struct k_sigaction *return_ka) | ||
450 | { | ||
451 | return 0; | ||
452 | } | ||
453 | |||
425 | #endif /* <linux/tracehook.h> */ | 454 | #endif /* <linux/tracehook.h> */ |