From 10cf95ae7737dbd2c5a955a0822928c40e116f62 Mon Sep 17 00:00:00 2001 From: Venkat Gopalakrishnan Date: Mon, 9 Jun 2014 14:00:31 -0700 Subject: mmc: sdhci: Add tracepoints to enhance debugging Instrument the sdhci driver with tracepoints to aid in debugging issues and identifying latencies in the following path: * CMD completion * DATA completion * DMA preparation * Post DMA cleanup Change-Id: Ie8cd0c2fb6c1bd6ab13883123be021081f8b8f78 Signed-off-by: Venkat Gopalakrishnan [subhashj@codeaurora.org: fixed minor merge conflict] Signed-off-by: Subhash Jadavani --- include/trace/events/mmc.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'include/trace') diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 82b368dbcefc..22cf81b2d9ff 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Google, Inc. + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -85,6 +86,78 @@ DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_end, TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) || (cmd == MMC_WRITE_MULTIPLE_BLOCK)) && data)); + +TRACE_EVENT(mmc_cmd_rw_start, + TP_PROTO(unsigned int cmd, unsigned int arg, unsigned int flags), + TP_ARGS(cmd, arg, flags), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, arg) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->arg = arg; + __entry->flags = flags; + ), + TP_printk("cmd=%u,arg=0x%08x,flags=0x%08x", + __entry->cmd, __entry->arg, __entry->flags) +); + +TRACE_EVENT(mmc_cmd_rw_end, + TP_PROTO(unsigned int cmd, unsigned int status, unsigned int resp), + TP_ARGS(cmd, status, resp), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, status) + __field(unsigned int, resp) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->status = status; + __entry->resp = resp; + ), + TP_printk("cmd=%u,int_status=0x%08x,response=0x%08x", + __entry->cmd, __entry->status, __entry->resp) +); + +TRACE_EVENT(mmc_data_rw_end, + TP_PROTO(unsigned int cmd, unsigned int status), + TP_ARGS(cmd, status), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, status) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->status = status; + ), + TP_printk("cmd=%u,int_status=0x%08x", + __entry->cmd, __entry->status) +); + +DECLARE_EVENT_CLASS(mmc_adma_class, + TP_PROTO(unsigned int cmd, unsigned int len), + TP_ARGS(cmd, len), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, len) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->len = len; + ), + TP_printk("cmd=%u,sg_len=0x%08x", __entry->cmd, __entry->len) +); + +DEFINE_EVENT(mmc_adma_class, mmc_adma_table_pre, + TP_PROTO(unsigned int cmd, unsigned int len), + TP_ARGS(cmd, len)); + +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 */ /* This part must be outside protection */ -- cgit v1.2.3 From b4b98fb480f72639d3a4166cdb2f1015b4c331f9 Mon Sep 17 00:00:00 2001 From: Sujit Reddy Thumma Date: Thu, 14 Feb 2013 08:13:52 +0530 Subject: 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 --- include/trace/events/mmc.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/trace') 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 -- cgit v1.2.3 From 26f1875126f874580c8ef227547cff96185d0eb7 Mon Sep 17 00:00:00 2001 From: Konstantin Dorfman Date: Thu, 12 Feb 2015 13:37:56 +0200 Subject: mmc: core: Add tracepoints to enhance pm debugging Instrument the mmc core layer with tracepoints to aid in debugging issues and identifying latencies in the following paths: * System suspend/resume * Runtime suspend/resume Change-Id: I1e0fa7d3f8b54c102b4055f910b58a42412748da Signed-off-by: Konstantin Dorfman [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani --- include/trace/events/mmc.h | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'include/trace') diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 9606997a8f2e..98a12711b572 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2013 Google, Inc. - * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -176,6 +176,47 @@ TRACE_EVENT(mmc_clk, ) ); +DECLARE_EVENT_CLASS(mmc_pm_template, + TP_PROTO(const char *dev_name, int err, s64 usecs), + + TP_ARGS(dev_name, err, usecs), + + TP_STRUCT__entry( + __field(s64, usecs) + __field(int, err) + __string(dev_name, dev_name) + ), + + TP_fast_assign( + __entry->usecs = usecs; + __entry->err = err; + __assign_str(dev_name, dev_name); + ), + + TP_printk( + "took %lld usecs, %s err %d", + __entry->usecs, + __get_str(dev_name), + __entry->err + ) +); + +DEFINE_EVENT(mmc_pm_template, mmc_runtime_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_runtime_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + #endif /* if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ) */ /* This part must be outside protection */ -- cgit v1.2.3 From 70a7e671d5fade5b8b419a45262a880e27cc6773 Mon Sep 17 00:00:00 2001 From: Konstantin Dorfman Date: Wed, 25 Feb 2015 16:23:50 +0200 Subject: mmc: sdhci-msm: Add tracepoints to enhance pm debugging Instrument the sdhci-msm platform driver with tracepoints to aid in debugging issues and identifying latencies in the following paths: * System suspend/resume * Runtime suspend/resume Change-Id: I4fed1c2ccba7d5d7f978f161e7985c98e869d1d8 Signed-off-by: Konstantin Dorfman --- include/trace/events/mmc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/trace') diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 98a12711b572..30b2113ace6e 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -217,6 +217,21 @@ DEFINE_EVENT(mmc_pm_template, mmc_resume, TP_PROTO(const char *dev_name, int err, s64 usecs), TP_ARGS(dev_name, err, usecs)); +DEFINE_EVENT(mmc_pm_template, sdhci_msm_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_runtime_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_runtime_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); #endif /* if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ) */ /* This part must be outside protection */ -- cgit v1.2.3