fuse_trace.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM fuse
  4. #if !defined(_TRACE_FUSE_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_FUSE_H
  6. #include <linux/tracepoint.h>
  7. #define OPCODES \
  8. EM( FUSE_LOOKUP, "FUSE_LOOKUP") \
  9. EM( FUSE_FORGET, "FUSE_FORGET") \
  10. EM( FUSE_GETATTR, "FUSE_GETATTR") \
  11. EM( FUSE_SETATTR, "FUSE_SETATTR") \
  12. EM( FUSE_READLINK, "FUSE_READLINK") \
  13. EM( FUSE_SYMLINK, "FUSE_SYMLINK") \
  14. EM( FUSE_MKNOD, "FUSE_MKNOD") \
  15. EM( FUSE_MKDIR, "FUSE_MKDIR") \
  16. EM( FUSE_UNLINK, "FUSE_UNLINK") \
  17. EM( FUSE_RMDIR, "FUSE_RMDIR") \
  18. EM( FUSE_RENAME, "FUSE_RENAME") \
  19. EM( FUSE_LINK, "FUSE_LINK") \
  20. EM( FUSE_OPEN, "FUSE_OPEN") \
  21. EM( FUSE_READ, "FUSE_READ") \
  22. EM( FUSE_WRITE, "FUSE_WRITE") \
  23. EM( FUSE_STATFS, "FUSE_STATFS") \
  24. EM( FUSE_RELEASE, "FUSE_RELEASE") \
  25. EM( FUSE_FSYNC, "FUSE_FSYNC") \
  26. EM( FUSE_SETXATTR, "FUSE_SETXATTR") \
  27. EM( FUSE_GETXATTR, "FUSE_GETXATTR") \
  28. EM( FUSE_LISTXATTR, "FUSE_LISTXATTR") \
  29. EM( FUSE_REMOVEXATTR, "FUSE_REMOVEXATTR") \
  30. EM( FUSE_FLUSH, "FUSE_FLUSH") \
  31. EM( FUSE_INIT, "FUSE_INIT") \
  32. EM( FUSE_OPENDIR, "FUSE_OPENDIR") \
  33. EM( FUSE_READDIR, "FUSE_READDIR") \
  34. EM( FUSE_RELEASEDIR, "FUSE_RELEASEDIR") \
  35. EM( FUSE_FSYNCDIR, "FUSE_FSYNCDIR") \
  36. EM( FUSE_GETLK, "FUSE_GETLK") \
  37. EM( FUSE_SETLK, "FUSE_SETLK") \
  38. EM( FUSE_SETLKW, "FUSE_SETLKW") \
  39. EM( FUSE_ACCESS, "FUSE_ACCESS") \
  40. EM( FUSE_CREATE, "FUSE_CREATE") \
  41. EM( FUSE_INTERRUPT, "FUSE_INTERRUPT") \
  42. EM( FUSE_BMAP, "FUSE_BMAP") \
  43. EM( FUSE_DESTROY, "FUSE_DESTROY") \
  44. EM( FUSE_IOCTL, "FUSE_IOCTL") \
  45. EM( FUSE_POLL, "FUSE_POLL") \
  46. EM( FUSE_NOTIFY_REPLY, "FUSE_NOTIFY_REPLY") \
  47. EM( FUSE_BATCH_FORGET, "FUSE_BATCH_FORGET") \
  48. EM( FUSE_FALLOCATE, "FUSE_FALLOCATE") \
  49. EM( FUSE_READDIRPLUS, "FUSE_READDIRPLUS") \
  50. EM( FUSE_RENAME2, "FUSE_RENAME2") \
  51. EM( FUSE_LSEEK, "FUSE_LSEEK") \
  52. EM( FUSE_COPY_FILE_RANGE, "FUSE_COPY_FILE_RANGE") \
  53. EM( FUSE_SETUPMAPPING, "FUSE_SETUPMAPPING") \
  54. EM( FUSE_REMOVEMAPPING, "FUSE_REMOVEMAPPING") \
  55. EM( FUSE_SYNCFS, "FUSE_SYNCFS") \
  56. EM( FUSE_TMPFILE, "FUSE_TMPFILE") \
  57. EM( FUSE_STATX, "FUSE_STATX") \
  58. EMe(CUSE_INIT, "CUSE_INIT")
  59. /*
  60. * This will turn the above table into TRACE_DEFINE_ENUM() for each of the
  61. * entries.
  62. */
  63. #undef EM
  64. #undef EMe
  65. #define EM(a, b) TRACE_DEFINE_ENUM(a);
  66. #define EMe(a, b) TRACE_DEFINE_ENUM(a);
  67. OPCODES
  68. /* Now we redfine it with the table that __print_symbolic needs. */
  69. #undef EM
  70. #undef EMe
  71. #define EM(a, b) {a, b},
  72. #define EMe(a, b) {a, b}
  73. TRACE_EVENT(fuse_request_send,
  74. TP_PROTO(const struct fuse_req *req),
  75. TP_ARGS(req),
  76. TP_STRUCT__entry(
  77. __field(dev_t, connection)
  78. __field(uint64_t, unique)
  79. __field(enum fuse_opcode, opcode)
  80. __field(uint32_t, len)
  81. ),
  82. TP_fast_assign(
  83. __entry->connection = req->fm->fc->dev;
  84. __entry->unique = req->in.h.unique;
  85. __entry->opcode = req->in.h.opcode;
  86. __entry->len = req->in.h.len;
  87. ),
  88. TP_printk("connection %u req %llu opcode %u (%s) len %u ",
  89. __entry->connection, __entry->unique, __entry->opcode,
  90. __print_symbolic(__entry->opcode, OPCODES), __entry->len)
  91. );
  92. TRACE_EVENT(fuse_request_end,
  93. TP_PROTO(const struct fuse_req *req),
  94. TP_ARGS(req),
  95. TP_STRUCT__entry(
  96. __field(dev_t, connection)
  97. __field(uint64_t, unique)
  98. __field(uint32_t, len)
  99. __field(int32_t, error)
  100. ),
  101. TP_fast_assign(
  102. __entry->connection = req->fm->fc->dev;
  103. __entry->unique = req->in.h.unique;
  104. __entry->len = req->out.h.len;
  105. __entry->error = req->out.h.error;
  106. ),
  107. TP_printk("connection %u req %llu len %u error %d", __entry->connection,
  108. __entry->unique, __entry->len, __entry->error)
  109. );
  110. #endif /* _TRACE_FUSE_H */
  111. #undef TRACE_INCLUDE_PATH
  112. #define TRACE_INCLUDE_PATH .
  113. #define TRACE_INCLUDE_FILE fuse_trace
  114. #include <trace/define_trace.h>