xfs_btree_trace.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Copyright (c) 2008 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_BTREE_TRACE_H__
  19. #define __XFS_BTREE_TRACE_H__
  20. struct xfs_btree_cur;
  21. struct xfs_buf;
  22. /*
  23. * Trace hooks.
  24. * i,j = integer (32 bit)
  25. * b = btree block buffer (xfs_buf_t)
  26. * p = btree ptr
  27. * r = btree record
  28. * k = btree key
  29. */
  30. #ifdef XFS_BTREE_TRACE
  31. /*
  32. * Trace buffer entry types.
  33. */
  34. #define XFS_BTREE_KTRACE_ARGBI 1
  35. #define XFS_BTREE_KTRACE_ARGBII 2
  36. #define XFS_BTREE_KTRACE_ARGFFFI 3
  37. #define XFS_BTREE_KTRACE_ARGI 4
  38. #define XFS_BTREE_KTRACE_ARGIPK 5
  39. #define XFS_BTREE_KTRACE_ARGIPR 6
  40. #define XFS_BTREE_KTRACE_ARGIK 7
  41. #define XFS_BTREE_KTRACE_ARGR 8
  42. #define XFS_BTREE_KTRACE_CUR 9
  43. /*
  44. * Sub-types for cursor traces.
  45. */
  46. #define XBT_ARGS 0
  47. #define XBT_ENTRY 1
  48. #define XBT_ERROR 2
  49. #define XBT_EXIT 3
  50. void xfs_btree_trace_argbi(const char *, struct xfs_btree_cur *,
  51. struct xfs_buf *, int, int);
  52. void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *,
  53. struct xfs_buf *, int, int, int);
  54. void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int);
  55. void xfs_btree_trace_argipk(const char *, struct xfs_btree_cur *, int,
  56. union xfs_btree_ptr, union xfs_btree_key *, int);
  57. void xfs_btree_trace_argipr(const char *, struct xfs_btree_cur *, int,
  58. union xfs_btree_ptr, union xfs_btree_rec *, int);
  59. void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int,
  60. union xfs_btree_key *, int);
  61. void xfs_btree_trace_argr(const char *, struct xfs_btree_cur *,
  62. union xfs_btree_rec *, int);
  63. void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int);
  64. #define XFS_BTREE_TRACE_ARGBI(c, b, i) \
  65. xfs_btree_trace_argbi(__func__, c, b, i, __LINE__)
  66. #define XFS_BTREE_TRACE_ARGBII(c, b, i, j) \
  67. xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__)
  68. #define XFS_BTREE_TRACE_ARGI(c, i) \
  69. xfs_btree_trace_argi(__func__, c, i, __LINE__)
  70. #define XFS_BTREE_TRACE_ARGIPK(c, i, p, k) \
  71. xfs_btree_trace_argipk(__func__, c, i, p, k, __LINE__)
  72. #define XFS_BTREE_TRACE_ARGIPR(c, i, p, r) \
  73. xfs_btree_trace_argipr(__func__, c, i, p, r, __LINE__)
  74. #define XFS_BTREE_TRACE_ARGIK(c, i, k) \
  75. xfs_btree_trace_argik(__func__, c, i, k, __LINE__)
  76. #define XFS_BTREE_TRACE_ARGR(c, r) \
  77. xfs_btree_trace_argr(__func__, c, r, __LINE__)
  78. #define XFS_BTREE_TRACE_CURSOR(c, t) \
  79. xfs_btree_trace_cursor(__func__, c, t, __LINE__)
  80. #else
  81. #define XFS_BTREE_TRACE_ARGBI(c, b, i)
  82. #define XFS_BTREE_TRACE_ARGBII(c, b, i, j)
  83. #define XFS_BTREE_TRACE_ARGI(c, i)
  84. #define XFS_BTREE_TRACE_ARGIPK(c, i, p, s)
  85. #define XFS_BTREE_TRACE_ARGIPR(c, i, p, r)
  86. #define XFS_BTREE_TRACE_ARGIK(c, i, k)
  87. #define XFS_BTREE_TRACE_ARGR(c, r)
  88. #define XFS_BTREE_TRACE_CURSOR(c, t)
  89. #endif /* XFS_BTREE_TRACE */
  90. #endif /* __XFS_BTREE_TRACE_H__ */