brcms_trace_brcmsmac.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (c) 2011 Broadcom Corporation
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ)
  17. #define __TRACE_BRCMSMAC_H
  18. #include <linux/tracepoint.h>
  19. #undef TRACE_SYSTEM
  20. #define TRACE_SYSTEM brcmsmac
  21. /*
  22. * We define a tracepoint, its arguments, its printk format and its
  23. * 'fast binary record' layout.
  24. */
  25. TRACE_EVENT(brcms_timer,
  26. /* TPPROTO is the prototype of the function called by this tracepoint */
  27. TP_PROTO(struct brcms_timer *t),
  28. /*
  29. * TPARGS(firstarg, p) are the parameters names, same as found in the
  30. * prototype.
  31. */
  32. TP_ARGS(t),
  33. /*
  34. * Fast binary tracing: define the trace record via TP_STRUCT__entry().
  35. * You can think about it like a regular C structure local variable
  36. * definition.
  37. */
  38. TP_STRUCT__entry(
  39. __field(uint, ms)
  40. __field(uint, set)
  41. __field(uint, periodic)
  42. ),
  43. TP_fast_assign(
  44. __entry->ms = t->ms;
  45. __entry->set = t->set;
  46. __entry->periodic = t->periodic;
  47. ),
  48. TP_printk(
  49. "ms=%u set=%u periodic=%u",
  50. __entry->ms, __entry->set, __entry->periodic
  51. )
  52. );
  53. TRACE_EVENT(brcms_dpc,
  54. TP_PROTO(unsigned long data),
  55. TP_ARGS(data),
  56. TP_STRUCT__entry(
  57. __field(unsigned long, data)
  58. ),
  59. TP_fast_assign(
  60. __entry->data = data;
  61. ),
  62. TP_printk(
  63. "data=%p",
  64. (void *)__entry->data
  65. )
  66. );
  67. TRACE_EVENT(brcms_macintstatus,
  68. TP_PROTO(const struct device *dev, int in_isr, u32 macintstatus,
  69. u32 mask),
  70. TP_ARGS(dev, in_isr, macintstatus, mask),
  71. TP_STRUCT__entry(
  72. __string(dev, dev_name(dev))
  73. __field(int, in_isr)
  74. __field(u32, macintstatus)
  75. __field(u32, mask)
  76. ),
  77. TP_fast_assign(
  78. __assign_str(dev, dev_name(dev));
  79. __entry->in_isr = in_isr;
  80. __entry->macintstatus = macintstatus;
  81. __entry->mask = mask;
  82. ),
  83. TP_printk("[%s] in_isr=%d macintstatus=%#x mask=%#x", __get_str(dev),
  84. __entry->in_isr, __entry->macintstatus, __entry->mask)
  85. );
  86. #endif /* __TRACE_BRCMSMAC_H */
  87. #ifdef CONFIG_BRCM_TRACING
  88. #undef TRACE_INCLUDE_PATH
  89. #define TRACE_INCLUDE_PATH .
  90. #undef TRACE_INCLUDE_FILE
  91. #define TRACE_INCLUDE_FILE brcms_trace_brcmsmac
  92. #include <trace/define_trace.h>
  93. #endif /* CONFIG_BRCM_TRACING */