~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/signal.h

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #undef TRACE_SYSTEM
  3 #define TRACE_SYSTEM signal
  4 
  5 #if !defined(_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
  6 #define _TRACE_SIGNAL_H
  7 
  8 #include <linux/signal.h>
  9 #include <linux/sched.h>
 10 #include <linux/tracepoint.h>
 11 
 12 #define TP_STORE_SIGINFO(__entry, info)                         \
 13         do {                                                    \
 14                 if (info == SEND_SIG_NOINFO) {                  \
 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 {
 28         TRACE_SIGNAL_DELIVERED,
 29         TRACE_SIGNAL_IGNORED,
 30         TRACE_SIGNAL_ALREADY_PENDING,
 31         TRACE_SIGNAL_OVERFLOW_FAIL,
 32         TRACE_SIGNAL_LOSE_INFO,
 33 };
 34 #endif
 35 
 36 /**
 37  * signal_generate - called when a signal is generated
 38  * @sig: signal number
 39  * @info: pointer to struct siginfo
 40  * @task: pointer to struct task_struct
 41  * @group: shared or private
 42  * @result: TRACE_SIGNAL_*
 43  *
 44  * Current process sends a 'sig' signal to 'task' process with
 45  * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV,
 46  * 'info' is not a pointer and you can't access its field. Instead,
 47  * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV
 48  * means that si_code is SI_KERNEL.
 49  */
 50 TRACE_EVENT(signal_generate,
 51 
 52         TP_PROTO(int sig, struct kernel_siginfo *info, struct task_struct *task,
 53                         int group, int result),
 54 
 55         TP_ARGS(sig, info, task, group, result),
 56 
 57         TP_STRUCT__entry(
 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 
 67         TP_fast_assign(
 68                 __entry->sig    = sig;
 69                 TP_STORE_SIGINFO(__entry, info);
 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 
 82 /**
 83  * signal_deliver - called when a signal is delivered
 84  * @sig: signal number
 85  * @info: pointer to struct siginfo
 86  * @ka: pointer to struct k_sigaction
 87  *
 88  * A 'sig' signal is delivered to current process with 'info' siginfo,
 89  * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or
 90  * SIG_DFL.
 91  * Note that some signals reported by signal_generate tracepoint can be
 92  * lost, ignored or modified (by debugger) before hitting this tracepoint.
 93  * This means, this can show which signals are actually delivered, but
 94  * matching generated signals and delivered signals may not be correct.
 95  */
 96 TRACE_EVENT(signal_deliver,
 97 
 98         TP_PROTO(int sig, struct kernel_siginfo *info, struct k_sigaction *ka),
 99 
100         TP_ARGS(sig, info, ka),
101 
102         TP_STRUCT__entry(
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 
110         TP_fast_assign(
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>
126 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp