brcms_trace_events.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. #undef TRACE_SYSTEM
  17. #define TRACE_SYSTEM brcmsmac
  18. #if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ)
  19. #define __TRACE_BRCMSMAC_H
  20. #include <linux/tracepoint.h>
  21. #include "mac80211_if.h"
  22. #ifndef CONFIG_BRCMDBG
  23. #undef TRACE_EVENT
  24. #define TRACE_EVENT(name, proto, ...) \
  25. static inline void trace_ ## name(proto) {}
  26. #endif
  27. /*
  28. * We define a tracepoint, its arguments, its printk format and its
  29. * 'fast binary record' layout.
  30. */
  31. TRACE_EVENT(brcms_timer,
  32. /* TPPROTO is the prototype of the function called by this tracepoint */
  33. TP_PROTO(struct brcms_timer *t),
  34. /*
  35. * TPARGS(firstarg, p) are the parameters names, same as found in the
  36. * prototype.
  37. */
  38. TP_ARGS(t),
  39. /*
  40. * Fast binary tracing: define the trace record via TP_STRUCT__entry().
  41. * You can think about it like a regular C structure local variable
  42. * definition.
  43. */
  44. TP_STRUCT__entry(
  45. __field(uint, ms)
  46. __field(uint, set)
  47. __field(uint, periodic)
  48. ),
  49. TP_fast_assign(
  50. __entry->ms = t->ms;
  51. __entry->set = t->set;
  52. __entry->periodic = t->periodic;
  53. ),
  54. TP_printk(
  55. "ms=%u set=%u periodic=%u",
  56. __entry->ms, __entry->set, __entry->periodic
  57. )
  58. );
  59. TRACE_EVENT(brcms_dpc,
  60. TP_PROTO(unsigned long data),
  61. TP_ARGS(data),
  62. TP_STRUCT__entry(
  63. __field(unsigned long, data)
  64. ),
  65. TP_fast_assign(
  66. __entry->data = data;
  67. ),
  68. TP_printk(
  69. "data=%p",
  70. (void *)__entry->data
  71. )
  72. );
  73. #endif /* __TRACE_BRCMSMAC_H */
  74. #ifdef CONFIG_BRCMDBG
  75. #undef TRACE_INCLUDE_PATH
  76. #define TRACE_INCLUDE_PATH .
  77. #undef TRACE_INCLUDE_FILE
  78. #define TRACE_INCLUDE_FILE brcms_trace_events
  79. #include <trace/define_trace.h>
  80. #endif /* CONFIG_BRCMDBG */