1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM signal
5 #if !defined(LTTNG_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_SIGNAL_H
8 #include <probes/lttng-tracepoint-event.h>
10 #ifndef _TRACE_SIGNAL_DEF
11 #define _TRACE_SIGNAL_DEF
12 #include <linux/signal.h>
13 #include <linux/sched.h>
14 #undef LTTNG_FIELDS_SIGINFO
15 #define LTTNG_FIELDS_SIGINFO(info) \
16 ctf_integer(int, errno, \
17 (info == SEND_SIG_NOINFO || info == SEND_SIG_PRIV) ? \
20 ctf_integer(int, code, \
21 (info == SEND_SIG_NOINFO) ? \
23 ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code))
24 #endif /* _TRACE_SIGNAL_DEF */
27 * signal_generate - called when a signal is generated
29 * @info: pointer to struct siginfo
30 * @task: pointer to struct task_struct
32 * Current process sends a 'sig' signal to 'task' process with
33 * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV,
34 * 'info' is not a pointer and you can't access its field. Instead,
35 * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV
36 * means that si_code is SI_KERNEL.
38 LTTNG_TRACEPOINT_EVENT(signal_generate
,
40 TP_PROTO(int sig
, struct kernel_siginfo
*info
, struct task_struct
*task
,
41 int group
, int result
),
43 TP_ARGS(sig
, info
, task
, group
, result
),
46 ctf_integer(int, sig
, sig
)
47 LTTNG_FIELDS_SIGINFO(info
)
48 ctf_array_text(char, comm
, task
->comm
, TASK_COMM_LEN
)
49 ctf_integer(pid_t
, pid
, task
->pid
)
50 ctf_integer(int, group
, group
)
51 ctf_integer(int, result
, result
)
56 * signal_deliver - called when a signal is delivered
58 * @info: pointer to struct siginfo
59 * @ka: pointer to struct k_sigaction
61 * A 'sig' signal is delivered to current process with 'info' siginfo,
62 * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or
64 * Note that some signals reported by signal_generate tracepoint can be
65 * lost, ignored or modified (by debugger) before hitting this tracepoint.
66 * This means, this can show which signals are actually delivered, but
67 * matching generated signals and delivered signals may not be correct.
69 LTTNG_TRACEPOINT_EVENT(signal_deliver
,
71 TP_PROTO(int sig
, struct kernel_siginfo
*info
, struct k_sigaction
*ka
),
73 TP_ARGS(sig
, info
, ka
),
76 ctf_integer(int, sig
, sig
)
77 LTTNG_FIELDS_SIGINFO(info
)
78 ctf_integer(unsigned long, sa_handler
, (unsigned long) ka
->sa
.sa_handler
)
79 ctf_integer(unsigned long, sa_flags
, ka
->sa
.sa_flags
)
83 #endif /* LTTNG_TRACE_SIGNAL_H */
85 /* This part must be outside protection */
86 #include <probes/define_trace.h>
This page took 0.030317 seconds and 4 git commands to generate.