trace.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * trace.h - Slimbus Controller Trace Support
  4. *
  5. * Copyright (C) 2021, The Linux Foundation. All rights reserved.
  6. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  7. *
  8. */
  9. #undef TRACE_SYSTEM
  10. #define TRACE_SYSTEM slimbus
  11. #if !defined(__SLIMBUS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  12. #define __SLIMBUS_TRACE_H
  13. #include <linux/types.h>
  14. #include <linux/tracepoint.h>
  15. #include <asm/byteorder.h>
  16. #define MAX_MSG_LEN 100
  17. TRACE_EVENT(slimbus_dbg,
  18. TP_PROTO(const char *func, struct va_format *vaf),
  19. TP_ARGS(func, vaf),
  20. TP_STRUCT__entry(
  21. __string(func, func)
  22. __dynamic_array(char, msg, MAX_MSG_LEN)
  23. ),
  24. TP_fast_assign(
  25. __assign_str(func, func);
  26. WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
  27. MAX_MSG_LEN, vaf->fmt,
  28. *vaf->va) >= MAX_MSG_LEN);
  29. ),
  30. TP_printk("%s: %s", __get_str(func), __get_str(msg))
  31. );
  32. #endif /* __SLIMBUS_TRACE_H */
  33. /* this part has to be here */
  34. #undef TRACE_INCLUDE_PATH
  35. #define TRACE_INCLUDE_PATH .
  36. #undef TRACE_INCLUDE_FILE
  37. #define TRACE_INCLUDE_FILE trace
  38. /* This part must be outside protection */
  39. #include <trace/define_trace.h>