Linux Perf
waitid_options.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0
2 #include <sys/types.h>
3 #include <sys/wait.h>
4 
5 static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size,
6  struct syscall_arg *arg)
7 {
8  int printed = 0, options = arg->val;
9 
10 #define P_OPTION(n) \
11  if (options & W##n) { \
12  printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
13  options &= ~W##n; \
14  }
15 
16  P_OPTION(NOHANG);
17  P_OPTION(UNTRACED);
18  P_OPTION(CONTINUED);
19 #undef P_OPTION
20 
21  if (options)
22  printed += scnprintf(bf + printed, size - printed, "%s%#x", printed ? "|" : "", options);
23 
24  return printed;
25 }
26 
27 #define SCA_WAITID_OPTIONS syscall_arg__scnprintf_waitid_options
size_t size
Definition: evsel.c:60
Definition: genelf.c:61
#define P_OPTION(n)
unsigned long val
Definition: beauty.h:44
static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size, struct syscall_arg *arg)
Definition: waitid_options.c:5