Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
signal.h
Go to the documentation of this file.
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM signal
3 
4 #if !defined(_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_SIGNAL_H
6 
7 #include <linux/signal.h>
8 #include <linux/sched.h>
9 #include <linux/tracepoint.h>
10 
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)
25 
26 #ifndef TRACE_HEADER_MULTI_READ
27 enum {
33 };
34 #endif
35 
50 TRACE_EVENT(signal_generate,
51 
52  TP_PROTO(int sig, struct siginfo *info, struct task_struct *task,
53  int group, int result),
54 
55  TP_ARGS(sig, info, task, group, result),
56 
58  __field( int, sig )
59  __field( int, errno )
60  __field( int, code )
61  __array( char, comm, TASK_COMM_LEN )
62  __field( pid_t, pid )
63  __field( int, group )
64  __field( int, result )
65  ),
66 
68  __entry->sig = sig;
70  memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
71  __entry->pid = task->pid;
72  __entry->group = group;
73  __entry->result = result;
74  ),
75 
76  TP_printk("sig=%d errno=%d code=%d comm=%s pid=%d grp=%d res=%d",
77  __entry->sig, __entry->errno, __entry->code,
78  __entry->comm, __entry->pid, __entry->group,
79  __entry->result)
80 );
81 
96 TRACE_EVENT(signal_deliver,
97 
98  TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka),
99 
100  TP_ARGS(sig, info, ka),
101 
103  __field( int, sig )
104  __field( int, errno )
105  __field( int, code )
106  __field( unsigned long, sa_handler )
107  __field( unsigned long, sa_flags )
108  ),
109 
111  __entry->sig = sig;
112  TP_STORE_SIGINFO(__entry, info);
113  __entry->sa_handler = (unsigned long)ka->sa.sa_handler;
114  __entry->sa_flags = ka->sa.sa_flags;
115  ),
116 
117  TP_printk("sig=%d errno=%d code=%d sa_handler=%lx sa_flags=%lx",
118  __entry->sig, __entry->errno, __entry->code,
119  __entry->sa_handler, __entry->sa_flags)
120 );
121 
122 #endif /* _TRACE_SIGNAL_H */
123 
124 /* This part must be outside protection */
125 #include <trace/define_trace.h>