Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2614146yba; Mon, 15 Apr 2019 15:53:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTV4qfhuUFR6KbDf4ErZzh3HuwIV4cW4X5A3LlyGOwGrCHRmmiiBPf4spU+ewkDO79A3qb X-Received: by 2002:a17:902:ab91:: with SMTP id f17mr13867197plr.151.1555368839851; Mon, 15 Apr 2019 15:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555368839; cv=none; d=google.com; s=arc-20160816; b=s25kaUySDqV8k1p1wfpyBoodoqjt7bPuh1ZzhKKqW/DGg1fOKWtdisO289ADoFUlzU FbZEEAIK34gs6nLOgLh3KUyvoGk2P1VDtxL5ruJ48Qwdd5f9V+cAMsbN5NVrvH/LMq22 HzcEWCyHU81pROZmNrTWDuZ8jU0xxDoU2JJYAGrtH4PA6n9fXK4a7ezAAaZZ3C9hdYAF aKKP9+8nNIHapRQ4l6WwNxo/Ubqfm2WeFhsc1Rcr7FpTAUg7qtGT/a9wcNsvLfiQ55eu 5hiUTV0HWx8GHrOKnS83Z7G9WZUgk7KrUb6BP2phCSNnBxnm87OOE1Z8E5Y8vTH249x/ HAcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ne5pjde4HF9lJsw056hcCinTNwk9gZ4Gsc2PETazukk=; b=CNcDRkFBA1YlJKb0q/y40VpXxw6YHK3LMqZA79TPh3bQt6BXfJJ5zWIrTA6HNfnxxP ZM3cPxM2kdWpWDUWQf4J+hRmb6CQu6y8U3paUBTGUKrds/rxJqrIlia+OjXPaTxvkjxf OEcS12J8dsrBuFZZJQn3ZDsxWSLC2+s3fxRktfV9FlClycIDLxupIfpd7FgJf9uF8+uS aU5cEaEy4bFLq2Y8zkcoDOofw+PE9MVIQPpqVta0DrBul2jobPcOC2CqnuNA3GsKqDR6 S1ADW2hb8nWg+gHayfmKfvMtkhXzTlhqZPDo7tnYWCb/qbwx6TC2tGs34ZNomr2HGXwT BjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SLWChC7s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si22001671plp.361.2019.04.15.15.53.39; Mon, 15 Apr 2019 15:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SLWChC7s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbfDOWxB (ORCPT + 99 others); Mon, 15 Apr 2019 18:53:01 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39368 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbfDOWxA (ORCPT ); Mon, 15 Apr 2019 18:53:00 -0400 Received: by mail-io1-f66.google.com with SMTP id e13so16041380ioq.6 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=GqvxlIhOxN5GPerahF1cwonwLL2I76lSsK+Y9/TU8ZdAnluxaS8mvrT6nrYnE1kOld hDzQdnuWkUwuZ03MOspe0ZTdoaYZlcdzQUXuCWHMSS7Aoe5d5sQxqKsreOMDHyp++73K Rb9N2QK1Jt6bDStjzF0h2Mf5qV5QofMMrG8GtrEvx/FGNsfmSWR5HRTPMV+E3c24XQm3 1c4Rm1SI5Ja/QNHGRr8eCOFPt5DtNiVddJo5MrBew3cvK55IvEFpLpRpLWz9rq0kyhz3 2rAyXCgtfAR/OHJUpfZJ+BGug+eba1dn2uq8ZC3id8DP6EbWnHnP71rbp3bJ2DbAnM5P WL/Q== X-Gm-Message-State: APjAAAWzUSZEEr1tnql3JYiN2zhcVK7rJHE+y100dllqhiWBrY3LgxE2 jL4B3iX7A+fT8TFmyA9N6GQXPg== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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), -- 2.21.0.392.gf8f6787159e-goog