trace.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) 2014 Christoph Hellwig.
  3. */
  4. #undef TRACE_SYSTEM
  5. #define TRACE_SYSTEM nfsd
  6. #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  7. #define _NFSD_TRACE_H
  8. #include <linux/tracepoint.h>
  9. #include "nfsfh.h"
  10. DECLARE_EVENT_CLASS(nfsd_io_class,
  11. TP_PROTO(struct svc_rqst *rqstp,
  12. struct svc_fh *fhp,
  13. loff_t offset,
  14. int len),
  15. TP_ARGS(rqstp, fhp, offset, len),
  16. TP_STRUCT__entry(
  17. __field(__be32, xid)
  18. __field_struct(struct knfsd_fh, fh)
  19. __field(loff_t, offset)
  20. __field(int, len)
  21. ),
  22. TP_fast_assign(
  23. __entry->xid = rqstp->rq_xid,
  24. fh_copy_shallow(&__entry->fh, &fhp->fh_handle);
  25. __entry->offset = offset;
  26. __entry->len = len;
  27. ),
  28. TP_printk("xid=0x%x fh=0x%x offset=%lld len=%d",
  29. __be32_to_cpu(__entry->xid), knfsd_fh_hash(&__entry->fh),
  30. __entry->offset, __entry->len)
  31. )
  32. #define DEFINE_NFSD_IO_EVENT(name) \
  33. DEFINE_EVENT(nfsd_io_class, name, \
  34. TP_PROTO(struct svc_rqst *rqstp, \
  35. struct svc_fh *fhp, \
  36. loff_t offset, \
  37. int len), \
  38. TP_ARGS(rqstp, fhp, offset, len))
  39. DEFINE_NFSD_IO_EVENT(read_start);
  40. DEFINE_NFSD_IO_EVENT(read_opened);
  41. DEFINE_NFSD_IO_EVENT(read_io_done);
  42. DEFINE_NFSD_IO_EVENT(read_done);
  43. DEFINE_NFSD_IO_EVENT(write_start);
  44. DEFINE_NFSD_IO_EVENT(write_opened);
  45. DEFINE_NFSD_IO_EVENT(write_io_done);
  46. DEFINE_NFSD_IO_EVENT(write_done);
  47. #include "state.h"
  48. DECLARE_EVENT_CLASS(nfsd_stateid_class,
  49. TP_PROTO(stateid_t *stp),
  50. TP_ARGS(stp),
  51. TP_STRUCT__entry(
  52. __field(u32, cl_boot)
  53. __field(u32, cl_id)
  54. __field(u32, si_id)
  55. __field(u32, si_generation)
  56. ),
  57. TP_fast_assign(
  58. __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
  59. __entry->cl_id = stp->si_opaque.so_clid.cl_id;
  60. __entry->si_id = stp->si_opaque.so_id;
  61. __entry->si_generation = stp->si_generation;
  62. ),
  63. TP_printk("client %08x:%08x stateid %08x:%08x",
  64. __entry->cl_boot,
  65. __entry->cl_id,
  66. __entry->si_id,
  67. __entry->si_generation)
  68. )
  69. #define DEFINE_STATEID_EVENT(name) \
  70. DEFINE_EVENT(nfsd_stateid_class, name, \
  71. TP_PROTO(stateid_t *stp), \
  72. TP_ARGS(stp))
  73. DEFINE_STATEID_EVENT(layoutstate_alloc);
  74. DEFINE_STATEID_EVENT(layoutstate_unhash);
  75. DEFINE_STATEID_EVENT(layoutstate_free);
  76. DEFINE_STATEID_EVENT(layout_get_lookup_fail);
  77. DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
  78. DEFINE_STATEID_EVENT(layout_return_lookup_fail);
  79. DEFINE_STATEID_EVENT(layout_recall);
  80. DEFINE_STATEID_EVENT(layout_recall_done);
  81. DEFINE_STATEID_EVENT(layout_recall_fail);
  82. DEFINE_STATEID_EVENT(layout_recall_release);
  83. #endif /* _NFSD_TRACE_H */
  84. #undef TRACE_INCLUDE_PATH
  85. #define TRACE_INCLUDE_PATH .
  86. #define TRACE_INCLUDE_FILE trace
  87. #include <trace/define_trace.h>