Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21845089ybl; Mon, 6 Jan 2020 12:27:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyWytWNYnfMtliyzRHvRBVIMcKXtxMejLkdzuqyy+7KutaYgs96y6BZpEoRF5H2+ITiex77 X-Received: by 2002:a05:6830:1b7b:: with SMTP id d27mr122036714ote.78.1578342470013; Mon, 06 Jan 2020 12:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578342470; cv=none; d=google.com; s=arc-20160816; b=bpMqugn2TBC8PitQ2E/zu1Mpdu3TtB/fIMfZVIB8LXQh+2iRhBqtdg5KxfFIeEh6Uj 4RT91gwAXSaLUHZTxE7ITW2dsNkIVmwDyW8FmrIc1HrWohxuRS9/x1VdrhV7oybDOLk0 SSQb3vGhN43MKxDj+P5LZscNpcgo31gOyUYp2smR3GD2H49nQTfVgB9T4ppPpuJ/oVCE AQT3/OBDagfMV3j6rvbHqpPzPAGIQawnGr1KH8ytpVwwrvcqhlahT7gj3EgWYvmV/itz GGQnXDxpFoB83CHSqq9kLT6kZMnhQha3O3qYFstd2O5gGwKoi+6X0pCZ2Mkv9TbKtSI8 9Kjw== 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:date:subject:cc:to:from :dkim-signature; bh=wcZPSAaV+lXbnJO92q7MX1Hbs9Frrjeym3R6iqB+2CM=; b=MbQDhnoWwdfHqcY+3fwjZTWTCN7srJy2868m4aeo6IRKXOTjUfgy56OyxVuByQFg/q C0UwgJuq9cxmyCtFadXbVp7tEF1DYlBrpAmVuFpCgbnVEZsNe8/kOvQhpBwda+mEAnlx xDmfaWolpFb+rAaUbaQmo6TSoUp8fMw2XZmZ0byqNprGOdQGUYSsSdk3PDqhXafIJivk r+oGq54gwtYESqb2SsNN9NRiXNgPD/yjzqyTwS3kZuts3JqI2/a6Z2c3aDxHE83JJ6IN caMMFGA83YzWQt1gZJ04fbEaGj6P8Rms0E5ccrti437luExJ3w7dv1O4buUEwJlSD28i C99A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aegktrfz; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 n203si32847812oia.112.2020.01.06.12.27.39; Mon, 06 Jan 2020 12:27:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=aegktrfz; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 S1726751AbgAFU1i (ORCPT + 99 others); Mon, 6 Jan 2020 15:27:38 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:35137 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbgAFU1h (ORCPT ); Mon, 6 Jan 2020 15:27:37 -0500 Received: by mail-yb1-f196.google.com with SMTP id a124so22628914ybg.2 for ; Mon, 06 Jan 2020 12:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wcZPSAaV+lXbnJO92q7MX1Hbs9Frrjeym3R6iqB+2CM=; b=aegktrfzz6S5Ccmwm8mjYyoc9Jy/oulwL22GZW2xvH1G5b2coKD3UdBndYOt41SJZD Kct8XtBmQX2m9j4Uk00SIqF1BchJYbs0YwfwEt04adR7g1ctHBKZpa55VC4N8AvEDHaQ U54ZUaYo68YRTJ7JtxNTFfCnk2GjEwxmj9xDVilmIdoTjKekeCMJM/0xB2YET6wKaZlp UH3ckVDagg56oPnCCjHCrtcFtqD4KJahXy9gDqOIloOo+I90ZfpJmsgSo3i5PBZe0+W2 2B/c9yYwJwYVKcs3u1MD9vtGlP7DL18Pz2P/63u+j12+Y5cP9mSJ5ebAkJ73yGwIn0LH 1b8Q== 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=wcZPSAaV+lXbnJO92q7MX1Hbs9Frrjeym3R6iqB+2CM=; b=hvgyzgFFSizFekUrtFVBQbROT/f332JDqo0xtXmiJNdYx/CVWS6k2ElXEV9RpWhz9h pEc9okT3TJwT6NNCSMAYByfMp7IVKYHVxpXn2gSJLU+4FZc4Vvhrw/o/JVuH5MZCyL1m 3ElGPc0fsxN6J2dXJ52IidLCOiZAYqnRZPdKdfOPv1NLjS0RKSat+VnFRY3TT6tsyPsJ G/MeXN9HmD6no6jhhEOB88fupCvUQWDhDGejH08Rvt40NBj1Z9InT5FG7mEKsrXqOHuc PXBbsGb+Li7EHoBfDf4b2ABNd37wvbMk5pXVIyI9cid/7S9iLEGurRXbn5r64FqNUS8p rh/w== X-Gm-Message-State: APjAAAXIgDKg4Ryzvn0ckg99cih8RpmTa8X5gsZtDJSMdvCKJvSrmfZW Tb0dhkiKp0JnRmEmBMv54Q== X-Received: by 2002:a25:7ac2:: with SMTP id v185mr44063169ybc.331.1578342456408; Mon, 06 Jan 2020 12:27:36 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id l200sm28723579ywl.106.2020.01.06.12.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 12:27:36 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 09/15] NFS: Clean up generic file read tracepoints Date: Mon, 6 Jan 2020 15:25:08 -0500 Message-Id: <20200106202514.785483-10-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106202514.785483-9-trond.myklebust@hammerspace.com> References: <20200106202514.785483-1-trond.myklebust@hammerspace.com> <20200106202514.785483-2-trond.myklebust@hammerspace.com> <20200106202514.785483-3-trond.myklebust@hammerspace.com> <20200106202514.785483-4-trond.myklebust@hammerspace.com> <20200106202514.785483-5-trond.myklebust@hammerspace.com> <20200106202514.785483-6-trond.myklebust@hammerspace.com> <20200106202514.785483-7-trond.myklebust@hammerspace.com> <20200106202514.785483-8-trond.myklebust@hammerspace.com> <20200106202514.785483-9-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Clean up the generic file read tracepoints so they do pass the full structures as arguments. Also ensure we report the number of bytes actually read. Signed-off-by: Trond Myklebust --- fs/nfs/nfstrace.h | 56 ++++++++++++++++++++++++++++------------------- fs/nfs/read.c | 5 ++--- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index f64a33d2a1d1..f0e869d21368 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -820,75 +820,85 @@ TRACE_EVENT(nfs_sillyrename_unlink, TRACE_EVENT(nfs_initiate_read, TP_PROTO( - const struct inode *inode, - loff_t offset, unsigned long count + const struct nfs_pgio_header *hdr ), - TP_ARGS(inode, offset, count), + TP_ARGS(hdr), TP_STRUCT__entry( - __field(loff_t, offset) - __field(unsigned long, count) __field(dev_t, dev) __field(u32, fhandle) __field(u64, fileid) + __field(loff_t, offset) + __field(u32, count) ), TP_fast_assign( + const struct inode *inode = hdr->inode; const struct nfs_inode *nfsi = NFS_I(inode); + const struct nfs_fh *fh = hdr->args.fh ? + hdr->args.fh : &nfsi->fh; - __entry->offset = offset; - __entry->count = count; + __entry->offset = hdr->args.offset; + __entry->count = hdr->args.count; __entry->dev = inode->i_sb->s_dev; __entry->fileid = nfsi->fileid; - __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); + __entry->fhandle = nfs_fhandle_hash(fh); ), TP_printk( "fileid=%02x:%02x:%llu fhandle=0x%08x " - "offset=%lld count=%lu", + "offset=%lld count=%u", MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long long)__entry->fileid, __entry->fhandle, - __entry->offset, __entry->count + (long long)__entry->offset, __entry->count ) ); TRACE_EVENT(nfs_readpage_done, TP_PROTO( - const struct inode *inode, - int status, loff_t offset, bool eof + const struct rpc_task *task, + const struct nfs_pgio_header *hdr ), - TP_ARGS(inode, status, offset, eof), + TP_ARGS(task, hdr), TP_STRUCT__entry( - __field(int, status) - __field(loff_t, offset) - __field(bool, eof) __field(dev_t, dev) __field(u32, fhandle) __field(u64, fileid) + __field(loff_t, offset) + __field(u32, arg_count) + __field(u32, res_count) + __field(bool, eof) + __field(int, status) ), TP_fast_assign( + const struct inode *inode = hdr->inode; const struct nfs_inode *nfsi = NFS_I(inode); - - __entry->status = status; - __entry->offset = offset; - __entry->eof = eof; + const struct nfs_fh *fh = hdr->args.fh ? + hdr->args.fh : &nfsi->fh; + + __entry->status = task->tk_status; + __entry->offset = hdr->args.offset; + __entry->arg_count = hdr->args.count; + __entry->res_count = hdr->res.count; + __entry->eof = hdr->res.eof; __entry->dev = inode->i_sb->s_dev; __entry->fileid = nfsi->fileid; - __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); + __entry->fhandle = nfs_fhandle_hash(fh); ), TP_printk( "fileid=%02x:%02x:%llu fhandle=0x%08x " - "offset=%lld status=%d%s", + "offset=%lld count=%u res=%u status=%d%s", MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long long)__entry->fileid, __entry->fhandle, - __entry->offset, __entry->status, + (long long)__entry->offset, __entry->arg_count, + __entry->res_count, __entry->status, __entry->eof ? " eof" : "" ) ); diff --git a/fs/nfs/read.c b/fs/nfs/read.c index cfe0b586eadd..12deb3bdb2a0 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -214,7 +214,7 @@ static void nfs_initiate_read(struct nfs_pgio_header *hdr, task_setup_data->flags |= swap_flags; rpc_ops->read_setup(hdr, msg); - trace_nfs_initiate_read(inode, hdr->io_start, hdr->good_bytes); + trace_nfs_initiate_read(hdr); } static void @@ -247,8 +247,7 @@ static int nfs_readpage_done(struct rpc_task *task, return status; nfs_add_stats(inode, NFSIOS_SERVERREADBYTES, hdr->res.count); - trace_nfs_readpage_done(inode, task->tk_status, - hdr->args.offset, hdr->res.eof); + trace_nfs_readpage_done(task, hdr); if (task->tk_status == -ESTALE) { set_bit(NFS_INO_STALE, &NFS_I(inode)->flags); -- 2.24.1