From patchwork Tue Apr 16 18:32:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10903771 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 63EA5161F for ; Tue, 16 Apr 2019 18:33:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EB20289C4 for ; Tue, 16 Apr 2019 18:33:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42460289E5; Tue, 16 Apr 2019 18:33:29 +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 D46EC289C4 for ; Tue, 16 Apr 2019 18:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728373AbfDPSd1 (ORCPT ); Tue, 16 Apr 2019 14:33:27 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:55453 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730289AbfDPSdT (ORCPT ); Tue, 16 Apr 2019 14:33:19 -0400 Received: by mail-it1-f196.google.com with SMTP id y134so341779itc.5 for ; Tue, 16 Apr 2019 11:33:18 -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=F3GPaWxyQHkj77z2s2eVPCGI01KnC8ViCHmTdyBvcOU=; b=TYgdyooDOXKuuhaht5S5dTCrXIc6mB+6oviKJo14tF4ChMKI0wLDdf3QmJW8ZscNB+ fKSjrQSrEV81py88vVUlJlbjxUy7eMW0FJBjzq8t9voUlRuPpiM7Crpp2tjMjKfEyOe1 4qsbNscB/a3xXglB+tPSE78EmnwpZY50JeAh0= 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=F3GPaWxyQHkj77z2s2eVPCGI01KnC8ViCHmTdyBvcOU=; b=tSzjvXJhg5igH+ad9sBO6JnLqmERm1PFuvth+kxUJKkoT6n+jbGxcCBPsNqV9q74jw sZmTnBsGkeE5mi/18u4o7ssCNeahjfEPjnLXQeRo6+V0qJpRaAqA8lNpRYa127QLJ8xR 1HGCN7leXYHMnK5uDYPPYagZuZJ4hbEn3vpmHy08lQPqUe8LHyLNc2lDfDaS+s5bsMEJ pXR86efJFcndk3XEIT+RD6dcWVGnG98jSfyRnU/IBtszPtU8j1AYm2nrx9nnmK83FX/U KJfoVuuCGoN5UQmAdNGR5+xhg/Bi/fBnDR5Cfcdgd6bCzOACNGzyCIO6MzZKTKq3ZrUx Ef9A== X-Gm-Message-State: APjAAAWF2yLbAKwLh8cunJa8EMg1Yw5ougnBlqGA+A3q77Ef7jg1jKU1 HSwuumesv/xSrMV0z/2FrbC2Ud5WNRDblA== X-Google-Smtp-Source: APXvYqyUEAIZVeWfBmzRRg9tdYk+hBJwi3c2BMG1LanJailJTOvWT5vm8VLN+5bDqavqhvrdcAMEOA== X-Received: by 2002:a24:4161:: with SMTP id x94mr31426514ita.83.1555439598146; Tue, 16 Apr 2019 11:33:18 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id m25sm92094iti.24.2019.04.16.11.33.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 11:33:17 -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 v2 4/4] mmc: core: Add trace event for CSD response Date: Tue, 16 Apr 2019 12:32:57 -0600 Message-Id: <20190416183257.247902-5-rrangel@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190416183257.247902-1-rrangel@chromium.org> References: <20190416183257.247902-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 | 29 +++++++++++++++++++++++++++++ 3 files changed, 35 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 908c3087cdcd..3b2e09fa72c5 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 8d97810221cd..46fd918bcae3 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -185,6 +185,35 @@ 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( + BUILD_BUG_ON(sizeof(card->raw_csd) != sizeof(__entry->raw)); + memcpy(__entry->raw, card->raw_csd, sizeof(__entry->raw)); + __entry->structure = card->csd.structure; + __entry->cmdclass = card->csd.cmdclass; + __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),