1 // SPDX-License-Identifier: LGPL-2.1
3 #include "trace/beauty/beauty.h"
4 #include <linux/kernel.h>
5 #include <uapi/linux/fcntl.h>
16 #define LOCK_WRITE 128
23 size_t syscall_arg__scnprintf_flock(char *bf
, size_t size
, struct syscall_arg
*arg
)
25 bool show_prefix
= arg
->show_string_prefix
;
26 const char *prefix
= "LOCK_";
27 int printed
= 0, op
= arg
->val
;
30 return scnprintf(bf
, size
, "NONE");
32 if ((op & LOCK_##cmd) == LOCK_##cmd) { \
33 printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #cmd); \
48 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", op
);