diff options
author | Ken Sumrall <ksumrall@android.com> | 2013-05-15 20:13:13 -0700 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-02-03 16:47:08 +0100 |
commit | b982e9d1023f86805dd9bfae7d35e02f36bd2a06 (patch) | |
tree | d5a9d5f8ff2bceb0c015c1b754c0a2fe6d84294b /drivers | |
parent | ba18f86d405f3188eb2656dbf629845aa5b4759f (diff) |
mmc: Add tracepoints of mmc block operations
Add tracepoints to record the start and end of each mmc block
operation. This includes read, write, erase, secure erase,
trim, secure trim1 and secure trim 2, discard and
sanitize commands.
Change-Id: Ic5d1cbdb9adb940d8b1a2a13c73970023575df50
Signed-off-by: Ken Sumrall <ksumrall@android.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Conflicts:
drivers/mmc/card/block.c
drivers/mmc/core/core.c
(cherry picked from commit 4de9a433c26e47d9b4a93105eb92935321100786)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/card/block.c | 4 | ||||
-rwxr-xr-x | drivers/mmc/core/core.c | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 586b4ca4725e..dcdc948fbddb 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -35,6 +35,10 @@ #include <linux/capability.h> #include <linux/compat.h> +#include <linux/interrupt.h> +#define CREATE_TRACE_POINTS +#include <trace/events/mmc.h> + #include <linux/mmc/ioctl.h> #include <linux/mmc/card.h> #include <linux/mmc/host.h> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 58a38153db63..cd4f5ffc76ca 100755 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -27,6 +27,8 @@ #include <linux/suspend.h> #include <linux/wakelock.h> +#include <trace/events/mmc.h> + #include <linux/mmc/card.h> #include <linux/mmc/host.h> #include <linux/mmc/mmc.h> @@ -123,6 +125,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) pr_debug("%s: %d bytes transferred: %d\n", mmc_hostname(host), mrq->data->bytes_xfered, mrq->data->error); + trace_mmc_blk_rw_end(cmd->opcode, cmd->arg, mrq->data); } if (mrq->stop) { @@ -322,8 +325,12 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host, } } - if (areq) + if (areq) { + trace_mmc_blk_rw_start(areq->mrq->cmd->opcode, + areq->mrq->cmd->arg, + areq->mrq->data); __mmc_start_req(host, areq->mrq); + } if (host->areq) mmc_post_req(host, host->areq->mrq, 0); @@ -1678,8 +1685,13 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, { struct mmc_command cmd = {0}; unsigned int qty = 0; + unsigned int fr, nr; int err; + fr = from; + nr = to - from + 1; + trace_mmc_blk_erase_start(arg, fr, nr); + /* * qty is used to calculate the erase timeout which depends on how many * erase groups (or allocation units in SD terminology) are affected. @@ -1771,6 +1783,8 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, } while (!(cmd.resp[0] & R1_READY_FOR_DATA) || R1_CURRENT_STATE(cmd.resp[0]) == R1_STATE_PRG); out: + + trace_mmc_blk_erase_end(arg, fr, nr); return err; } |