trace.c 1.3 KB

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