1 // SPDX-License-Identifier: LGPL-2.1
5 * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
8 #include "trace/beauty/beauty.h"
9 #include <linux/kernel.h>
10 #include <sys/types.h>
11 #include <uapi/linux/fcntl.h>
12 #include <uapi/linux/stat.h>
14 size_t syscall_arg__scnprintf_statx_flags(char *bf
, size_t size
, struct syscall_arg
*arg
)
16 bool show_prefix
= arg
->show_string_prefix
;
17 const char *prefix
= "AT_";
18 int printed
= 0, flags
= arg
->val
;
21 return scnprintf(bf
, size
, "%s%s", show_prefix
? "AT_STATX_" : "", "SYNC_AS_STAT");
23 if (flags & AT_##n) { \
24 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
28 P_FLAG(SYMLINK_NOFOLLOW
);
30 P_FLAG(SYMLINK_FOLLOW
);
33 P_FLAG(STATX_FORCE_SYNC
);
34 P_FLAG(STATX_DONT_SYNC
);
39 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
44 size_t syscall_arg__scnprintf_statx_mask(char *bf
, size_t size
, struct syscall_arg
*arg
)
46 bool show_prefix
= arg
->show_string_prefix
;
47 const char *prefix
= "STATX_";
48 int printed
= 0, flags
= arg
->val
;
51 if (flags & STATX_##n) { \
52 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
53 flags &= ~STATX_##n; \
73 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);