[Virtio-fs] [PATCH v2 1/3] fuse: add some macros for ftrace
Masayoshi Mizuma
msys.mizuma at gmail.com
Wed Aug 21 04:40:12 UTC 2019
From: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Add some macros for ftrace. These macros is useful for generic fuse.
Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
---
include/trace/events/fuse_common.h | 67 ++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 include/trace/events/fuse_common.h
diff --git a/include/trace/events/fuse_common.h b/include/trace/events/fuse_common.h
new file mode 100644
index 000000000..0805ec4ab
--- /dev/null
+++ b/include/trace/events/fuse_common.h
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <uapi/linux/fuse.h>
+
+#define fuse_opcode_name(opcode) { opcode, #opcode }
+#define show_opcode_name(val) \
+ __print_symbolic(val, \
+ fuse_opcode_name(FUSE_LOOKUP), \
+ fuse_opcode_name(FUSE_FORGET), \
+ fuse_opcode_name(FUSE_GETATTR), \
+ fuse_opcode_name(FUSE_SETATTR), \
+ fuse_opcode_name(FUSE_READLINK), \
+ fuse_opcode_name(FUSE_SYMLINK), \
+ fuse_opcode_name(FUSE_MKNOD), \
+ fuse_opcode_name(FUSE_MKDIR), \
+ fuse_opcode_name(FUSE_UNLINK), \
+ fuse_opcode_name(FUSE_RMDIR), \
+ fuse_opcode_name(FUSE_RENAME), \
+ fuse_opcode_name(FUSE_LINK), \
+ fuse_opcode_name(FUSE_OPEN), \
+ fuse_opcode_name(FUSE_READ), \
+ fuse_opcode_name(FUSE_WRITE), \
+ fuse_opcode_name(FUSE_STATFS), \
+ fuse_opcode_name(FUSE_RELEASE), \
+ fuse_opcode_name(FUSE_FSYNC), \
+ fuse_opcode_name(FUSE_SETXATTR), \
+ fuse_opcode_name(FUSE_GETXATTR), \
+ fuse_opcode_name(FUSE_LISTXATTR), \
+ fuse_opcode_name(FUSE_REMOVEXATTR), \
+ fuse_opcode_name(FUSE_FLUSH), \
+ fuse_opcode_name(FUSE_INIT), \
+ fuse_opcode_name(FUSE_OPENDIR), \
+ fuse_opcode_name(FUSE_READDIR), \
+ fuse_opcode_name(FUSE_RELEASEDIR), \
+ fuse_opcode_name(FUSE_FSYNCDIR), \
+ fuse_opcode_name(FUSE_GETLK), \
+ fuse_opcode_name(FUSE_SETLK), \
+ fuse_opcode_name(FUSE_SETLKW), \
+ fuse_opcode_name(FUSE_ACCESS), \
+ fuse_opcode_name(FUSE_CREATE), \
+ fuse_opcode_name(FUSE_INTERRUPT), \
+ fuse_opcode_name(FUSE_BMAP), \
+ fuse_opcode_name(FUSE_DESTROY), \
+ fuse_opcode_name(FUSE_IOCTL), \
+ fuse_opcode_name(FUSE_POLL), \
+ fuse_opcode_name(FUSE_NOTIFY_REPLY), \
+ fuse_opcode_name(FUSE_BATCH_FORGET), \
+ fuse_opcode_name(FUSE_FALLOCATE), \
+ fuse_opcode_name(FUSE_READDIRPLUS), \
+ fuse_opcode_name(FUSE_RENAME2), \
+ fuse_opcode_name(FUSE_LSEEK), \
+ fuse_opcode_name(FUSE_COPY_FILE_RANGE), \
+ fuse_opcode_name(FUSE_SETUPMAPPING), \
+ fuse_opcode_name(FUSE_REMOVEMAPPING))
+
+#define show_req_flag(flags) __print_flags(flags, "|", \
+ { (1UL << FR_ISREPLY), "ISREPLY"}, \
+ { (1UL << FR_FORCE), "FORCE"}, \
+ { (1UL << FR_BACKGROUND), "BACKGROUND"}, \
+ { (1UL << FR_WAITING), "WAITING"}, \
+ { (1UL << FR_ABORTED), "ABORTED"}, \
+ { (1UL << FR_INTERRUPTED), "INTERRUPTED"}, \
+ { (1UL << FR_LOCKED), "LOCKED"}, \
+ { (1UL << FR_PENDING), "PENDING"}, \
+ { (1UL << FR_SENT), "SENT"}, \
+ { (1UL << FR_FINISHED), "FINISHED"}, \
+ { (1UL << FR_PRIVATE), "PRIVATE"})
--
2.18.1
More information about the Virtio-fs
mailing list