trace.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* bug in tracepoint.h, it should include this */
  2. #include <linux/module.h>
  3. /* sparse isn't too happy with all macros... */
  4. #ifndef __CHECKER__
  5. #include <net/cfg80211.h>
  6. #include "driver-ops.h"
  7. #include "debug.h"
  8. #define CREATE_TRACE_POINTS
  9. #include "trace.h"
  10. #include "trace_msg.h"
  11. #ifdef CONFIG_MAC80211_MESSAGE_TRACING
  12. void __sdata_info(const char *fmt, ...)
  13. {
  14. struct va_format vaf = {
  15. .fmt = fmt,
  16. };
  17. va_list args;
  18. va_start(args, fmt);
  19. vaf.va = &args;
  20. pr_info("%pV", &vaf);
  21. trace_mac80211_info(&vaf);
  22. va_end(args);
  23. }
  24. void __sdata_dbg(bool print, const char *fmt, ...)
  25. {
  26. struct va_format vaf = {
  27. .fmt = fmt,
  28. };
  29. va_list args;
  30. va_start(args, fmt);
  31. vaf.va = &args;
  32. if (print)
  33. pr_debug("%pV", &vaf);
  34. trace_mac80211_dbg(&vaf);
  35. va_end(args);
  36. }
  37. void __sdata_err(const char *fmt, ...)
  38. {
  39. struct va_format vaf = {
  40. .fmt = fmt,
  41. };
  42. va_list args;
  43. va_start(args, fmt);
  44. vaf.va = &args;
  45. pr_err("%pV", &vaf);
  46. trace_mac80211_err(&vaf);
  47. va_end(args);
  48. }
  49. void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
  50. {
  51. struct va_format vaf = {
  52. .fmt = fmt,
  53. };
  54. va_list args;
  55. va_start(args, fmt);
  56. vaf.va = &args;
  57. if (print)
  58. wiphy_dbg(wiphy, "%pV", &vaf);
  59. trace_mac80211_dbg(&vaf);
  60. va_end(args);
  61. }
  62. #endif
  63. #endif