Linux Perf
signum.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0
2 #include <signal.h>
3 
4 static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg)
5 {
6  int sig = arg->val;
7 
8  switch (sig) {
9 #define P_SIGNUM(n) case SIG##n: return scnprintf(bf, size, #n)
10  P_SIGNUM(HUP);
11  P_SIGNUM(INT);
12  P_SIGNUM(QUIT);
13  P_SIGNUM(ILL);
14  P_SIGNUM(TRAP);
15  P_SIGNUM(ABRT);
16  P_SIGNUM(BUS);
17  P_SIGNUM(FPE);
18  P_SIGNUM(KILL);
19  P_SIGNUM(USR1);
20  P_SIGNUM(SEGV);
21  P_SIGNUM(USR2);
22  P_SIGNUM(PIPE);
23  P_SIGNUM(ALRM);
24  P_SIGNUM(TERM);
25  P_SIGNUM(CHLD);
26  P_SIGNUM(CONT);
27  P_SIGNUM(STOP);
28  P_SIGNUM(TSTP);
29  P_SIGNUM(TTIN);
30  P_SIGNUM(TTOU);
31  P_SIGNUM(URG);
32  P_SIGNUM(XCPU);
33  P_SIGNUM(XFSZ);
34  P_SIGNUM(VTALRM);
35  P_SIGNUM(PROF);
36  P_SIGNUM(WINCH);
37  P_SIGNUM(IO);
38  P_SIGNUM(PWR);
39  P_SIGNUM(SYS);
40 #ifdef SIGEMT
41  P_SIGNUM(EMT);
42 #endif
43 #ifdef SIGSTKFLT
44  P_SIGNUM(STKFLT);
45 #endif
46 #ifdef SIGSWI
47  P_SIGNUM(SWI);
48 #endif
49  default: break;
50  }
51 
52  return scnprintf(bf, size, "%#x", sig);
53 }
54 
55 #define SCA_SIGNUM syscall_arg__scnprintf_signum
#define P_SIGNUM(n)
size_t size
Definition: evsel.c:60
static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg)
Definition: signum.c:4
unsigned long val
Definition: beauty.h:44