spi-topcliff-pch: add recovery processing in case wait-event timeout
[zen-stable.git] / include / trace / events / signal.h
blob17df43464df0828e91114e2ffc9dbf9076d6d949
1 #undef TRACE_SYSTEM
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) \
12 do { \
13 if (info == SEND_SIG_NOINFO || \
14 info == SEND_SIG_FORCED) { \
15 __entry->errno = 0; \
16 __entry->code = SI_USER; \
17 } else if (info == SEND_SIG_PRIV) { \
18 __entry->errno = 0; \
19 __entry->code = SI_KERNEL; \
20 } else { \
21 __entry->errno = info->si_errno; \
22 __entry->code = info->si_code; \
23 } \
24 } while (0)
26 /**
27 * signal_generate - called when a signal is generated
28 * @sig: signal number
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 TRACE_EVENT(signal_generate,
40 TP_PROTO(int sig, struct siginfo *info, struct task_struct *task),
42 TP_ARGS(sig, info, task),
44 TP_STRUCT__entry(
45 __field( int, sig )
46 __field( int, errno )
47 __field( int, code )
48 __array( char, comm, TASK_COMM_LEN )
49 __field( pid_t, pid )
52 TP_fast_assign(
53 __entry->sig = sig;
54 TP_STORE_SIGINFO(__entry, info);
55 memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
56 __entry->pid = task->pid;
59 TP_printk("sig=%d errno=%d code=%d comm=%s pid=%d",
60 __entry->sig, __entry->errno, __entry->code,
61 __entry->comm, __entry->pid)
64 /**
65 * signal_deliver - called when a signal is delivered
66 * @sig: signal number
67 * @info: pointer to struct siginfo
68 * @ka: pointer to struct k_sigaction
70 * A 'sig' signal is delivered to current process with 'info' siginfo,
71 * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or
72 * SIG_DFL.
73 * Note that some signals reported by signal_generate tracepoint can be
74 * lost, ignored or modified (by debugger) before hitting this tracepoint.
75 * This means, this can show which signals are actually delivered, but
76 * matching generated signals and delivered signals may not be correct.
78 TRACE_EVENT(signal_deliver,
80 TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka),
82 TP_ARGS(sig, info, ka),
84 TP_STRUCT__entry(
85 __field( int, sig )
86 __field( int, errno )
87 __field( int, code )
88 __field( unsigned long, sa_handler )
89 __field( unsigned long, sa_flags )
92 TP_fast_assign(
93 __entry->sig = sig;
94 TP_STORE_SIGINFO(__entry, info);
95 __entry->sa_handler = (unsigned long)ka->sa.sa_handler;
96 __entry->sa_flags = ka->sa.sa_flags;
99 TP_printk("sig=%d errno=%d code=%d sa_handler=%lx sa_flags=%lx",
100 __entry->sig, __entry->errno, __entry->code,
101 __entry->sa_handler, __entry->sa_flags)
104 DECLARE_EVENT_CLASS(signal_queue_overflow,
106 TP_PROTO(int sig, int group, struct siginfo *info),
108 TP_ARGS(sig, group, info),
110 TP_STRUCT__entry(
111 __field( int, sig )
112 __field( int, group )
113 __field( int, errno )
114 __field( int, code )
117 TP_fast_assign(
118 __entry->sig = sig;
119 __entry->group = group;
120 TP_STORE_SIGINFO(__entry, info);
123 TP_printk("sig=%d group=%d errno=%d code=%d",
124 __entry->sig, __entry->group, __entry->errno, __entry->code)
128 * signal_overflow_fail - called when signal queue is overflow
129 * @sig: signal number
130 * @group: signal to process group or not (bool)
131 * @info: pointer to struct siginfo
133 * Kernel fails to generate 'sig' signal with 'info' siginfo, because
134 * siginfo queue is overflow, and the signal is dropped.
135 * 'group' is not 0 if the signal will be sent to a process group.
136 * 'sig' is always one of RT signals.
138 DEFINE_EVENT(signal_queue_overflow, signal_overflow_fail,
140 TP_PROTO(int sig, int group, struct siginfo *info),
142 TP_ARGS(sig, group, info)
146 * signal_lose_info - called when siginfo is lost
147 * @sig: signal number
148 * @group: signal to process group or not (bool)
149 * @info: pointer to struct siginfo
151 * Kernel generates 'sig' signal but loses 'info' siginfo, because siginfo
152 * queue is overflow.
153 * 'group' is not 0 if the signal will be sent to a process group.
154 * 'sig' is always one of non-RT signals.
156 DEFINE_EVENT(signal_queue_overflow, signal_lose_info,
158 TP_PROTO(int sig, int group, struct siginfo *info),
160 TP_ARGS(sig, group, info)
163 #endif /* _TRACE_SIGNAL_H */
165 /* This part must be outside protection */
166 #include <trace/define_trace.h>