mei-trace.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. *
  3. * Intel Management Engine Interface (Intel MEI) Linux driver
  4. * Copyright (c) 2015, Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. */
  16. #if !defined(_MEI_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
  17. #define _MEI_TRACE_H_
  18. #include <linux/stringify.h>
  19. #include <linux/types.h>
  20. #include <linux/tracepoint.h>
  21. #include <linux/device.h>
  22. #undef TRACE_SYSTEM
  23. #define TRACE_SYSTEM mei
  24. TRACE_EVENT(mei_reg_read,
  25. TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val),
  26. TP_ARGS(dev, reg, offs, val),
  27. TP_STRUCT__entry(
  28. __string(dev, dev_name(dev))
  29. __field(const char *, reg)
  30. __field(u32, offs)
  31. __field(u32, val)
  32. ),
  33. TP_fast_assign(
  34. __assign_str(dev, dev_name(dev))
  35. __entry->reg = reg;
  36. __entry->offs = offs;
  37. __entry->val = val;
  38. ),
  39. TP_printk("[%s] read %s:[%#x] = %#x",
  40. __get_str(dev), __entry->reg, __entry->offs, __entry->val)
  41. );
  42. TRACE_EVENT(mei_reg_write,
  43. TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val),
  44. TP_ARGS(dev, reg, offs, val),
  45. TP_STRUCT__entry(
  46. __string(dev, dev_name(dev))
  47. __field(const char *, reg)
  48. __field(u32, offs)
  49. __field(u32, val)
  50. ),
  51. TP_fast_assign(
  52. __assign_str(dev, dev_name(dev))
  53. __entry->reg = reg;
  54. __entry->offs = offs;
  55. __entry->val = val;
  56. ),
  57. TP_printk("[%s] write %s[%#x] = %#x",
  58. __get_str(dev), __entry->reg, __entry->offs, __entry->val)
  59. );
  60. TRACE_EVENT(mei_pci_cfg_read,
  61. TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val),
  62. TP_ARGS(dev, reg, offs, val),
  63. TP_STRUCT__entry(
  64. __string(dev, dev_name(dev))
  65. __field(const char *, reg)
  66. __field(u32, offs)
  67. __field(u32, val)
  68. ),
  69. TP_fast_assign(
  70. __assign_str(dev, dev_name(dev))
  71. __entry->reg = reg;
  72. __entry->offs = offs;
  73. __entry->val = val;
  74. ),
  75. TP_printk("[%s] pci cfg read %s:[%#x] = %#x",
  76. __get_str(dev), __entry->reg, __entry->offs, __entry->val)
  77. );
  78. TRACE_EVENT(mei_pci_cfg_write,
  79. TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val),
  80. TP_ARGS(dev, reg, offs, val),
  81. TP_STRUCT__entry(
  82. __string(dev, dev_name(dev))
  83. __field(const char *, reg)
  84. __field(u32, offs)
  85. __field(u32, val)
  86. ),
  87. TP_fast_assign(
  88. __assign_str(dev, dev_name(dev))
  89. __entry->reg = reg;
  90. __entry->offs = offs;
  91. __entry->val = val;
  92. ),
  93. TP_printk("[%s] pci cfg write %s[%#x] = %#x",
  94. __get_str(dev), __entry->reg, __entry->offs, __entry->val)
  95. );
  96. #endif /* _MEI_TRACE_H_ */
  97. /* This part must be outside protection */
  98. #undef TRACE_INCLUDE_PATH
  99. #undef TRACE_INCLUDE_FILE
  100. #define TRACE_INCLUDE_PATH .
  101. #define TRACE_INCLUDE_FILE mei-trace
  102. #include <trace/define_trace.h>