Commit dd1d6772 authored by Tejun Heo's avatar Tejun Heo Committed by Oleg Nesterov

signal: remove three noop tracehooks

Remove the following three noop tracehooks in signals.c.

* tracehook_force_sigpending()
* tracehook_get_signal()
* tracehook_finish_jctl()

The code area is about to be updated and these hooks don't do anything
other than obfuscating the logic.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
parent 62c124ff
...@@ -425,58 +425,6 @@ static inline int tracehook_consider_fatal_signal(struct task_struct *task, ...@@ -425,58 +425,6 @@ static inline int tracehook_consider_fatal_signal(struct task_struct *task,
return (task_ptrace(task) & PT_PTRACED) != 0; return (task_ptrace(task) & PT_PTRACED) != 0;
} }
/**
* tracehook_force_sigpending - let tracing force signal_pending(current) on
*
* Called when recomputing our signal_pending() flag. Return nonzero
* to force the signal_pending() flag on, so that tracehook_get_signal()
* will be called before the next return to user mode.
*
* Called with @current->sighand->siglock held.
*/
static inline int tracehook_force_sigpending(void)
{
return 0;
}
/**
* tracehook_get_signal - deliver synthetic signal to traced task
* @task: @current
* @regs: task_pt_regs(@current)
* @info: details of synthetic signal
* @return_ka: sigaction for synthetic signal
*
* Return zero to check for a real pending signal normally.
* Return -1 after releasing the siglock to repeat the check.
* Return a signal number to induce an artificial signal delivery,
* setting *@info and *@return_ka to specify its details and behavior.
*
* The @return_ka->sa_handler value controls the disposition of the
* signal, no matter the signal number. For %SIG_DFL, the return value
* is a representative signal to indicate the behavior (e.g. %SIGTERM
* for death, %SIGQUIT for core dump, %SIGSTOP for job control stop,
* %SIGTSTP for stop unless in an orphaned pgrp), but the signal number
* reported will be @info->si_signo instead.
*
* Called with @task->sighand->siglock held, before dequeuing pending signals.
*/
static inline int tracehook_get_signal(struct task_struct *task,
struct pt_regs *regs,
siginfo_t *info,
struct k_sigaction *return_ka)
{
return 0;
}
/**
* tracehook_finish_jctl - report about return from job control stop
*
* This is called by do_signal_stop() after wakeup.
*/
static inline void tracehook_finish_jctl(void)
{
}
#define DEATH_REAP -1 #define DEATH_REAP -1
#define DEATH_DELAYED_GROUP_LEADER -2 #define DEATH_DELAYED_GROUP_LEADER -2
......
...@@ -150,9 +150,7 @@ void recalc_sigpending_and_wake(struct task_struct *t) ...@@ -150,9 +150,7 @@ void recalc_sigpending_and_wake(struct task_struct *t)
void recalc_sigpending(void) void recalc_sigpending(void)
{ {
if (unlikely(tracehook_force_sigpending())) if (!recalc_sigpending_tsk(current) && !freezing(current))
set_thread_flag(TIF_SIGPENDING);
else if (!recalc_sigpending_tsk(current) && !freezing(current))
clear_thread_flag(TIF_SIGPENDING); clear_thread_flag(TIF_SIGPENDING);
} }
...@@ -2005,8 +2003,6 @@ static int do_signal_stop(int signr) ...@@ -2005,8 +2003,6 @@ static int do_signal_stop(int signr)
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
tracehook_finish_jctl();
return 1; return 1;
} }
...@@ -2109,23 +2105,12 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, ...@@ -2109,23 +2105,12 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
for (;;) { for (;;) {
struct k_sigaction *ka; struct k_sigaction *ka;
/*
* Tracing can induce an artificial signal and choose sigaction.
* The return value in @signr determines the default action,
* but @info->si_signo is the signal number we will report.
*/
signr = tracehook_get_signal(current, regs, info, return_ka);
if (unlikely(signr < 0))
goto relock;
if (unlikely(signr != 0))
ka = return_ka;
else {
if (unlikely(current->jobctl & JOBCTL_STOP_PENDING) && if (unlikely(current->jobctl & JOBCTL_STOP_PENDING) &&
do_signal_stop(0)) do_signal_stop(0))
goto relock; goto relock;
signr = dequeue_signal(current, &current->blocked, signr = dequeue_signal(current, &current->blocked, info);
info);
if (!signr) if (!signr)
break; /* will return 0 */ break; /* will return 0 */
...@@ -2138,7 +2123,6 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, ...@@ -2138,7 +2123,6 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
} }
ka = &sighand->action[signr-1]; ka = &sighand->action[signr-1];
}
/* Trace actually delivered signals. */ /* Trace actually delivered signals. */
trace_signal_deliver(signr, info, ka); trace_signal_deliver(signr, info, ka);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment