iscsi.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM iscsi
  3. #if !defined(_TRACE_ISCSI_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_ISCSI_H
  5. #include <linux/tracepoint.h>
  6. /* max debug message length */
  7. #define ISCSI_MSG_MAX 256
  8. /*
  9. * Declare tracepoint helper function.
  10. */
  11. void iscsi_dbg_trace(void (*trace)(struct device *dev, struct va_format *),
  12. struct device *dev, const char *fmt, ...);
  13. /*
  14. * Declare event class for iscsi debug messages.
  15. */
  16. DECLARE_EVENT_CLASS(iscsi_log_msg,
  17. TP_PROTO(struct device *dev, struct va_format *vaf),
  18. TP_ARGS(dev, vaf),
  19. TP_STRUCT__entry(
  20. __string(dname, dev_name(dev) )
  21. __vstring(msg, vaf->fmt, vaf->va)
  22. ),
  23. TP_fast_assign(
  24. __assign_str(dname);
  25. __assign_vstr(msg, vaf->fmt, vaf->va);
  26. ),
  27. TP_printk("%s: %s",__get_str(dname), __get_str(msg)
  28. )
  29. );
  30. /*
  31. * Define event to capture iscsi connection debug messages.
  32. */
  33. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_conn,
  34. TP_PROTO(struct device *dev, struct va_format *vaf),
  35. TP_ARGS(dev, vaf)
  36. );
  37. /*
  38. * Define event to capture iscsi session debug messages.
  39. */
  40. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_session,
  41. TP_PROTO(struct device *dev, struct va_format *vaf),
  42. TP_ARGS(dev, vaf)
  43. );
  44. /*
  45. * Define event to capture iscsi error handling debug messages.
  46. */
  47. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_eh,
  48. TP_PROTO(struct device *dev, struct va_format *vaf),
  49. TP_ARGS(dev, vaf)
  50. );
  51. /*
  52. * Define event to capture iscsi tcp debug messages.
  53. */
  54. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_tcp,
  55. TP_PROTO(struct device *dev, struct va_format *vaf),
  56. TP_ARGS(dev, vaf)
  57. );
  58. /*
  59. * Define event to capture iscsi sw tcp debug messages.
  60. */
  61. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_sw_tcp,
  62. TP_PROTO(struct device *dev, struct va_format *vaf),
  63. TP_ARGS(dev, vaf)
  64. );
  65. /*
  66. * Define event to capture iscsi transport session debug messages.
  67. */
  68. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_trans_session,
  69. TP_PROTO(struct device *dev, struct va_format *vaf),
  70. TP_ARGS(dev, vaf)
  71. );
  72. /*
  73. * Define event to capture iscsi transport connection debug messages.
  74. */
  75. DEFINE_EVENT(iscsi_log_msg, iscsi_dbg_trans_conn,
  76. TP_PROTO(struct device *dev, struct va_format *vaf),
  77. TP_ARGS(dev, vaf)
  78. );
  79. #endif /* _TRACE_ISCSI_H */
  80. /* This part must be outside protection */
  81. #include <trace/define_trace.h>