Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4093367ybl; Mon, 3 Feb 2020 12:26:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzbnsB4wM9vKBIjULcRs9vpOYzuzJRqPhrPpaXpBJ33W4qeU616Z6IVJHtdVkA5otHoVcfD X-Received: by 2002:a9d:7f16:: with SMTP id j22mr18922580otq.256.1580761570646; Mon, 03 Feb 2020 12:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580761570; cv=none; d=google.com; s=arc-20160816; b=MdeONew9SkF4RwmwQWZOoN7+/DmqMstmLPHOHeodQlnDUr+G9syDM4zJgmDvibQz6h ovPjiz6oOFMVwo9pgYz1TLYBuzvBjeI882Dogcz21ZfJjkd9TQGixoKXLmj8vwJosx5F ntCNXr85s4dADbxOLCx2tpEBSRkBwvssM7q4z19rcGJ9lbUjxRQNy1ibfZR6DZ49oe72 i/iDYdQVmjoHBEWzXADZZ3kItOiPFwRm3bUyg1Aw+excebiFWI84cA7aoaMs5AWeHzR/ hZAypfzfSgd/uogSkOL64zcPh1OGN7lrUdue2olXJrO+NLdlUIqAz3CxqBF1U1hdTato yADg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=63jW789sY3VX7ra4EKkFoe9ytZPPkm7N/YVQQ2sxOY8=; b=wO8FAI7QatjflkdgWwpSQhCG16rPWmYVryGmycFLnvPjDe55CSPxDMwi8HViEZyYSG aLIwj9UbH6RjLnMp+MSvTxh8RZqp8Klp+pz2B4bV+sHV3Ysf3Mc0HIfgEvjQmsVP8p6k U9KJxEKUyIs1lgXCr85Mcvp+d5Pwl1dqT+1fNKiXQRXAWcTwoW8dM8s+2uLxbxkWNTOy AdeDgtrowLWNzFGUV6RvgfmT+sAUwvZmJSjiRXuCh1y+uIdQ95HtCItbz3bRBI3v40XC /YEDSumdzFoC8T5/Jt6bYsd7eZgpYQDbvIvP3MUpJqAZASiqwHAakkdDEPGoOxSQV9rn KyRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+hJJMEv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si9366927oic.183.2020.02.03.12.25.58; Mon, 03 Feb 2020 12:26:10 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+hJJMEv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbgBCUZH (ORCPT + 99 others); Mon, 3 Feb 2020 15:25:07 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:41136 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbgBCUZG (ORCPT ); Mon, 3 Feb 2020 15:25:06 -0500 Received: by mail-ot1-f67.google.com with SMTP id r27so14919587otc.8; Mon, 03 Feb 2020 12:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=63jW789sY3VX7ra4EKkFoe9ytZPPkm7N/YVQQ2sxOY8=; b=W+hJJMEvibBQG+2lpzi0dxIHmJ4geJ67wEvz/1FJ+pZdxfv+B5J+7vbjefvy9MNDyq Ae/32M22wmqs8GKnWhcRLh95ObdACtQ3B/JZJqZV0yr/cl0O5F+G+Kt4zAmwA+h4AO34 wWX/7yQSfK5XjAE2C3Q/Esgl95vPdtAcegYIYluUMpLbuHoaxbtiIZyL0YT8mergG2wi qejT/jl+CRmsDP+SipknbOnSEgL+bPpSVt00D95tVC5uCFfZ0BoZrLyDp/oLzrtY7Oe0 hRF6TQ7MeJ97OcgT7pHIIbUgzEbWa0MtT60OOhwxIpf2Xsv+AEnNVx8WY+gdhdWLHq7s Jc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=63jW789sY3VX7ra4EKkFoe9ytZPPkm7N/YVQQ2sxOY8=; b=sa1RJdqzUbSpTzL9oah2RW1yf+N2ddLu3EuGxsMa8dBU7Trcg2/d5V2xTJGWlacUsC JSqUgrEtY1hFdX7vx9luRapgsBO9ju0pJZHKNdhJyISjX2enGDQtLxy0wnxiUtY57z45 Lg4acjsDcgyQS6y6VnVrJFBYWtas2mtSYVwGQwGWzbDm/E5tlTqE9q1ETPe7W7jEtz4x D3MHROexy4URTUpH95jOFJ63TGXbeNZr1xR4D0omnoSlEGsKCGBTy4edShfrU2hzOAyh lJHIcJkKa0pu9FJBRdvs+cWSqiPQpN4eNyCVLJX7KHQJJNQXZgrgQAtSAvWcTeTNrHlS nwvw== X-Gm-Message-State: APjAAAXzRIX+PIRG02YEARWzTIYP+UsQ1E8EnJjEFOReUUlp8IjnnW7k QF/E2dTL9rPWigOK9/ha+1IDn4R7qAdk477KuPtVSnItYAA= X-Received: by 2002:a9d:67cc:: with SMTP id c12mr13084936otn.319.1580761505743; Mon, 03 Feb 2020 12:25:05 -0800 (PST) MIME-Version: 1.0 References: <20200203053650.8923-1-xiyou.wangcong@gmail.com> <20200203132638.5a37f2f2@oasis.local.home> In-Reply-To: <20200203132638.5a37f2f2@oasis.local.home> From: Cong Wang Date: Mon, 3 Feb 2020 12:24:54 -0800 Message-ID: Subject: Re: [Patch v3] block: introduce block_rq_error tracepoint To: Steven Rostedt Cc: linux-block@vger.kernel.org, LKML , Jens Axboe Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 3, 2020 at 10:26 AM Steven Rostedt wrote: > > 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. Yes, it is clearly another copy-n-paste of trace_blk_rq_complete(). I trust the current code base as I believe it already passed your reviews when it was merged. It looks like not the case. Anyway, I am happy to address all of these in a followup patch. Thanks.