trace.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #ifdef CONFIG_MAC80211_MESSAGE_TRACING
  11. void __sdata_info(const char *fmt, ...)
  12. {
  13. struct va_format vaf = {
  14. .fmt = fmt,
  15. };
  16. va_list args;
  17. va_start(args, fmt);
  18. vaf.va = &args;
  19. pr_info("%pV", &vaf);
  20. trace_mac80211_info(&vaf);
  21. va_end(args);
  22. }
  23. void __sdata_dbg(bool print, const char *fmt, ...)
  24. {
  25. struct va_format vaf = {
  26. .fmt = fmt,
  27. };
  28. va_list args;
  29. va_start(args, fmt);
  30. vaf.va = &args;
  31. if (print)
  32. pr_debug("%pV", &vaf);
  33. trace_mac80211_dbg(&vaf);
  34. va_end(args);
  35. }
  36. void __sdata_err(const char *fmt, ...)
  37. {
  38. struct va_format vaf = {
  39. .fmt = fmt,
  40. };
  41. va_list args;
  42. va_start(args, fmt);
  43. vaf.va = &args;
  44. pr_err("%pV", &vaf);
  45. trace_mac80211_err(&vaf);
  46. va_end(args);
  47. }
  48. void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
  49. {
  50. struct va_format vaf = {
  51. .fmt = fmt,
  52. };
  53. va_list args;
  54. va_start(args, fmt);
  55. vaf.va = &args;
  56. if (print)
  57. wiphy_dbg(wiphy, "%pV", &vaf);
  58. trace_mac80211_dbg(&vaf);
  59. va_end(args);
  60. }
  61. #endif
  62. #endif