Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4033225ybl; Mon, 3 Feb 2020 11:13:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyudkf09kzYZAy69UqFaBzZ+smbj869+Se/zhz55a8s/gq7wdr7c8QdreM06W0q3iOqM3Y2 X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr19185467otr.220.1580757215213; Mon, 03 Feb 2020 11:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757215; cv=none; d=google.com; s=arc-20160816; b=w/Om4KaD5l/uE0y9LMoZSAeA8lGFtFPqP/+bSSuI03PQL90euryDQrrjjIyCBxanPv FZW8rUSIYAZw1KXfOCHkflAXevqicM5fIj5lclLAoDkiUvLjBMrn7//trJ6PaIdnkscu cC2FqlJjKYh9IZpvV7BB0vXBMfCszEcBU/ca/IB5mdVixMLPpOxxS0aUiPuznhH2N2Oz pqZEzCV7an05ek+tR+GtQlbCT9ejWyJ4Lmqqx23evXV1jBJcTcO4E6r5nBysn71c8+Nk JkTWZJi79h6tj7A6yWvChZ3a+YRXLCsAZSIZrirV3wVteC9tZeEamTAqQw99oVapbYui QwKg== 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:subject:cc:to:from:date; bh=yyjUaK1XPI9Fbm0mWtF0jGF4XAZFyfkDlo22QHc9OSo=; b=acy8gOm+2Gt3xld6bfCNlNvvpdhOfdq/eoXs4YLaKqBvXqZ+nD/ntqkrUxHGW+lmEw NKmZe6zfREscQSRK3e7CqanSmG3CiGNrj4iESMW7mgzNCVytbXUoaCq3KKAIHhtn2Eom LYgmc6uUmmfu1FIZ6ilbYxUe7EDdBRkpPkcC1sUBxS1Ytv0XaAxho068NPzMr60+ml4D Sf2A3PaKUVvG8d4POtRnpoPHyr1hq6TEpZ/BL4rMsUO+rQcgA+LqKZyoWK/V8fNraTyt 21EmpsFFzryZeu/Di/M7oyT8X0TJUOnVq0LyboixV24BzHYb6NYHxFwP32GxpcVA9IVD Y4Pw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si9708366otq.170.2020.02.03.11.13.23; Mon, 03 Feb 2020 11:13:35 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729677AbgBCS0p (ORCPT + 98 others); Mon, 3 Feb 2020 13:26:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:34518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgBCS0o (ORCPT ); Mon, 3 Feb 2020 13:26:44 -0500 Received: from oasis.local.home (unknown [213.120.252.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89ADA2086A; Mon, 3 Feb 2020 18:26:42 +0000 (UTC) Date: Mon, 3 Feb 2020 13:26:38 -0500 From: Steven Rostedt To: Cong Wang Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe Subject: Re: [Patch v3] block: introduce block_rq_error tracepoint Message-ID: <20200203132638.5a37f2f2@oasis.local.home> In-Reply-To: <20200203053650.8923-1-xiyou.wangcong@gmail.com> References: <20200203053650.8923-1-xiyou.wangcong@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2 Feb 2020 21:36:50 -0800 Cong Wang wrote: > Cc: Jens Axboe > Cc: Steven Rostedt > Signed-off-by: Cong Wang > --- > block/blk-core.c | 4 +++- > include/trace/events/block.h | 41 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 44 insertions(+), 1 deletion(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 089e890ab208..0c7ad70d06be 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -1450,8 +1450,10 @@ bool blk_update_request(struct request *req, blk_status_t error, > #endif > > if (unlikely(error && !blk_rq_is_passthrough(req) && > - !(req->rq_flags & RQF_QUIET))) > + !(req->rq_flags & RQF_QUIET))) { > + trace_block_rq_error(req, blk_status_to_errno(error), nr_bytes); I'm curious to why you don't just pass error into the trace event. Looks like blk_status_to_errno() is a function call and that injects code at the location of the call. Note, it is not a big deal as I believe (haven't looked at the objdump of it), the call may be placed in the nop portion of the code, and not hit when the trace point is not enabled. But moving the blk_status_to_errno() call to the TP_fast_assign() will move it to another section entirely. I did see trace_blk_rq_complete() does the same thing, so perhaps that could just be a clean up change after this on both trace events. > + > + TP_printk("%d,%d %s %s %llu + %u [%d]", > + MAJOR(__entry->dev), MINOR(__entry->dev), > + __get_str(name), __entry->rwbs, > + (unsigned long long)__entry->sector, > + __entry->nr_sector, __entry->error) > +); > + Other than my comment above, for the trace event correctness point of view: Reviewed-by: Steven Rostedt (VMware) -- Steve