From patchwork Mon Apr 15 22:52:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10901671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7074B17E1 for ; Mon, 15 Apr 2019 22:53:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5998025E97 for ; Mon, 15 Apr 2019 22:53:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D7E4286EE; Mon, 15 Apr 2019 22:53:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6AB925E97 for ; Mon, 15 Apr 2019 22:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728201AbfDOWxJ (ORCPT ); Mon, 15 Apr 2019 18:53:09 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:40913 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728199AbfDOWxI (ORCPT ); Mon, 15 Apr 2019 18:53:08 -0400 Received: by mail-io1-f67.google.com with SMTP id d201so16049222iof.7 for ; Mon, 15 Apr 2019 15:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gdPoW9mhfi6soRZh5xEBsWtXHQf+l0G2eEYMV2IVYv0=; b=Cb7aaKwiFDjPX1hsQVWMdhof7UfTrhdSCipGghOvpHM29X6Q378GE+rYJ2MwWdc7HY 7dxPhWQlRxoHIRBqY6cPWEYLJrSuzKU7zWvZlV4718swC2FM1unKHfUCW5Q+HqrhHski dowZmxjew6PmHD6wB8n6+BWB8tbCaur4x8a7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gdPoW9mhfi6soRZh5xEBsWtXHQf+l0G2eEYMV2IVYv0=; b=fsTsQPEdUeso+Pyd2Z+JcnYnaVyBb+6F8bM94FEcw3L56QTOmvLJAuSx+rMrN9BiV8 87s6wufAnPNluBp+XRYWnBdSq7eXMiIP6rrb7JPcYw61XaXf3IhlNjqdCaRI+WsB/qXb YWz70j6YXcv9eiPxovHgZEn4kme0TQYCMgfq6MhTYvsnAebBn4V/91wDXp3WbJXKZ9K+ lLL12IXUCPLry7aDVcvTkWkC0cEhKd/s41yaeAGeK0aIKihoPo+l4yEQbse8DdgQDI1p C+FEB6FMVRPfML8/z+bGRUrJuzN4szVzfh3gVIepkX00aACwNGwCKJp0Ct1ZtOx+JC1G jmNg== X-Gm-Message-State: APjAAAWwfnpMTi9uMeA3u16O4yf28NShcTJpukNMmy6PMHpKtuliTV/t bjDEWzjFNL6gTMxsnYLJMlUsCTe9gNt4oQ== X-Google-Smtp-Source: APXvYqyIPAyjx9oo54Bkr5S/JXYCCCJH5bow3kmenuIuyOIAUJLE4RhXwJ7MoxLERPst/6T7sucEIQ== X-Received: by 2002:a5d:8b87:: with SMTP id p7mr16062565iol.64.1555368787253; Mon, 15 Apr 2019 15:53:07 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id t142sm8558391ita.38.2019.04.15.15.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:53:06 -0700 (PDT) From: Raul E Rangel To: linux-mmc@vger.kernel.org, linux-trace-devel@vger.kernel.org Cc: djkurtz@chromium.org, zwisler@chromium.org, Raul E Rangel , Steven Rostedt , hongjiefang , Jennifer Dahm , linux-kernel@vger.kernel.org, Shawn Lin , Kyle Roeschley , Ingo Molnar , Avri Altman , Ulf Hansson , Simon Horman Subject: [PATCH v1 4/4] mmc: core: Add trace event for CSD response Date: Mon, 15 Apr 2019 16:52:41 -0600 Message-Id: <20190415225241.70088-4-rrangel@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190415225241.70088-1-rrangel@chromium.org> References: <20190415225241.70088-1-rrangel@chromium.org> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Example: mmc_csd: mmc0: struct: 0, cmdclass: 0x5b5, raw: {0x400e0032,0x5b590000,0x3b4b7f80,0xa404000} Signed-off-by: Raul E Rangel --- 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 #include +#include + #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),