From patchwork Mon Apr 15 22:52:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10901667 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 38FC217E6 for ; Mon, 15 Apr 2019 22:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1698E25E97 for ; Mon, 15 Apr 2019 22:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0802E286EE; Mon, 15 Apr 2019 22:53:02 +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 0200425E97 for ; Mon, 15 Apr 2019 22:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfDOWxA (ORCPT ); Mon, 15 Apr 2019 18:53:00 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:34464 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbfDOWxA (ORCPT ); Mon, 15 Apr 2019 18:53:00 -0400 Received: by mail-io1-f67.google.com with SMTP id n11so16051912ioh.1 for ; Mon, 15 Apr 2019 15:53:00 -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:mime-version :content-transfer-encoding; bh=ne5pjde4HF9lJsw056hcCinTNwk9gZ4Gsc2PETazukk=; b=SLWChC7su73E9YCNo30HEymjebC11nB28pHbTyvMXRljj6wGKJpLLLZdOei855VSy5 715GG9vYQ+Yokih+hurV0vvDNs4giXKpGIFrNZJ90mzU5ZTnmOecEY8GLSrYgOmCIh1d eUkZUYp5h1f+v8IVpsh9sxli0s3LZQwIH2b38= 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:mime-version :content-transfer-encoding; bh=ne5pjde4HF9lJsw056hcCinTNwk9gZ4Gsc2PETazukk=; b=ZWckymzjY8SosTznnmyYsBoD8a553MaDJFTFqeo5rOxqVtRRDB1zVklwPoP7MUtPlg Jxqu+m9VXKbcliz0WvQx8adoRHxxEut0ghBgWFpVLT5LOMkV3JB9G4i1V86e+/+sZ8zb kkpEnZEH2SqU5jlJnOlWKeqTkx8PFISMc6o7ZQvz70PNcyZiVspVtgRkOn411C3eUClx 0C3mI7IgrfFamdW1n/JnVNsYuQFGTJC3YUnp89pnoO950Kn9IvMlQmn+aHLxuXeRmaO0 d0QhF84YmT7iILoqF9oB4+4UOESHiJEVH4LRkR+ZUxXKdZIqzR9N3CT17aCqlCS4W7zp 3O4A== X-Gm-Message-State: APjAAAVSn52UKixtrz7snvpB+RzDiXtTBuhO4d2HIsmqUWL541o+tDZ5 Kd8P+YbSIN6+JX2RXLocDZAtZA== X-Google-Smtp-Source: APXvYqxL3Y1/5EY9rT1odg/U/wDCVci/c5Ayg9G8OwUTt1pbou2Sl7HGdCuZSnjch5kBpOPfOLD81w== X-Received: by 2002:a5d:87d3:: with SMTP id q19mr25910171ios.29.1555368779666; Mon, 15 Apr 2019 15:52:59 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id a16sm8666316itc.36.2019.04.15.15.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:52:58 -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 , Ingo Molnar , linux-kernel@vger.kernel.org, Shawn Lin , Kyle Roeschley , Avri Altman , Ulf Hansson Subject: [PATCH v1 1/4] mmc: core: Add trace event for SD SCR response Date: Mon, 15 Apr 2019 16:52:38 -0600 Message-Id: <20190415225241.70088-1-rrangel@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Example: sd_scr: mmc0: version: 2, spec3: 1, width: 5, cmds: 0, raw: {0x2b58000,0x0} Signed-off-by: Raul E Rangel --- drivers/mmc/core/sd.c | 4 ++++ include/trace/events/mmc.h | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 265e1aeeb9d8..3bed7c4b6d75 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -21,6 +21,8 @@ #include #include +#include + #include "core.h" #include "card.h" #include "host.h" @@ -200,6 +202,7 @@ static int mmc_decode_scr(struct mmc_card *card) if (scr_struct != 0) { pr_err("%s: unrecognised SCR structure version %d\n", mmc_hostname(card->host), scr_struct); + trace_sd_scr(card, NULL); return -EINVAL; } @@ -221,6 +224,7 @@ static int mmc_decode_scr(struct mmc_card *card) if (scr->sda_spec3) scr->cmds = UNSTUFF_BITS(resp, 32, 2); + trace_sd_scr(card, scr); return 0; } diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 7b706ff21335..e45258e8a6cb 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -10,6 +10,48 @@ #include #include +TRACE_EVENT(sd_scr, + + TP_PROTO(struct mmc_card *card, struct sd_scr *scr), + + TP_ARGS(card, scr), + + TP_STRUCT__entry( + __array(u32, raw, 2) + __field(unsigned char, sda_vsn) + __field(unsigned char, sda_spec3) + __field(unsigned char, bus_widths) + __field(unsigned char, cmds) + __string(name, mmc_hostname(card->host)) + ), + + TP_fast_assign( + memcpy(__entry->raw, card->raw_scr, sizeof(card->raw_scr)); + if (scr) { + __entry->sda_vsn = scr->sda_vsn; + __entry->sda_spec3 = scr->sda_spec3; + __entry->bus_widths = scr->bus_widths; + __entry->cmds = scr->cmds; + } else { + __entry->sda_vsn = 0; + __entry->sda_spec3 = 0; + __entry->bus_widths = 0; + __entry->cmds = 0; + } + __assign_str(name, mmc_hostname(card->host)); + ), + + TP_printk("%s: version: %d, spec3: %d, width: %d, cmds: %d, " + "raw: %s", + __get_str(name), + __entry->sda_vsn, + __entry->sda_spec3, + __entry->bus_widths, + __entry->cmds, + __print_array(__entry->raw, 2, sizeof(u32)) + ) +); + TRACE_EVENT(mmc_request_start, TP_PROTO(struct mmc_host *host, struct mmc_request *mrq), From patchwork Mon Apr 15 22:52:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10901681 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 1957A1800 for ; Mon, 15 Apr 2019 22:53:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 055E825E97 for ; Mon, 15 Apr 2019 22:53:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED8AE28606; Mon, 15 Apr 2019 22:53:20 +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=unavailable 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 A2716286EE for ; Mon, 15 Apr 2019 22:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728083AbfDOWxE (ORCPT ); Mon, 15 Apr 2019 18:53:04 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:34469 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728031AbfDOWxD (ORCPT ); Mon, 15 Apr 2019 18:53:03 -0400 Received: by mail-io1-f67.google.com with SMTP id n11so16051991ioh.1 for ; Mon, 15 Apr 2019 15:53:03 -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=GkjIrKEQNQ3G7xnk8XYGn5F/+Y0cS2ZRMu00W+VyZSE=; b=l13kvR7644rfoKoxzoMRYJT7KFRzjE9KRkKEasZ/Q6oOShdyjJ7qKNMxGtEzcSksRq YQvbn+2nZz0HuqwE93Cp9KX2smsWC7DZ/tLGshgVH6v2bznWULCWlGsHl0pPO5MpkCXK V8JnsYr1RxMliDlXnubPtBfg0w4ix9utPBJOE= 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=GkjIrKEQNQ3G7xnk8XYGn5F/+Y0cS2ZRMu00W+VyZSE=; b=R39ohjnwPW8GfyEqN3qJVLx3JlZfDRfnWrGGSIh0JxTP5vxwOTlpLHjR01QqKsRP+P uTYJCNuUCszcMgVTq8+fURnKhiXxa9z5XnnmJ8PK0ZDlh4LS57rpJvAeXyCyUhLmypD1 nbo6qReaWn5tcW65+fRVkIVSBfW7XW3vYpcrbyW2tth8SDdHdCarUG1gE6nJbteSWvSN iHRcVNmQU4MKOwAjNnC43/po7PlueCvgNKXpSrDSMZi+/+Lw3qs1aPxRu7nwvA3GNe1H 0MybgkmzUpIAZtKxdu3s+e72490kB9SS2NFoAByxwRTgbs3xPFNq016rr0hvwxQQsAF0 cAlg== X-Gm-Message-State: APjAAAUOZFPlFTGaaxLDy0C2p6MKxuUQ6GOM2CgEGD+2HipHJb4lsqL5 7WpvQqgaWv2Z6AwPd6CfsOvB1w== X-Google-Smtp-Source: APXvYqwtwuYOp6f8Vhqlap+/EK5khOXtFLcn1jsF+Vxq86qoKG+/lfrqqNQq0TATHAy6SJUuidIzwA== X-Received: by 2002:a6b:b285:: with SMTP id b127mr46548010iof.179.1555368782824; Mon, 15 Apr 2019 15:53:02 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id 77sm8873833itl.17.2019.04.15.15.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:53:02 -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 , Ingo Molnar , linux-kernel@vger.kernel.org, Kyle Roeschley , Avri Altman , Ulf Hansson Subject: [PATCH v1 2/4] mmc: core: Add trace event for SD SSR response Date: Mon, 15 Apr 2019 16:52:39 -0600 Message-Id: <20190415225241.70088-2-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-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Example: sd_ssr: mmc0: au: 8192, erase time: 0, erase offset: 0x0, raw: {0x0,0x3000000,0x1019000,0x10000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0} Signed-off-by: Raul E Rangel --- drivers/mmc/core/sd.c | 2 ++ include/trace/events/mmc.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 3bed7c4b6d75..cc33a4f96c6a 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -282,6 +282,8 @@ static int mmc_read_ssr(struct mmc_card *card) } } + trace_sd_ssr(card); + /* * starting SD5.1 discard is supported if DISCARD_SUPPORT (b313) is set */ diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index e45258e8a6cb..cad604ee800f 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -52,6 +52,37 @@ TRACE_EVENT(sd_scr, ) ); +TRACE_EVENT(sd_ssr, + + TP_PROTO(struct mmc_card *card), + + TP_ARGS(card), + + TP_STRUCT__entry( + __array(u32, raw, 16) + __field(unsigned int, au) + __field(unsigned int, erase_timeout) + __field(unsigned int, erase_offset) + __string(name, mmc_hostname(card->host)) + ), + + TP_fast_assign( + memcpy(__entry->raw, card->raw_ssr, sizeof(card->raw_ssr)); + __entry->au = card->ssr.au; + __entry->erase_timeout = card->ssr.erase_timeout; + __entry->erase_offset = card->ssr.erase_offset; + __assign_str(name, mmc_hostname(card->host)); + ), + + TP_printk("%s: au: %d, erase time: %d, erase offset: %#x, raw: %s", + __get_str(name), + __entry->au, + __entry->erase_timeout, + __entry->erase_offset, + __print_array(__entry->raw, 16, sizeof(u32)) + ) +); + TRACE_EVENT(mmc_request_start, TP_PROTO(struct mmc_host *host, struct mmc_request *mrq), From patchwork Mon Apr 15 22:52:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10901673 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 2D8F317E1 for ; Mon, 15 Apr 2019 22:53:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1865825E97 for ; Mon, 15 Apr 2019 22:53:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CBA7286EE; Mon, 15 Apr 2019 22:53:18 +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 8413D25E97 for ; Mon, 15 Apr 2019 22:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728206AbfDOWxJ (ORCPT ); Mon, 15 Apr 2019 18:53:09 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:56036 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbfDOWxG (ORCPT ); Mon, 15 Apr 2019 18:53:06 -0400 Received: by mail-it1-f196.google.com with SMTP id y134so29931697itc.5 for ; Mon, 15 Apr 2019 15:53:05 -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=dCSkPH4TEhOz2CVPriVw70SoAjwKpU3zKt3o48+f2Wk=; b=WoXuGsbRkxzkwFjOGTtN8Hqe2wRfRX/dbzNn8LpwMLZX/HIIy0/Ap2Ki2F8YaNhDAz Fr/bI0g7oKJevTzjCeEOrgCWj4RCpvSJ0vIkDhX+kL67FjCA4Kb920O0HFS2L4mUddVX e78632JsQl/VIlJxuSJQwOmebj6lgM8gYau8s= 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=dCSkPH4TEhOz2CVPriVw70SoAjwKpU3zKt3o48+f2Wk=; b=KPsmjFu2QXl8Ef2w4T1ThQyzX6h5Qnpl531wV1hkxObUGFxPSEPlge4B5PUGQmg8Ho KlsSuSax3bO5NHV53FTARx+Fn49NLJcQ72mEC/J9EGrK/QnS4AGg0cr6pnlSWe5ebD4f TM5OXFMtZkjedLxBktLz7btRANpWUV1fTeHvUC9SaElxia+V8w9kuy+Ir9KEXIpe10s6 NH/+jHzM3KD2YJum/9sqdQwkbUhA3NpqBejRlA8xgLP8XIY7LSDc0xB+ITK7Z0unZc0O fNOldi5EUMXh0gPL4zhln/5pQnYbTQA//iy/KSUE57tDefCoVFgejyOsAR+jlIBv7NU+ jLGQ== X-Gm-Message-State: APjAAAWG8eSsQPNKDo4QYZuaMfmwpTWo7BMVFvJFyAODZtOaKA+cMlCR zBvPN01BslNrUv8HGHpEV6T3qg== X-Google-Smtp-Source: APXvYqxOdeCpQnCSsNDLCXeaHYXbWr7z75PVoYUDgI+R5yRn9DgBxNpGDpClFJrnFW3uHHxUbJ7hPg== X-Received: by 2002:a24:13c7:: with SMTP id 190mr28753654itz.9.1555368785341; Mon, 15 Apr 2019 15:53:05 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id o203sm8021762itd.1.2019.04.15.15.53.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:53:04 -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 , Ingo Molnar , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v1 3/4] mmc: core: Add trace event for SD OCR response Date: Mon, 15 Apr 2019 16:52:40 -0600 Message-Id: <20190415225241.70088-3-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-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Example: ocr_request: mmc0: 0x51200000 SDHC or SDXC Supported (HCS) | Maximum Performance (XPC) | Switch to 1.8V (S18R) | 3.3 ~ 3.4 ocr_response: mmc0: 0xff8000 2.7 ~ 2.8 | 2.8 ~ 2.9 | 2.9 ~ 3.0 | 3.0 ~ 3.1 | 3.1 ~ 3.2 | 3.2 ~ 3.3 | 3.3 ~ 3.4 | 3.4 ~ 3.5 | 3.5 ~ 3.6 Signed-off-by: Raul E Rangel --- drivers/mmc/core/sd_ops.c | 6 +++ include/trace/events/mmc.h | 91 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index 0bb0b8419016..4cf0f040f896 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -19,6 +19,8 @@ #include #include +#include + #include "core.h" #include "sd_ops.h" @@ -130,11 +132,15 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) cmd.arg = ocr; cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; + trace_sd_ocr_request(host, ocr); + for (i = 100; i; i--) { err = mmc_wait_for_app_cmd(host, NULL, &cmd); if (err) break; + trace_sd_ocr_response(host, cmd.resp[0]); + /* if we're just probing, do a single pass */ if (ocr == 0) break; diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index cad604ee800f..fa82c010ae4e 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -10,6 +10,97 @@ #include #include +#define SD_OCR_REQUEST \ + {SD_OCR_CCS, "SDHC or SDXC Supported (HCS)"}, \ + {SD_OCR_XPC, "Maximum Performance (XPC)"}, \ + {SD_ROCR_S18A, "Switch to 1.8V (S18R)"}, \ + {MMC_VDD_165_195, "1.65 - 1.95"}, \ + {MMC_VDD_20_21, "2.0 ~ 2.1"}, \ + {MMC_VDD_21_22, "2.1 ~ 2.2"}, \ + {MMC_VDD_22_23, "2.2 ~ 2.3"}, \ + {MMC_VDD_23_24, "2.3 ~ 2.4"}, \ + {MMC_VDD_24_25, "2.4 ~ 2.5"}, \ + {MMC_VDD_25_26, "2.5 ~ 2.6"}, \ + {MMC_VDD_26_27, "2.6 ~ 2.7"}, \ + {MMC_VDD_27_28, "2.7 ~ 2.8"}, \ + {MMC_VDD_28_29, "2.8 ~ 2.9"}, \ + {MMC_VDD_29_30, "2.9 ~ 3.0"}, \ + {MMC_VDD_30_31, "3.0 ~ 3.1"}, \ + {MMC_VDD_31_32, "3.1 ~ 3.2"}, \ + {MMC_VDD_32_33, "3.2 ~ 3.3"}, \ + {MMC_VDD_33_34, "3.3 ~ 3.4"}, \ + {MMC_VDD_34_35, "3.4 ~ 3.5"}, \ + {MMC_VDD_35_36, "3.5 ~ 3.6"} \ + +TRACE_EVENT(sd_ocr_request, + + TP_PROTO(struct mmc_host *host, u32 ocr), + + TP_ARGS(host, ocr), + + TP_STRUCT__entry( + __field(u32, ocr) + __string(name, mmc_hostname(host)) + ), + + TP_fast_assign( + __entry->ocr = ocr; + __assign_str(name, mmc_hostname(host)); + ), + + TP_printk("%s: %#x %s", + __get_str(name), + __entry->ocr, + __print_flags(__entry->ocr, " | ", SD_OCR_REQUEST) + ) +); + +#define SD_OCR_RESPONSE \ + {MMC_CARD_BUSY, "Ready"}, \ + {SD_OCR_CCS, "SDHC or SDXC (CCS)"}, \ + {(1<<29), "UHS-II Card"}, \ + {SD_ROCR_S18A, "1.8V Accepted (S18A)"}, \ + {MMC_VDD_165_195, "1.65 - 1.95"}, \ + {MMC_VDD_20_21, "2.0 ~ 2.1"}, \ + {MMC_VDD_21_22, "2.1 ~ 2.2"}, \ + {MMC_VDD_22_23, "2.2 ~ 2.3"}, \ + {MMC_VDD_23_24, "2.3 ~ 2.4"}, \ + {MMC_VDD_24_25, "2.4 ~ 2.5"}, \ + {MMC_VDD_25_26, "2.5 ~ 2.6"}, \ + {MMC_VDD_26_27, "2.6 ~ 2.7"}, \ + {MMC_VDD_27_28, "2.7 ~ 2.8"}, \ + {MMC_VDD_28_29, "2.8 ~ 2.9"}, \ + {MMC_VDD_29_30, "2.9 ~ 3.0"}, \ + {MMC_VDD_30_31, "3.0 ~ 3.1"}, \ + {MMC_VDD_31_32, "3.1 ~ 3.2"}, \ + {MMC_VDD_32_33, "3.2 ~ 3.3"}, \ + {MMC_VDD_33_34, "3.3 ~ 3.4"}, \ + {MMC_VDD_34_35, "3.4 ~ 3.5"}, \ + {MMC_VDD_35_36, "3.5 ~ 3.6"} + +TRACE_EVENT(sd_ocr_response, + + TP_PROTO(struct mmc_host *host, u32 ocr), + + TP_ARGS(host, ocr), + + TP_STRUCT__entry( + __field(u32, ocr) + __string(name, mmc_hostname(host)) + ), + + TP_fast_assign( + __entry->ocr = ocr; + __assign_str(name, mmc_hostname(host)); + ), + + TP_printk("%s: %#x %s", + __get_str(name), + __entry->ocr, + __print_flags(__entry->ocr, " | ", SD_OCR_RESPONSE) + ) +); + TRACE_EVENT(sd_scr, TP_PROTO(struct mmc_card *card, struct sd_scr *scr), 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: 10901677 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 231A71800 for ; Mon, 15 Apr 2019 22:53:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1292C28606 for ; Mon, 15 Apr 2019 22:53:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 060152882F; Mon, 15 Apr 2019 22:53:19 +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=unavailable 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 874B528606 for ; Mon, 15 Apr 2019 22:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbfDOWxJ (ORCPT ); Mon, 15 Apr 2019 18:53:09 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:34472 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728198AbfDOWxH (ORCPT ); Mon, 15 Apr 2019 18:53:07 -0400 Received: by mail-io1-f66.google.com with SMTP id n11so16052113ioh.1 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=SW4w9040gxfGYpj7//jQYVgzMp8/+asef0EUPo0aniKSpWY0CcSyrnloFf7jhwlzQI SW6hDB0Gs5Hq02peFHfOrP9TpDSfY5X0rPZHgK7G4NKh4S5bYKiwdf+DJnR56kZxTAzo lIrKKRrRusIglr3w7yJ61k8ZcieLo7A2yA2xJADb5dq77KS8ngvp4rNDCGg9ltbUbXOL 8fGevf4/e+PqNkCHHtrX7Zhz9T0afxxS4C+vYs0Otpz3MybjurnwQVDui2f+DZdtx28T VUKSj8vN4R2JlReNcsn9746ATz8YVLTNC/+knti89rgB7TcPTcNLSaRvCrX50D68G8yX oDbQ== X-Gm-Message-State: APjAAAVd4KG2IfTU0GBF2V9HiYqoGxoUsilHh0RCBl85bVUHh9phM49J zuS6XseXCzoDhMkDveqZc9t/DQ== 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-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@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),