2 * Copyright (C) 2013 Google, Inc.
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.
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.
16 #define TRACE_SYSTEM mmc
18 #if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ)
21 #include <linux/tracepoint.h>
22 #include <linux/mmc/mmc.h>
23 #include <linux/mmc/core.h>
26 * Unconditional logging of mmc block erase operations,
27 * including cmd, address, size
29 DECLARE_EVENT_CLASS(mmc_blk_erase_class,
30 TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
31 TP_ARGS(cmd, addr, size),
33 __field(unsigned int, cmd)
34 __field(unsigned int, addr)
35 __field(unsigned int, size)
42 TP_printk("cmd=%u,addr=0x%08x,size=0x%08x",
43 __entry->cmd, __entry->addr, __entry->size)
46 DEFINE_EVENT(mmc_blk_erase_class, mmc_blk_erase_start,
47 TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
48 TP_ARGS(cmd, addr, size));
50 DEFINE_EVENT(mmc_blk_erase_class, mmc_blk_erase_end,
51 TP_PROTO(unsigned int cmd, unsigned int addr, unsigned int size),
52 TP_ARGS(cmd, addr, size));
55 * Logging of start of read or write mmc block operation,
56 * including cmd, address, size
58 DECLARE_EVENT_CLASS(mmc_blk_rw_class,
59 TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
60 TP_ARGS(cmd, addr, data),
62 __field(unsigned int, cmd)
63 __field(unsigned int, addr)
64 __field(unsigned int, size)
69 __entry->size = data->blocks;
71 TP_printk("cmd=%u,addr=0x%08x,size=0x%08x",
72 __entry->cmd, __entry->addr, __entry->size)
75 DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_start,
76 TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
77 TP_ARGS(cmd, addr, data),
78 TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) ||
79 (cmd == MMC_WRITE_MULTIPLE_BLOCK)) &&
82 DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_end,
83 TP_PROTO(unsigned int cmd, unsigned int addr, struct mmc_data *data),
84 TP_ARGS(cmd, addr, data),
85 TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) ||
86 (cmd == MMC_WRITE_MULTIPLE_BLOCK)) &&
88 #endif /* _TRACE_MMC_H */
90 /* This part must be outside protection */
91 #include <trace/define_trace.h>