hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/tools/perf/trace/beauty/seccomp.c
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+// SPDX-License-Identifier: LGPL-2.1
22 #ifndef SECCOMP_SET_MODE_STRICT
33 #define SECCOMP_SET_MODE_STRICT 0
44 #endif
....@@ -8,11 +8,13 @@
88
99 static size_t syscall_arg__scnprintf_seccomp_op(char *bf, size_t size, struct syscall_arg *arg)
1010 {
11
+ bool show_prefix = arg->show_string_prefix;
12
+ const char *prefix = "SECCOMP_SET_MODE_";
1113 int op = arg->val;
1214 size_t printed = 0;
1315
1416 switch (op) {
15
-#define P_SECCOMP_SET_MODE_OP(n) case SECCOMP_SET_MODE_##n: printed = scnprintf(bf, size, #n); break
17
+#define P_SECCOMP_SET_MODE_OP(n) case SECCOMP_SET_MODE_##n: printed = scnprintf(bf, size, "%s%s", show_prefix ? prefix : "", #n); break
1618 P_SECCOMP_SET_MODE_OP(STRICT);
1719 P_SECCOMP_SET_MODE_OP(FILTER);
1820 #undef P_SECCOMP_SET_MODE_OP
....@@ -31,11 +33,13 @@
3133 static size_t syscall_arg__scnprintf_seccomp_flags(char *bf, size_t size,
3234 struct syscall_arg *arg)
3335 {
36
+ bool show_prefix = arg->show_string_prefix;
37
+ const char *prefix = "SECCOMP_FILTER_FLAG_";
3438 int printed = 0, flags = arg->val;
3539
3640 #define P_FLAG(n) \
3741 if (flags & SECCOMP_FILTER_FLAG_##n) { \
38
- printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
42
+ printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
3943 flags &= ~SECCOMP_FILTER_FLAG_##n; \
4044 }
4145