2 #define TRACE_SYSTEM signal
4 #if !defined(_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_SIGNAL_H
7 #include <linux/signal.h>
8 #include <linux/sched.h>
9 #include <linux/tracepoint.h>
11 #define TP_STORE_SIGINFO(__entry, info) \
13 if (info == SEND_SIG_NOINFO) { \
15 __entry->code = SI_USER; \
16 } else if (info == SEND_SIG_PRIV) { \
18 __entry->code = SI_KERNEL; \
20 __entry->errno = info->si_errno; \
21 __entry->code = info->si_code; \
26 * signal_generate - called when a signal is generated
28 * @info: pointer to struct siginfo
29 * @task: pointer to struct task_struct
31 * Current process sends a 'sig' signal to 'task' process with
32 * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV,
33 * 'info' is not a pointer and you can't access its field. Instead,
34 * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV
35 * means that si_code is SI_KERNEL.
37 TRACE_EVENT(signal_generate,
39 TP_PROTO(int sig, struct siginfo *info, struct task_struct *task),
41 TP_ARGS(sig, info, task),
47 __array( char, comm, TASK_COMM_LEN )
53 TP_STORE_SIGINFO(__entry, info);
54 memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
55 __entry->pid = task->pid;
58 TP_printk("sig=%d errno=%d code=%d comm=%s pid=%d",
59 __entry->sig, __entry->errno, __entry->code,
60 __entry->comm, __entry->pid)
63 #endif /* _TRACE_SIGNAL_H */
65 /* This part must be outside protection */
66 #include <trace/define_trace.h>