]>
git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blob - tools/perf/trace/beauty/seccomp.c
1 #ifndef SECCOMP_SET_MODE_STRICT
2 #define SECCOMP_SET_MODE_STRICT 0
4 #ifndef SECCOMP_SET_MODE_FILTER
5 #define SECCOMP_SET_MODE_FILTER 1
8 static size_t syscall_arg__scnprintf_seccomp_op(char *bf
, size_t size
, struct syscall_arg
*arg
)
14 #define P_SECCOMP_SET_MODE_OP(n) case SECCOMP_SET_MODE_##n: printed = scnprintf(bf, size, #n); break
15 P_SECCOMP_SET_MODE_OP(STRICT
);
16 P_SECCOMP_SET_MODE_OP(FILTER
);
17 #undef P_SECCOMP_SET_MODE_OP
18 default: printed
= scnprintf(bf
, size
, "%#x", op
); break;
24 #define SCA_SECCOMP_OP syscall_arg__scnprintf_seccomp_op
26 #ifndef SECCOMP_FILTER_FLAG_TSYNC
27 #define SECCOMP_FILTER_FLAG_TSYNC 1
30 static size_t syscall_arg__scnprintf_seccomp_flags(char *bf
, size_t size
,
31 struct syscall_arg
*arg
)
33 int printed
= 0, flags
= arg
->val
;
36 if (flags & SECCOMP_FILTER_FLAG_##n) { \
37 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
38 flags &= ~SECCOMP_FILTER_FLAG_##n; \
45 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
50 #define SCA_SECCOMP_FLAGS syscall_arg__scnprintf_seccomp_flags