mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Raul E Rangel <rrangel@chromium.org>
To: linux-mmc@vger.kernel.org, linux-trace-devel@vger.kernel.org
Cc: djkurtz@chromium.org, zwisler@chromium.org,
	Raul E Rangel <rrangel@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	hongjiefang <hongjiefang@asrmicro.com>,
	Jennifer Dahm <jennifer.dahm@ni.com>,
	linux-kernel@vger.kernel.org,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Kyle Roeschley <kyle.roeschley@ni.com>,
	Ingo Molnar <mingo@redhat.com>, Avri Altman <avri.altman@wdc.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Simon Horman <horms+renesas@verge.net.au>
Subject: [PATCH v1 4/4] mmc: core: Add trace event for CSD response
Date: Mon, 15 Apr 2019 16:52:41 -0600	[thread overview]
Message-ID: <20190415225241.70088-4-rrangel@chromium.org> (raw)
In-Reply-To: <20190415225241.70088-1-rrangel@chromium.org>

Example:
mmc_csd: mmc0: struct: 0, cmdclass: 0x5b5, raw: {0x400e0032,0x5b590000,0x3b4b7f80,0xa404000}

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
---

 drivers/mmc/core/mmc.c     |  4 ++++
 drivers/mmc/core/sd.c      |  2 ++
 include/trace/events/mmc.h | 28 ++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3e786ba204c3..46ce894f7c03 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -20,6 +20,8 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/mmc.h>
 
+#include <trace/events/mmc.h>
+
 #include "core.h"
 #include "card.h"
 #include "host.h"
@@ -182,6 +184,8 @@ static int mmc_decode_csd(struct mmc_card *card)
 		csd->erase_size <<= csd->write_blkbits - 9;
 	}
 
+	trace_mmc_csd(card);
+
 	return 0;
 }
 
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index cc33a4f96c6a..4e704a7280ba 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -183,6 +183,8 @@ static int mmc_decode_csd(struct mmc_card *card)
 
 	card->erase_size = csd->erase_size;
 
+	trace_mmc_csd(card);
+
 	return 0;
 }
 
diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h
index fa82c010ae4e..58f6f7808974 100644
--- a/include/trace/events/mmc.h
+++ b/include/trace/events/mmc.h
@@ -174,6 +174,34 @@ TRACE_EVENT(sd_ssr,
 	)
 );
 
+TRACE_EVENT(mmc_csd,
+
+	TP_PROTO(struct mmc_card *card),
+
+	TP_ARGS(card),
+
+	TP_STRUCT__entry(
+		__array(u32,			raw,	4)
+		__field(unsigned char,		structure)
+		__field(unsigned short,		cmdclass)
+		__string(name,			mmc_hostname(card->host))
+	),
+
+	TP_fast_assign(
+		__entry->structure = card->csd.structure;
+		__entry->cmdclass = card->csd.cmdclass;
+		memcpy(__entry->raw, card->raw_csd, sizeof(card->raw_csd));
+		__assign_str(name, mmc_hostname(card->host));
+	),
+
+	TP_printk("%s: struct: %d, cmdclass: %#x, raw: %s",
+		  __get_str(name),
+		  __entry->structure,
+		  __entry->cmdclass,
+		  __print_array(__entry->raw, 4, sizeof(u32))
+	)
+);
+
 TRACE_EVENT(mmc_request_start,
 
 	TP_PROTO(struct mmc_host *host, struct mmc_request *mrq),
-- 
2.21.0.392.gf8f6787159e-goog


  parent reply	other threads:[~2019-04-15 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 22:52 [PATCH v1 1/4] mmc: core: Add trace event for SD SCR response Raul E Rangel
2019-04-15 22:52 ` [PATCH v1 2/4] mmc: core: Add trace event for SD SSR response Raul E Rangel
2019-04-15 23:34   ` Steven Rostedt
2019-04-15 22:52 ` [PATCH v1 3/4] mmc: core: Add trace event for SD OCR response Raul E Rangel
2019-04-15 22:52 ` Raul E Rangel [this message]
2019-04-15 23:31 ` [PATCH v1 1/4] mmc: core: Add trace event for SD SCR response Steven Rostedt
2019-04-16 12:36   ` Avri Altman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190415225241.70088-4-rrangel@chromium.org \
    --to=rrangel@chromium.org \
    --cc=avri.altman@wdc.com \
    --cc=djkurtz@chromium.org \
    --cc=hongjiefang@asrmicro.com \
    --cc=horms+renesas@verge.net.au \
    --cc=jennifer.dahm@ni.com \
    --cc=kyle.roeschley@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zwisler@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®