mmc.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (C) 2013 Google, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #undef TRACE_SYSTEM
  15. #define TRACE_SYSTEM mmc
  16. #if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ)
  17. #define _TRACE_MMC_H
  18. #include <linux/tracepoint.h>
  19. #include <linux/mmc/mmc.h>
  20. #include <linux/mmc/core.h>
  21. /*
  22. * Unconditional logging of mmc block erase operations,
  23. * including cmd, address, size
  24. */
  25. DECLARE_EVENT_CLASS(mmc_blk_erase_class,
  26. TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
  27. TP_ARGS(cmd, addr, size),
  28. TP_STRUCT__entry(
  29. __field(unsigned int, cmd)
  30. __field(unsigned int, addr)
  31. __field(unsigned int, size)
  32. ),
  33. TP_fast_assign(
  34. __entry->cmd = cmd;
  35. __entry->addr = addr;
  36. __entry->size = size;
  37. ),
  38. TP_printk("cmd=%u,addr=0x%08x,size=0x%08x",
  39. __entry->cmd, __entry->addr, __entry->size)
  40. );
  41. DEFINE_EVENT(mmc_blk_erase_class, mmc_blk_erase_start,
  42. TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
  43. TP_ARGS(cmd, addr, size));
  44. DEFINE_EVENT(mmc_blk_erase_class, mmc_blk_erase_end,
  45. TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
  46. TP_ARGS(cmd, addr, size));
  47. /*
  48. * Logging of start of read or write mmc block operation,
  49. * including cmd, address, size
  50. */
  51. DECLARE_EVENT_CLASS(mmc_blk_rw_class,
  52. TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
  53. TP_ARGS(cmd, addr, data),
  54. TP_STRUCT__entry(
  55. __field(unsigned int, cmd)
  56. __field(unsigned int, addr)
  57. __field(unsigned int, size)
  58. ),
  59. TP_fast_assign(
  60. __entry->cmd = cmd;
  61. __entry->addr = addr;
  62. __entry->size = data->blocks;
  63. ),
  64. TP_printk("cmd=%u,addr=0x%08x,size=0x%08x",
  65. __entry->cmd, __entry->addr, __entry->size)
  66. );
  67. DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_start,
  68. TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
  69. TP_ARGS(cmd, addr, data),
  70. TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) ||
  71. (cmd == MMC_WRITE_MULTIPLE_BLOCK)) &&
  72. data));
  73. DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_end,
  74. TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
  75. TP_ARGS(cmd, addr, data),
  76. TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) ||
  77. (cmd == MMC_WRITE_MULTIPLE_BLOCK)) &&
  78. data));
  79. TRACE_EVENT(mmc_clk,
  80. TP_PROTO(char *print_info),
  81. TP_ARGS(print_info),
  82. TP_STRUCT__entry(
  83. __string(print_info, print_info)
  84. ),
  85. TP_fast_assign(
  86. __assign_str(print_info, print_info);
  87. ),
  88. TP_printk("%s",
  89. __get_str(print_info)
  90. )
  91. );
  92. #endif /* _TRACE_MMC_H */
  93. /* This part must be outside protection */
  94. #include <trace/define_trace.h>