mei-trace.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #endif /* _MEI_TRACE_H_ */
  61. /* This part must be outside protection */
  62. #undef TRACE_INCLUDE_PATH
  63. #undef TRACE_INCLUDE_FILE
  64. #define TRACE_INCLUDE_PATH .
  65. #define TRACE_INCLUDE_FILE mei-trace
  66. #include <trace/define_trace.h>