]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - tools/perf/trace/beauty/signum.c
Merge tag 'for-4.12/dm-post-merge-changes' of git://git.kernel.org/pub/scm/linux...
[mirror_ubuntu-artful-kernel.git] / tools / perf / trace / beauty / signum.c
1 #include <signal.h>
2
3 static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg)
4 {
5 int sig = arg->val;
6
7 switch (sig) {
8 #define P_SIGNUM(n) case SIG##n: return scnprintf(bf, size, #n)
9 P_SIGNUM(HUP);
10 P_SIGNUM(INT);
11 P_SIGNUM(QUIT);
12 P_SIGNUM(ILL);
13 P_SIGNUM(TRAP);
14 P_SIGNUM(ABRT);
15 P_SIGNUM(BUS);
16 P_SIGNUM(FPE);
17 P_SIGNUM(KILL);
18 P_SIGNUM(USR1);
19 P_SIGNUM(SEGV);
20 P_SIGNUM(USR2);
21 P_SIGNUM(PIPE);
22 P_SIGNUM(ALRM);
23 P_SIGNUM(TERM);
24 P_SIGNUM(CHLD);
25 P_SIGNUM(CONT);
26 P_SIGNUM(STOP);
27 P_SIGNUM(TSTP);
28 P_SIGNUM(TTIN);
29 P_SIGNUM(TTOU);
30 P_SIGNUM(URG);
31 P_SIGNUM(XCPU);
32 P_SIGNUM(XFSZ);
33 P_SIGNUM(VTALRM);
34 P_SIGNUM(PROF);
35 P_SIGNUM(WINCH);
36 P_SIGNUM(IO);
37 P_SIGNUM(PWR);
38 P_SIGNUM(SYS);
39 #ifdef SIGEMT
40 P_SIGNUM(EMT);
41 #endif
42 #ifdef SIGSTKFLT
43 P_SIGNUM(STKFLT);
44 #endif
45 #ifdef SIGSWI
46 P_SIGNUM(SWI);
47 #endif
48 default: break;
49 }
50
51 return scnprintf(bf, size, "%#x", sig);
52 }
53
54 #define SCA_SIGNUM syscall_arg__scnprintf_signum