Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2614447yba; Mon, 15 Apr 2019 15:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB70AfC7QV2A51EfSnDZB1oNHgukTpK5uzPhQ7TfnkSYH26i8AXubobnleVi8ctrYyBQiB X-Received: by 2002:a63:1203:: with SMTP id h3mr74065106pgl.164.1555368871497; Mon, 15 Apr 2019 15:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555368871; cv=none; d=google.com; s=arc-20160816; b=QHOEOsoEAHe7DlDsiQQz698NwrHOjUZf6ug/ZpWERJsq1tE+CcnbPh8tJ2yfu4YBzt 3VbszJepGxtoUxXNZOTQCYAdRrpE8mkn2SCF6zYCcvZ+z9ewK9ocXnvgf2aUG+ri9PpP YcWj5U6tTCfIUF5SA7fi8ArXrQ8g9+f70K6sPt3FDlRCDsleSDY76fzj4K8KoqvU5eCE HNjpKuPvfnVUD7HAAS+0alAVtx3oKopOHWT3eLz6IsM4YDNZ5497ml2mz17RC90wOB7X TNUaopzxV9U1ze9J/LuRBL50GZU/Me3KajLgYo2ipvcgyqpKNRCHCbcKGkrhkY4qtK+5 jyMQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gdPoW9mhfi6soRZh5xEBsWtXHQf+l0G2eEYMV2IVYv0=; b=zHHOo8Y1a9Hdo26yqWsBo78V0R6efkikbuYsrR9gbWoQA6yEVVY10DA9HP8v8cbCjv rrTXdRLb909kaRAB+CANgH0wWiBtGhWFNxeUeDc4fLYRthft0rvFkW7YkXh+lelPObQW w0g9DyQuji29wQn9fOwE/ReICEiznhPDUJ3aizg84QlNhHrFzfUEvpMCtKXy3q55HIHz P4+q1fQBh4vtcBJyWdt/6RNKxLufZi2L7XMD1LnQjbjA+kA5bkdNtlKaQPlwAa4Q/RBw i9xzXpxP6/xem9Mw0IUnxA082gbv9FyZtPZLjt6OW8wHnjPel2a12w4GNz2x2apzsVwg sTdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cb7aaKwi; 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 o11si12671582plk.413.2019.04.15.15.54.15; Mon, 15 Apr 2019 15:54:31 -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=Cb7aaKwi; 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 S1728209AbfDOWxJ (ORCPT + 99 others); Mon, 15 Apr 2019 18:53:09 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:35320 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728193AbfDOWxH (ORCPT ); Mon, 15 Apr 2019 18:53:07 -0400 Received: by mail-io1-f68.google.com with SMTP id p16so16076747iod.2 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=TcgSYQrQRvGWMbze4Io9QyXjiTRWYDBV0/2PQP/zDQaHo2ExVN2SmeNhIXZgdJ8CZ/ mKIHhy2L+d8dFc3o+ZGUKjq6aIee9E5uZNSApegK+gEK4gmIJhdX/UPNttZJeAgLaKoQ j6mcS+yj3HBZdPqU4pWXBZIpzygiMlItJ6iPJ2wG1CF34hvQRSQxH25ziXYu78iqTP44 BucHW0TEGWpgo+vHsLae+TG7MTJATLzsFqdP968OYkEBmIEsJg+wObqARaP6AXk/s3vc KbFaygL5SqhvD/Pqv2XWvLagjfBcZ9i2vD/hgjgNOrA4qtJgyl1Gcxuvp/nZ/Ig3yoEH F5Qw== X-Gm-Message-State: APjAAAVivx1+ipoeZxXPTmNIOT3K3PC0JwY98VCO9YZC3xO3mkgYRzmx chaR65yPyUItSD/XdoU//kf5yg== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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), -- 2.21.0.392.gf8f6787159e-goog