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: 10901669 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 E91FF17E6 for ; Mon, 15 Apr 2019 22:53:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D719D25E97 for ; Mon, 15 Apr 2019 22:53:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CABCF286EE; Mon, 15 Apr 2019 22:53:05 +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 7B07C25E97 for ; Mon, 15 Apr 2019 22:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727841AbfDOWxB (ORCPT ); Mon, 15 Apr 2019 18:53:01 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:40908 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbfDOWxB (ORCPT ); Mon, 15 Apr 2019 18:53:01 -0400 Received: by mail-io1-f68.google.com with SMTP id d201so16049042iof.7 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=SlzDCLjtAoFQOwrxJDVuPKDIV+Ipn+Q+UtVWy7X64B4Vg88rF3pMBq/PvKGUWkA0hg 9PdMwelsCvhNWUxr815vWOf9lSqhcNC7LMVIrqwFsZEU6HHlP87It95QnBxOXFfKA/L/ Z9JGgkBe1/pbXcwHmAGqgnXJ1ZLG8e+/77GYQK30pxvGd4RliX9F8vVnH0La/+DD+NSo /SpRfmu5f07ao+QMC+7gtgzSjmLFiEULFxRfxi1DGdk2cL2DIdHH9DSN7trd1KNtbadV vLleIL5fkZCbfFr8sjwCQPiwm9QhaoQLVqsb/EwLMq1Gof2Zz81cx9W0XiyC2Y8JNowd Sa0A== X-Gm-Message-State: APjAAAUC4gt9Mo6pkmHvNwBUPoxLg37rPVxBvrN8YqDsOedNUYh6p/1b iRpmcz/snFpoVaxvm35B8ucv3WreSDMZiw== 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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: 10901679 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 D205317E1 for ; Mon, 15 Apr 2019 22:53:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BADBB25E97 for ; Mon, 15 Apr 2019 22:53:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE303287B3; 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=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 5459A25E97 for ; Mon, 15 Apr 2019 22:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfDOWxE (ORCPT ); Mon, 15 Apr 2019 18:53:04 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:40908 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728035AbfDOWxE (ORCPT ); Mon, 15 Apr 2019 18:53:04 -0400 Received: by mail-io1-f65.google.com with SMTP id d201so16049105iof.7 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=XrMUPQFAww++L98sGgvr4RlU/v9MNZewbBbmuK+G4EOXizbQByZhiLfBed6B57sBXn Bu0QOPZf8TVDjBENe/FPHLj1z8AmbmJa4IF6efOobAxPvo/rA6FJgQHzKidXjAlT6Idh dcCjuLLASfvezkys2GhQBAc4RH2RTQ7Ma3Vq2VUHqyIarhdjicQis0P/5nQqDnGj8iNk bnFgBiD8mgvMEV++RC4Gz3wD+30aTnuu2uEWGu/tBF8LOlWf3bjEkqhblX8VhfMs2rFq Cgz0EEEdhMjVGCgPj2onI1H6H8R373rY+E5pkjOHWwZiAlBwu/r4nezYYrT0RjFYu0JR uU5A== X-Gm-Message-State: APjAAAU5jcBBAlxoMfc7lsJQLbRYKTEgxlgU99FZtg7XUKL1oMm1shCc 19uW/garAcwUzlZORvMVn479S32rQbwyww== 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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: 10901675 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 EDA0017E6 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 DDE2125E97 for ; Mon, 15 Apr 2019 22:53:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEE2F2882F; 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=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 663E325E97 for ; Mon, 15 Apr 2019 22:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbfDOWxJ (ORCPT ); Mon, 15 Apr 2019 18:53:09 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:33860 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbfDOWxG (ORCPT ); Mon, 15 Apr 2019 18:53:06 -0400 Received: by mail-it1-f193.google.com with SMTP id z17so1148918itc.1 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=fH1kCbJ4hmPA21QIhReKe2foj7M3vIx74qTvDUvwT0CcV2vtVkQ4whkL+g4eqYdTdx Jh0WnFgcPp6JZTgkxZpEmooQkEjUVTPuIdILBvZy5nE/BSVm3UG9JDNss3mKjwZK/6Lz D9JULOpOXH6qMH/olaJR2+jzxz02WFVIm8PRe47ufHw1v9NlnzSweOOsKW9UU/3gj7gd +r53fhqTmnrQQWJY6sLLSju0waBboF9aMWmyC75lS38zsCTxPlxk/VdXEMLGmZxtYp0o 6wwYEsfCZg2OmENqkbA1fvT/7vkXw18T7VUDOIQItVOTu9S7nkBlTPxGbXH8aCZOiDjb iLJg== X-Gm-Message-State: APjAAAVLLag7A3XUQwNxLEqOunzWvbAndnBQokha10ho5xOkEFszdwqr zMTl2KKr5MQGzvqNlkU85LxVg9Ssx+kwSg== 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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: 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),