Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp662301pxb; Fri, 28 Jan 2022 07:29:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS9c2+MmSaNa1NJpbtc7+7sth83ClscqPgnmfLP7YzL3+U2FM8bCEF0h8XoxxJ39DTUNwd X-Received: by 2002:a62:e508:: with SMTP id n8mr8799801pff.83.1643383788139; Fri, 28 Jan 2022 07:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643383788; cv=none; d=google.com; s=arc-20160816; b=em/8EPW98qjUbxahH4AOgwWxRYbRavPjbCMaHkHJO0SBWP7/Zmp5Z3UNuzEDf7zbYe NqEixqGproiQInX60GFVbaAh9uH3kyvf3Iic22gWRZ8RCb60BeeCGSngKP62v4vMcB11 bqZLZQEaa4GQHc/gMt+QtLK/onrKulmkCA8WAmOog24qzcyciatgFijJaegZfJeoGjtG hCiZOQEIjFPyBt5pzC24jS8zDBNMpGgALbS08VF0KXwKtUH5ul8Ia9EgahGfutK+GWKG P5AyEEMFKZ8n/mUfxgRIFpShd0EfQyHWrxzRbtaFKpPZwgH188Gkph24ZWuR9UG9s4td wa7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7xHTfty/6qjJB9GUu+F5khyO+ticx0XfQj2FfNXTPBg=; b=PrxXmk9yEpi1f+5MvkBW8M7SoA9KsvljJbGHtmu0gZgtRCZo2h/yZUNW9/gHaxV7u4 1t4B3pBPCH8rCVsUIPX+xNMuWiPYtGd0qxlanO5hbq6RNDl/iRRBzt4l5+rS1f8N0QKc Z4A6SOTbhnsVGUL1G+5sc9yC4RYj1axKYH6oRNTjnLQI8oI7O++0gf3jB1tYVgKxGpHU /iLqC5MxswNCpKflVDqicBlw3bcJ2ftjXjZpwlC5PC/auQie4O3sk+u48o8Dk3sktszu hYiThWp8vhXApdRteFWf/XchIkeLGKbd/GStNvbf/k2h8QCcU+5CmQccB1ZPRnpHMLfl N0EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hWpc0eVT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id f8si5972144plg.281.2022.01.28.07.29.34; Fri, 28 Jan 2022 07:29:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hWpc0eVT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S239730AbiA0SSU (ORCPT + 99 others); Thu, 27 Jan 2022 13:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231634AbiA0SST (ORCPT ); Thu, 27 Jan 2022 13:18:19 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C893C061747; Thu, 27 Jan 2022 10:18:19 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id j2so7724338ejk.6; Thu, 27 Jan 2022 10:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7xHTfty/6qjJB9GUu+F5khyO+ticx0XfQj2FfNXTPBg=; b=hWpc0eVTVZ1XxVX52Awg0oiO4DRZUWuE4geKSONsXE6eydbHyAjNJmoInBa+d3HBmr pR2BFAyP5s+TwDLhDELSCXejZd/pbcfm8Uo+b4ueLAqOPnQ8bIWDEBY3AoupZPpTS6qU k4eCKiRP1NMHY7zstlfeftFe5zSfkBW7CAeG99frZ80UWE6JNxME4k72/boojLaoNiz0 sjassiUUY0a4vUFHmemDFDgiKTF6JBe+8lZI3pPrHcLIfVJyOGuY6sdH0CYi1qWYpiN+ NSykpA0Co7pwVNYcWNd/rCPJgs9Gkiek8VorISss69/qC1VEPT4yMPk4t1yNi5ZsoG5s EyxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7xHTfty/6qjJB9GUu+F5khyO+ticx0XfQj2FfNXTPBg=; b=JmMPp1Ap3mORwgXopNcxSX5Q8EkH1k8YwRTIVjTa7pLUes0rcS6F9BTcTYBrw9dTiP gJ0xTjrnrVnXIGRnD/wIJv7XNIDsY46wSBp0H9ULSXk3YTgLE4KRGHb6MqVzHoacPAGY 5jlrZBrmXkKLYM2nG6H9sdNL4NqXk3g88g4H6+sNxaow/663+3cOKSVUd4KJ8ZSVKayY 4f8iDRAFdVy/9pnaHAB1iIVUb9emlcnxrKMfczI420ZdPT8lGPP6A6wDLjeu0T2keCUg itwt5jnFaPscvxznIx8xMcaV1ZWMs6hODeK9TADgj9bdqFh/I/VfC9VPpi4sUdS3lw19 Fd5A== X-Gm-Message-State: AOAM533nGidjYFQdrB7wJSGtQpxkaaIM5gtAF7AG+IEjMTCR+HZx3XFK IXv9/k3CjhNJO0tLDb+uiIpDv2coTS/SXyzUhZyzQCHwuCeSPA== X-Received: by 2002:a17:907:6089:: with SMTP id ht9mr3792241ejc.612.1643307497685; Thu, 27 Jan 2022 10:18:17 -0800 (PST) MIME-Version: 1.0 References: <20220126185153.417948-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Thu, 27 Jan 2022 10:18:05 -0800 Message-ID: Subject: Re: [v5 PATCH] block: introduce block_rq_error tracepoint To: Christoph Hellwig Cc: Jens Axboe , Steven Rostedt , Cong Wang , linux-block@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 1:53 AM Christoph Hellwig wrote: > > On Wed, Jan 26, 2022 at 10:51:53AM -0800, Yang Shi wrote: > > + __entry->dev = rq->q->disk ? disk_devt(rq->q->disk) : 0; > > + __assign_str(name, rq->q->disk ? rq->q->disk->disk_name : "?"); > > None f the other tracepoints has the disk name, why does this one need > it? And if you add it please avoid the overly long line. I guess the disk name was added to ease some handling in userspace tools. But if all other tracepoints don't have disk name shown, I think I'd better follow the convention. I did overlook this when I ported this patch. Will remove it. > > > + __entry->sector = blk_rq_pos(rq); > > + __entry->nr_sector = nr_bytes >> 9; > > + __entry->error = blk_status_to_errno(error); > > This still converts the block status to an errno. I may misunderstand your comments. I just followed what block_rq_complete tracepoint does. Or the linux-block community is converting all tracepoints to show blk status code instead of conventional errno? And the userspace tool doesn't know blk status code and still expects the conventional errno. For example, rasdaemon reads block_rq_complete events now and have the below: static const struct { int error; const char *name; } blk_errors[] = { { -EOPNOTSUPP, "operation not supported error" }, { -ETIMEDOUT, "timeout error" }, { -ENOSPC, "critical space allocation error" }, { -ENOLINK, "recoverable transport error" }, { -EREMOTEIO, "critical target error" }, { -EBADE, "critical nexus error" }, { -ENODATA, "critical medium error" }, { -EILSEQ, "protection error" }, { -ENOMEM, "kernel resource error" }, { -EBUSY, "device resource error" }, { -EAGAIN, "nonblocking retry error" }, { -EREMCHG, "dm internal retry error" }, { -EIO, "I/O error" }, }; This patch aims to add block_rq_err tracepoint to replace block_rq_complete in rasdaemon.