4 * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
6 * Released under the GPL v2. (and only v2, not any later version)
9 #include "trace/beauty/beauty.h"
10 #include <linux/kernel.h>
11 #include <sys/types.h>
12 #include <uapi/linux/fcntl.h>
13 #include <uapi/linux/stat.h>
15 size_t syscall_arg__scnprintf_statx_flags(char *bf
, size_t size
, struct syscall_arg
*arg
)
17 int printed
= 0, flags
= arg
->val
;
20 return scnprintf(bf
, size
, "SYNC_AS_STAT");
22 if (flags & AT_##n) { \
23 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
27 P_FLAG(SYMLINK_NOFOLLOW
);
29 P_FLAG(SYMLINK_FOLLOW
);
32 P_FLAG(STATX_FORCE_SYNC
);
33 P_FLAG(STATX_DONT_SYNC
);
38 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
43 size_t syscall_arg__scnprintf_statx_mask(char *bf
, size_t size
, struct syscall_arg
*arg
)
45 int printed
= 0, flags
= arg
->val
;
48 if (flags & STATX_##n) { \
49 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
50 flags &= ~STATX_##n; \
69 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);