Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / perf / trace / beauty / waitid_options.c
blob7942724adec8b7778371a14f09a6f9e76da78de9
1 #include <sys/types.h>
2 #include <sys/wait.h>
4 static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size,
5 struct syscall_arg *arg)
7 int printed = 0, options = arg->val;
9 #define P_OPTION(n) \
10 if (options & W##n) { \
11 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
12 options &= ~W##n; \
15 P_OPTION(NOHANG);
16 P_OPTION(UNTRACED);
17 P_OPTION(CONTINUED);
18 #undef P_OPTION
20 if (options)
21 printed += scnprintf(bf + printed, size - printed, "%s%#x", printed ? "|" : "", options);
23 return printed;
26 #define SCA_WAITID_OPTIONS syscall_arg__scnprintf_waitid_options