trace-crm.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #if !defined(_TRACE_CRM_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_CRM_H
  7. #undef TRACE_SYSTEM
  8. #define TRACE_SYSTEM crm
  9. #include <linux/tracepoint.h>
  10. #include <soc/qcom/crm.h>
  11. DECLARE_EVENT_CLASS(crm_vcd_votes,
  12. TP_PROTO(const char *name, u32 vcd_type, u32 resource_idx, u32 pwr_state, u32 data),
  13. TP_ARGS(name, vcd_type, resource_idx, pwr_state, data),
  14. TP_STRUCT__entry(
  15. __string(name, name)
  16. __field(u32, vcd_type)
  17. __field(u32, resource_idx)
  18. __field(u32, pwr_state)
  19. __field(u32, data)
  20. ),
  21. TP_fast_assign(
  22. __assign_str(name, name);
  23. __entry->vcd_type = vcd_type;
  24. __entry->resource_idx = resource_idx;
  25. __entry->pwr_state = pwr_state;
  26. __entry->data = data;
  27. ),
  28. TP_printk("%s: vcd_type: %u resource_idx: %u pwr_state: %u data: %#x",
  29. __get_str(name), __entry->vcd_type, __entry->resource_idx,
  30. __entry->pwr_state, __entry->data)
  31. );
  32. DEFINE_EVENT(crm_vcd_votes, crm_cache_vcd_votes,
  33. TP_PROTO(const char *name, u32 vcd_type, u32 resource_idx, u32 pwr_state, u32 data),
  34. TP_ARGS(name, vcd_type, resource_idx, pwr_state, data)
  35. );
  36. DEFINE_EVENT(crm_vcd_votes, crm_write_vcd_votes,
  37. TP_PROTO(const char *name, u32 vcd_type, u32 resource_idx, u32 pwr_state, u32 data),
  38. TP_ARGS(name, vcd_type, resource_idx, pwr_state, data)
  39. );
  40. TRACE_EVENT(crm_irq,
  41. TP_PROTO(const char *name, u32 vcd_type, u32 resource_idx, unsigned long irq_status),
  42. TP_ARGS(name, vcd_type, resource_idx, irq_status),
  43. TP_STRUCT__entry(
  44. __string(name, name)
  45. __field(u32, vcd_type)
  46. __field(u32, resource_idx)
  47. __field(unsigned long, irq_status)
  48. ),
  49. TP_fast_assign(
  50. __assign_str(name, name);
  51. __entry->vcd_type = vcd_type;
  52. __entry->resource_idx = resource_idx;
  53. __entry->irq_status = irq_status;
  54. ),
  55. TP_printk("%s: IRQ vcd_type: %u resource_idx: %u irq_status: %lu",
  56. __get_str(name), __entry->vcd_type, __entry->resource_idx,
  57. __entry->irq_status)
  58. );
  59. TRACE_EVENT(crm_switch_channel,
  60. TP_PROTO(const char *name, int ch, int ret),
  61. TP_ARGS(name, ch, ret),
  62. TP_STRUCT__entry(
  63. __string(name, name)
  64. __field(int, ch)
  65. __field(int, ret)
  66. ),
  67. TP_fast_assign(
  68. __assign_str(name, name);
  69. __entry->ch = ch;
  70. __entry->ret = ret;
  71. ),
  72. TP_printk("%s: channel switched to: %d ret: %d",
  73. __get_str(name), __entry->ch, __entry->ret)
  74. );
  75. #endif /* _TRACE_CRM_H */
  76. #undef TRACE_INCLUDE_PATH
  77. #define TRACE_INCLUDE_PATH .
  78. #undef TRACE_INCLUDE_FILE
  79. #define TRACE_INCLUDE_FILE trace-crm
  80. #include <trace/define_trace.h>