From patchwork Tue Apr 16 18:32:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 10903767 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 BF1CD161F for ; Tue, 16 Apr 2019 18:33:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AED62288F4 for ; Tue, 16 Apr 2019 18:33:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A842289D7; Tue, 16 Apr 2019 18:33:16 +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 4F76E288F4 for ; Tue, 16 Apr 2019 18:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730249AbfDPSdP (ORCPT ); Tue, 16 Apr 2019 14:33:15 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:52367 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730248AbfDPSdO (ORCPT ); Tue, 16 Apr 2019 14:33:14 -0400 Received: by mail-it1-f193.google.com with SMTP id x132so374686itf.2 for ; Tue, 16 Apr 2019 11:33:13 -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=TIDqxxqztE2jOgZOgI8qrgI9gmHi2GmWCm0V06l/nB4=; b=CUt74S70/N1xpKsCTnqgFUJlJf8322fRk0pGHzVvVRn4Qv2APnTP2H6nvTQnyhonY7 HlOPEne5p8nDJkvSsL8FNmWkuHODyXn7C7Smm5P97HSXfE39EbihL5+9+kVl0ZrGdFkn Q03tlXUZ23xxqwOKAO5jcZyfBPymoG7vINi30= 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=TIDqxxqztE2jOgZOgI8qrgI9gmHi2GmWCm0V06l/nB4=; b=EzZsyN6NFaOcVWjj02++aJ375zwvSOOfnrEK3b9UTxMZByVf2XqJaAuZMLEnLQPMtj 65Sw1nKadQVWPja6gsO1c7OM8U8BvfZaMeB4kx+vyIDgerGjJkqQNa9ubKI1QDdojPuF WTzpcyn4uM5g8aqSbqUbXLynksdkobAzVdDBBM4GYGzBCcRWs1TDldZ1ZGNVTkNFmmah YrxRisFojjP65JaweRKqwS15pkIKdxwi5zOhmKh7SwWeSDkWtaYU2dpWUzWWDcxS5MMf PzLoyQYqBra/psKseiodAgMGu7PaEl+lNBy1/9rsthXCfD9jBRN2QS7FXGBt1heRsgfW z9zw== X-Gm-Message-State: APjAAAWM+Vha1XX1yOwcqQSaoI98Lp0ftZnY7a0iaSAVdUYZ4Fqjsq+d eGgDPb00mMdwKVEnx1BwX3hkOtB/nbIrbw== X-Google-Smtp-Source: APXvYqxnB/KycclqM0AuhAq3iK59bz4PqOUVtPK2s9yABsRN20ILC34p4x3ITbTV7bRxO/Zn8yeX1A== X-Received: by 2002:a24:bd08:: with SMTP id x8mr26681438ite.46.1555439593029; Tue, 16 Apr 2019 11:33:13 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id z24sm19096762ioi.67.2019.04.16.11.33.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 11:33:12 -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 v2 2/4] mmc: core: Add trace event for SD SSR response Date: Tue, 16 Apr 2019 12:32:55 -0600 Message-Id: <20190416183257.247902-3-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: 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 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index f1772972d6a3..908c3087cdcd 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -292,6 +292,8 @@ static int mmc_read_ssr(struct mmc_card *card) card->erase_arg = (card->scr.sda_specx && discard_support) ? SD_DISCARD_ARG : SD_ERASE_ARG; + trace_sd_ssr(card); + return 0; } diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 9761d3db16db..463cf318d762 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -61,6 +61,38 @@ 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( + BUILD_BUG_ON(sizeof(card->raw_ssr) != sizeof(__entry->raw)); + memcpy(__entry->raw, card->raw_ssr, sizeof(__entry->raw)); + __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),