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),