diff options
author | Sujit Reddy Thumma <sthumma@codeaurora.org> | 2013-02-14 08:13:52 +0530 |
---|---|---|
committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:25:47 -0700 |
commit | b4b98fb480f72639d3a4166cdb2f1015b4c331f9 (patch) | |
tree | 66f264b65b29314c4ed6ab1254eedaed5878f8ee /include | |
parent | 553d6cb4e2604798725cc5fb6960d9b69ac0365f (diff) |
mmc: core: Log MMC clock frequency transitions
Use kernel's ftrace support to capture MMC clock frequency
transitions which can be useful for debugging issues related
to power consumption.
Usage:
mount -t debugfs none /sys/kernel/debug
echo 1 > /sys/kernel/debug/tracing/events/mmc/mmc_clk/enable
cat /sys/kernel/debug/tracing/trace_pipe
Change-Id: I25c4ee39dcbe30e7665902a9f723a5a421b55ca3
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mmc/host.h | 2 | ||||
-rw-r--r-- | include/trace/events/mmc.h | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index dd68bc9a805d..246151e79477 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -23,6 +23,8 @@ struct mmc_ios { unsigned int clock; /* clock rate */ + unsigned int old_rate; /* saved clock rate */ + unsigned long clk_ts; /* time stamp of last updated clock */ unsigned short vdd; /* vdd stores the bit number of the selected voltage range from below. */ diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 22cf81b2d9ff..9606997a8f2e 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -158,7 +158,25 @@ DEFINE_EVENT(mmc_adma_class, mmc_adma_table_post, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len)); -#endif /* _TRACE_MMC_H */ +TRACE_EVENT(mmc_clk, + TP_PROTO(char *print_info), + + TP_ARGS(print_info), + + TP_STRUCT__entry( + __string(print_info, print_info) + ), + + TP_fast_assign( + __assign_str(print_info, print_info); + ), + + TP_printk("%s", + __get_str(print_info) + ) +); + +#endif /* if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ) */ /* This part must be outside protection */ #include <trace/define_trace.h> |