From patchwork Mon Oct 18 22:03:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 317A2C433F5 for ; Mon, 18 Oct 2021 22:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 114206108E for ; Mon, 18 Oct 2021 22:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbhJRWFg (ORCPT ); Mon, 18 Oct 2021 18:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRWFf (ORCPT ); Mon, 18 Oct 2021 18:05:35 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4318EC06161C for ; Mon, 18 Oct 2021 15:03:24 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id z24so16597794qtv.9 for ; Mon, 18 Oct 2021 15:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nVoS5w1IrXH+haMLOz031DTVO/ebBe9DItCLtnwvfWM=; b=B1ccfEeOe9hKmmZFHvA+nslOGPbsBz5Kuf1eAYJWIm16vrx0SwXjETPOpzw3aza0Bh otKtQThseGU0ABwbctFb06JPHtn6S06CZTfQG0fmbfA03IuLCdgRxOkgypDY3Qrg9rhJ cR8w2ghBWdE+qORpV9Wi/QWtwxW+B04dUIUzzPQmIn2Qx3agw1xZ5Ug3VCcIkKT2dfAB vPwOjbSVdaPh189f1daPw2XsN3fJfoH0vqte6UcnrTjuJE9dZfc61LVKMg15xW4Enbdo 490m2N2ljk0JXm1FVGrBcrYyAseYq7dkmb2MvgyQozm/1QLXD9//jJ0lpf16HlJkdcdu BCAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nVoS5w1IrXH+haMLOz031DTVO/ebBe9DItCLtnwvfWM=; b=V3X8bIyWrUqze+nPQdq8KGlUTWXnmKSQTwTanDft9zU58JRlPzDGAWykSH8avAZZ4u 5dGhAKG6ghjtrXq1DB7h6x1V+gfmuz14dD3UJ2nfySkg4XAcT7foZdysUtBe+UHFi4+m yZIMukqVDhi7h1K39vJh7T/OPF9533UHYKmHf3KOK0B4iFVKTv/HPwIBYqE73Ce5JkV9 f1ZEBF3oHV1MRz1qzH4QwObY04A0JKVYqjUDc+Enqg8lm96YX1AYhGd+xs21ZEaCmbQU GnJ2g7XCp2ppA6PBg0ref03nv0iQnjMd6TbAoXQXjqrd0jRFB6XQNFRTBLf2BpNlXYep JoYw== X-Gm-Message-State: AOAM531vbP4TnyQzZuQNOh6WErKY7J3ZJM5kf/Pj8b2asn/4S0qp3uyY WPjkTQxHVG1Rl8OnVC7+Pyk= X-Google-Smtp-Source: ABdhPJxE7pNCwfxDwVYkBUZDehkFfp1avyeo8Pjkl9ysSjnT/eLGFCsdpfzUuJHNmeZzjdcc+alCFw== X-Received: by 2002:a05:622a:1301:: with SMTP id v1mr31947195qtk.233.1634594603425; Mon, 18 Oct 2021 15:03:23 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:23 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/7] NFSv4.2 add tracepoint to SEEK Date: Mon, 18 Oct 2021 18:03:08 -0400 Message-Id: <20211018220314.85115-2-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to the SEEK operation. Signed-off-by: Olga Kornievskaia Reported-by: kernel test robot --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index a24349512ffe..87c0dcb8823b 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -678,6 +678,7 @@ static loff_t _nfs42_proc_llseek(struct file *filep, status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0); + trace_nfs4_llseek(inode, &args, &res, status); if (status == -ENOTSUPP) server->caps &= ~NFS_CAP_SEEK; if (status) diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 7a2567aa2b86..81dcbfca7f74 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2417,6 +2417,71 @@ TRACE_EVENT(ff_layout_commit_error, ) ); +TRACE_DEFINE_ENUM(NFS4_CONTENT_DATA); +TRACE_DEFINE_ENUM(NFS4_CONTENT_HOLE); + +#define show_llseek_mode(what) \ + __print_symbolic(what, \ + { NFS4_CONTENT_DATA, "DATA" }, \ + { NFS4_CONTENT_HOLE, "HOLE" }) + +TRACE_EVENT(nfs4_llseek, + TP_PROTO( + const struct inode *inode, + const struct nfs42_seek_args *args, + const struct nfs42_seek_res *res, + int error + ), + + TP_ARGS(inode, args, res, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, fhandle) + __field(u32, fileid) + __field(dev_t, dev) + __field(int, stateid_seq) + __field(u32, stateid_hash) + __field(loff_t, offset_s) + __field(u32, what) + __field(loff_t, offset_r) + __field(u32, eof) + ), + + TP_fast_assign( + const struct nfs_inode *nfsi = NFS_I(inode); + const struct nfs_fh *fh = args->sa_fh; + + __entry->fileid = nfsi->fileid; + __entry->dev = inode->i_sb->s_dev; + __entry->fhandle = nfs_fhandle_hash(fh); + __entry->offset_s = args->sa_offset; + __entry->error = error < 0 ? -error : 0; + __entry->stateid_seq = + be32_to_cpu(args->sa_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->sa_stateid); + __entry->what = args->sa_what; + __entry->offset_r = error < 0 ? 0 : res->sr_offset; + __entry->eof = error < 0 ? 0 : res->sr_eof; + ), + + TP_printk( + "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " + "stateid=%d:0x%08x offset_s=%llu what=%s " + "offset_r=%llu eof=%u", + -__entry->error, + show_nfsv4_errors(__entry->error), + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long long)__entry->fileid, + __entry->fhandle, + __entry->stateid_seq, __entry->stateid_hash, + __entry->offset_s, + show_llseek_mode(__entry->what), + __entry->offset_r, + __entry->eof + ) +); #endif /* CONFIG_NFS_V4_1 */ From patchwork Mon Oct 18 22:03:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E39C9C4332F for ; Mon, 18 Oct 2021 22:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C329F6112D for ; Mon, 18 Oct 2021 22:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbhJRWFh (ORCPT ); Mon, 18 Oct 2021 18:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRWFh (ORCPT ); Mon, 18 Oct 2021 18:05:37 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734E7C06161C for ; Mon, 18 Oct 2021 15:03:25 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id w2so16683966qtn.0 for ; Mon, 18 Oct 2021 15:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cogJl55oH07jqSg9ApgLWtmllTmSQaA7OXtfg1PRhgk=; b=mlrayVnA0rWKrEDsmBWsfyxitNHuv0o+y1Z076dv1a7GX71j2b+9Tkp4LtOqmYmSe/ ALLQo/HLRtpI/UwGh9c0lV7rpbgezZDwRqdFzSQ4IDWx7um6/DMSwa3uki/rdh12TEzR mAh/oO4n+xBbZT1S7gMCU53cTYzFpcMX+466VmoBAs3SuSgW1cZWkIy7HlPaWdLChqfY 2u4gc7/HYMQX3TvhSotxIHntyPm7skWHvFsh4JKUA09Xwa1SiCZYGeXs7uiid7cn7Q4N 62FUAT21BW5Tltkcwmf/GHLLZ0DO44DRaCW+6OETp3xkFsKk76SkRGVsPob9YVvWbasZ GDAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cogJl55oH07jqSg9ApgLWtmllTmSQaA7OXtfg1PRhgk=; b=U7Z7X/RGAXA3/tnezPuSbYxfwV3O3OAkGf5ruFyGo1u8T1o4DqsfZ0RVhQkoBXrQLj e8i72MNPqFxl6PJJC/sZ0GNSMGQPQGZlBomwnxZUOWowxEdrMffEm8nnlvBxY/fHpIha 4X3Q3Ubz7oPe8nZOEWifs7kNioMfkrBIB86P1UAWUHBE6nCE6S13f9kp9hwIBPY6e0bz CLQcJR752keMHJcxhaYb8Sq8RN3EbySAb5mOYFDTgxRhjbtuLqR3FYlNS9JrQo9wN9un ydu+2NsSQY9kF0bwqTTFBWNM+T+pYGZMbLUXLRYIlfQybe14AJJXP2niquu2xY1nEdwm 1TvQ== X-Gm-Message-State: AOAM531RExtYJn8yIelVOkbcMy4t3Vb5JVbnYAsMzm5IbYwhR5ah4QZA pmERNwTCrW2D85QRrtO2KoU= X-Google-Smtp-Source: ABdhPJyMHcyiiecOUTSgtRkCPcA40RmYcOnetoKSbQzJlRHr5FjlGkJYhc+2UIKf0N8Tr5uWUdzeVQ== X-Received: by 2002:ac8:4b57:: with SMTP id e23mr31714070qts.328.1634594604627; Mon, 18 Oct 2021 15:03:24 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:24 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/7] NFSv4.2 add tracepoints to FALLOCATE and DEALLOCATE Date: Mon, 18 Oct 2021 18:03:09 -0400 Message-Id: <20211018220314.85115-3-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to the FALLOCATE/DEALLOCATE operations. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 4 ++++ fs/nfs/nfs4trace.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 87c0dcb8823b..c36824888601 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -83,6 +83,10 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, status = nfs_post_op_update_inode_force_wcc(inode, res.falloc_fattr); + if (msg->rpc_proc == &nfs4_procedures[NFSPROC4_CLNT_ALLOCATE]) + trace_nfs4_fallocate(inode, &args, status); + else + trace_nfs4_deallocate(inode, &args, status); kfree(res.falloc_fattr); return status; } diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 81dcbfca7f74..ba338ee4a82b 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2483,6 +2483,63 @@ TRACE_EVENT(nfs4_llseek, ) ); +DECLARE_EVENT_CLASS(nfs4_sparse_event, + TP_PROTO( + const struct inode *inode, + const struct nfs42_falloc_args *args, + int error + ), + + TP_ARGS(inode, args, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(loff_t, offset) + __field(loff_t, len) + __field(dev_t, dev) + __field(u32, fhandle) + __field(u64, fileid) + __field(int, stateid_seq) + __field(u32, stateid_hash) + ), + + TP_fast_assign( + __entry->error = error < 0 ? -error : 0; + __entry->offset = args->falloc_offset; + __entry->len = args->falloc_length; + __entry->dev = inode->i_sb->s_dev; + __entry->fileid = NFS_FILEID(inode); + __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); + __entry->stateid_seq = + be32_to_cpu(args->falloc_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->falloc_stateid); + ), + + TP_printk( + "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " + "stateid=%d:0x%08x offset=%llu len=%llu", + -__entry->error, + show_nfsv4_errors(__entry->error), + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long long)__entry->fileid, + __entry->fhandle, + __entry->stateid_seq, __entry->stateid_hash, + (long long)__entry->offset, + (long long)__entry->len + ) +); +#define DEFINE_NFS4_SPARSE_EVENT(name) \ + DEFINE_EVENT(nfs4_sparse_event, name, \ + TP_PROTO( \ + const struct inode *inode, \ + const struct nfs42_falloc_args *args, \ + int error \ + ), \ + TP_ARGS(inode, args, error)) +DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate); +DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate); + #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */ From patchwork Mon Oct 18 22:03:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6924C433EF for ; Mon, 18 Oct 2021 22:03:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFC7F6108E for ; Mon, 18 Oct 2021 22:03:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbhJRWFi (ORCPT ); Mon, 18 Oct 2021 18:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRWFi (ORCPT ); Mon, 18 Oct 2021 18:05:38 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2DAC06161C for ; Mon, 18 Oct 2021 15:03:26 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id w8so16632869qts.4 for ; Mon, 18 Oct 2021 15:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OeqkSPVKL2Pa1TJvnwXeHsBGMcNXWR+t0t6C3TtJ4GE=; b=klmOeKS8rQ1Pcx7EqvTn3QN2b4rElTVgqxg3YbM6yRkusL3g5uiazX7v9sLW/n0DhA G46TD+JQKc9dWvabycWotXF1UQeUfU04P2sduagVh/e4a6WuagkdVVrzhxi1an0ia7Pu PX1iybqCqzB2XK40MbfnDOYaSTB1cP32+gdsL+GDtld23Vvi/i9CzoRJXeHp4qxJDe8+ b0h3XCotGWOPYoPYdR+IuUd6Zaz6R+IQ4Fn4rCuxHL1WiYR/XcQIuqLCh91bsruPfk5I fsaB8wuqPDyvxUS72VSSdtB4oPpmsjnz+k8S83IIh5bG7+lOLcaeQ4T4Bt8R8UlHCIbK fu/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OeqkSPVKL2Pa1TJvnwXeHsBGMcNXWR+t0t6C3TtJ4GE=; b=W4WGfRMH0tUOvcrdMCCS1Gbd6Ipsy9+rul1crcq0zNIt2chg5GNhmjDXOvucaw/7gd QLcDVEadoKiidoezY1Ul/i3uDXtwjXVBqzDuqdxVkg/5prXijhRcS+tXppo8vDyv537i 3RsIcL4LynlAWTsTBsBN1dT9HegIweKezWr0TsSuorfwbrzVQue0TGpfJqh1T8he3WzO afbtD+EtetizoPfg6zrSA/llM5fbi42ZMpDXPhyU1L/8QUwmnf1sf0f8VqYjEinEvjdB es8wYLd0J8+SmY/ub1r2v5v0rKeVKXk8yW0rTQJf0+2fi3+qaEoaqTRurToioI88jrKl gAuw== X-Gm-Message-State: AOAM533Fu6livfALi8Vkn/gijlJjkzDCa5kVX0Gj80mMWitrOAjij7ua QG0/DCavSfjDqSSuosl43DXjZkIb5vF4kA2H X-Google-Smtp-Source: ABdhPJzj87zdcon3D/kmtNsHH3ZJAO2SEf10h/y6QFyTBQaDGlhFoBYdeANSznxSKimJIh1vlkVXVg== X-Received: by 2002:a05:622a:204:: with SMTP id b4mr32567394qtx.89.1634594605658; Mon, 18 Oct 2021 15:03:25 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:25 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 3/7] NFSv4.2 add tracepoint to COPY Date: Mon, 18 Oct 2021 18:03:10 -0400 Message-Id: <20211018220314.85115-4-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to the COPY operation. Signed-off-by: Olga Kornievskaia Reported-by: kernel test robot --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 101 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index c36824888601..a072cdaf7bdc 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -367,6 +367,7 @@ static ssize_t _nfs42_proc_copy(struct file *src, status = nfs4_call_sync(dst_server->client, dst_server, &msg, &args->seq_args, &res->seq_res, 0); + trace_nfs4_copy(src_inode, dst_inode, args, res, nss, status); if (status == -ENOTSUPP) dst_server->caps &= ~NFS_CAP_COPY; if (status) diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index ba338ee4a82b..4beb59d78ff3 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2540,6 +2540,107 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event, DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate); DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate); +TRACE_EVENT(nfs4_copy, + TP_PROTO( + const struct inode *src_inode, + const struct inode *dst_inode, + const struct nfs42_copy_args *args, + const struct nfs42_copy_res *res, + const struct nl4_server *nss, + int error + ), + + TP_ARGS(src_inode, dst_inode, args, res, nss, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, src_fhandle) + __field(u32, src_fileid) + __field(u32, dst_fhandle) + __field(u32, dst_fileid) + __field(dev_t, src_dev) + __field(dev_t, dst_dev) + __field(int, src_stateid_seq) + __field(u32, src_stateid_hash) + __field(int, dst_stateid_seq) + __field(u32, dst_stateid_hash) + __field(loff_t, src_offset) + __field(loff_t, dst_offset) + __field(bool, sync) + __field(loff_t, len) + __field(int, res_stateid_seq) + __field(u32, res_stateid_hash) + __field(loff_t, res_count) + __field(bool, res_sync) + __field(bool, res_cons) + __field(bool, intra) + ), + + TP_fast_assign( + const struct nfs_inode *src_nfsi = NFS_I(src_inode); + const struct nfs_inode *dst_nfsi = NFS_I(dst_inode); + + __entry->src_fileid = src_nfsi->fileid; + __entry->src_dev = src_inode->i_sb->s_dev; + __entry->src_fhandle = nfs_fhandle_hash(args->src_fh); + __entry->src_offset = args->src_pos; + __entry->dst_fileid = dst_nfsi->fileid; + __entry->dst_dev = dst_inode->i_sb->s_dev; + __entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh); + __entry->dst_offset = args->dst_pos; + __entry->len = args->count; + __entry->sync = args->sync; + __entry->error = error < 0 ? -error : 0; + __entry->src_stateid_seq = + be32_to_cpu(args->src_stateid.seqid); + __entry->src_stateid_hash = + nfs_stateid_hash(&args->src_stateid); + __entry->dst_stateid_seq = + be32_to_cpu(args->dst_stateid.seqid); + __entry->dst_stateid_hash = + nfs_stateid_hash(&args->dst_stateid); + __entry->res_stateid_seq = error < 0 ? 0 : + be32_to_cpu(res->write_res.stateid.seqid); + __entry->res_stateid_hash = error < 0 ? 0 : + nfs_stateid_hash(&res->write_res.stateid); + __entry->res_count = error < 0 ? 0 : + res->write_res.count; + __entry->res_sync = error < 0 ? 0 : + res->synchronous; + __entry->res_cons = error < 0 ? 0 : + res->consecutive; + __entry->intra = nss ? 0 : 1; + ), + + TP_printk( + "error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu " + "src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu " + "dst_fhandle=0x%08x src_stateid=%d:0x%08x " + "dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu " + "len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d " + "res_cons=%d res_count=%llu", + -__entry->error, + show_nfsv4_errors(__entry->error), + __entry->intra, + MAJOR(__entry->src_dev), MINOR(__entry->src_dev), + (unsigned long long)__entry->src_fileid, + __entry->src_fhandle, + MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev), + (unsigned long long)__entry->dst_fileid, + __entry->dst_fhandle, + __entry->src_stateid_seq, __entry->src_stateid_hash, + __entry->dst_stateid_seq, __entry->dst_stateid_hash, + __entry->src_offset, + __entry->dst_offset, + __entry->len, + __entry->sync, + __entry->res_stateid_seq, __entry->res_stateid_hash, + __entry->res_sync, + __entry->res_cons, + __entry->res_count + ) +); + #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */ From patchwork Mon Oct 18 22:03:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E8F3C433F5 for ; Mon, 18 Oct 2021 22:03:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7462C6108E for ; Mon, 18 Oct 2021 22:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbhJRWFk (ORCPT ); Mon, 18 Oct 2021 18:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRWFj (ORCPT ); Mon, 18 Oct 2021 18:05:39 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FEC1C06161C for ; Mon, 18 Oct 2021 15:03:27 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id i1so16622403qtr.6 for ; Mon, 18 Oct 2021 15:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9vx7h7NPDb6cNSja6T8imttLb+0tH+B3APuPoqor3iE=; b=nNOhsJciAYROwEcTGLW4lOzeiIenwBZshk6jwhOzNPpits8gsQmyBUi14ovSnsCrSe EbHpa990IgdqLfUB7pRVoCd7B9EvBjL83YzkItoa3Ca758puqwMDQMSMyizZ+xE4ck43 Y5nbPEWexb/mqUrM2UVv74XMwhF5BC/FUKfja7Y/+gI5hm7wiWZWY1YIXEW4aIoI/RPO NUofY7v5Vrcg5Ux4gr8PIvaKSja6bHbzV4KCveIoxJ3+HVT/wrfyMFcGpiREOqzYCUgE Zg8nY9nJUMf10h75jDO5Lm5yHn2jICTy8wow3dJ8wiqFsxHiRf/gPAco0LVdsz0xDlmH wWvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9vx7h7NPDb6cNSja6T8imttLb+0tH+B3APuPoqor3iE=; b=EUs4BpkPfq0OzRxdPReTmBfrXDJHKqKYxjO0++hAUmj4Szy3igLdcXHIMko6Fb9tFA uISSC66yHbFlDwaK2FwRd4n/xhKzV/9nghs5wrKMUkdcMeJv0PmvS/7oqLJZCMWqM5VJ pnZzcD3v6Dk1GRjkBMiDNx2UI3uNX1+jZKKEst3vaWiriismpuB6137Xr7VeVXGScuFF CwjeJY3iaVY2VwZdJIS/L7HPh5Y8eVKvka1rJKnKm5KT0tt/os9rRX796FbAJdukyoSN Q4otAMLM8PhH6jDwB+mS9hgjCf3CDl1+78FkOuYK7pI1ky4HPf5ZgkbEEQoReXAAFLcO Hg0w== X-Gm-Message-State: AOAM532FmQqaOCpu7uFnyfL3UCksYSVeoDBSWnzah9BzAPzNT8SjgWyW ZjZ7doSccFc1DskBS2QVr4h0tIaNjJWhjCVD X-Google-Smtp-Source: ABdhPJzlwXtLPv47IHFBAH23NUOmlKliS5aajZ88ZY3aadQWgrXBPj1Wxx1yY8cn/YmtE758pHPpPw== X-Received: by 2002:a05:622a:1014:: with SMTP id d20mr33567092qte.152.1634594606748; Mon, 18 Oct 2021 15:03:26 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:26 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 4/7] NFSv4.2 add tracepoint to CLONE Date: Mon, 18 Oct 2021 18:03:11 -0400 Message-Id: <20211018220314.85115-5-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to the CLONE operation. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index a072cdaf7bdc..d3d9ea71702f 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -1077,6 +1077,7 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f, status = nfs4_call_sync(server->client, server, msg, &args.seq_args, &res.seq_res, 0); + trace_nfs4_clone(src_inode, dst_inode, &args, status); if (status == 0) { nfs42_copy_dest_done(dst_inode, dst_offset, count); status = nfs_post_op_update_inode(dst_inode, res.dst_fattr); diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 4beb59d78ff3..cc6537a20ebe 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2641,6 +2641,79 @@ TRACE_EVENT(nfs4_copy, ) ); +TRACE_EVENT(nfs4_clone, + TP_PROTO( + const struct inode *src_inode, + const struct inode *dst_inode, + const struct nfs42_clone_args *args, + int error + ), + + TP_ARGS(src_inode, dst_inode, args, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, src_fhandle) + __field(u32, src_fileid) + __field(u32, dst_fhandle) + __field(u32, dst_fileid) + __field(dev_t, src_dev) + __field(dev_t, dst_dev) + __field(loff_t, src_offset) + __field(loff_t, dst_offset) + __field(int, src_stateid_seq) + __field(u32, src_stateid_hash) + __field(int, dst_stateid_seq) + __field(u32, dst_stateid_hash) + __field(loff_t, len) + ), + + TP_fast_assign( + const struct nfs_inode *src_nfsi = NFS_I(src_inode); + const struct nfs_inode *dst_nfsi = NFS_I(dst_inode); + + __entry->src_fileid = src_nfsi->fileid; + __entry->src_dev = src_inode->i_sb->s_dev; + __entry->src_fhandle = nfs_fhandle_hash(args->src_fh); + __entry->src_offset = args->src_offset; + __entry->dst_fileid = dst_nfsi->fileid; + __entry->dst_dev = dst_inode->i_sb->s_dev; + __entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh); + __entry->dst_offset = args->dst_offset; + __entry->len = args->count; + __entry->error = error < 0 ? -error : 0; + __entry->src_stateid_seq = + be32_to_cpu(args->src_stateid.seqid); + __entry->src_stateid_hash = + nfs_stateid_hash(&args->src_stateid); + __entry->dst_stateid_seq = + be32_to_cpu(args->dst_stateid.seqid); + __entry->dst_stateid_hash = + nfs_stateid_hash(&args->dst_stateid); + ), + + TP_printk( + "error=%ld (%s) src_fileid=%02x:%02x:%llu " + "src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu " + "dst_fhandle=0x%08x src_stateid=%d:0x%08x " + "dst_stateid=%d:0x%08x src_offset=%llu " + "dst_offset=%llu len=%llu", + -__entry->error, + show_nfsv4_errors(__entry->error), + MAJOR(__entry->src_dev), MINOR(__entry->src_dev), + (unsigned long long)__entry->src_fileid, + __entry->src_fhandle, + MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev), + (unsigned long long)__entry->dst_fileid, + __entry->dst_fhandle, + __entry->src_stateid_seq, __entry->src_stateid_hash, + __entry->dst_stateid_seq, __entry->dst_stateid_hash, + __entry->src_offset, + __entry->dst_offset, + __entry->len + ) +); + #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */ From patchwork Mon Oct 18 22:03:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B603AC433EF for ; Mon, 18 Oct 2021 22:03:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98DCD6112D for ; Mon, 18 Oct 2021 22:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231956AbhJRWFm (ORCPT ); Mon, 18 Oct 2021 18:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRWFk (ORCPT ); Mon, 18 Oct 2021 18:05:40 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 902C5C06161C for ; Mon, 18 Oct 2021 15:03:28 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id z24so16597958qtv.9 for ; Mon, 18 Oct 2021 15:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EGVbY1wW4HGMpJzVMxKz7eRW71dvKunfgthGA8/4uGg=; b=WwxVg2CecHNKrEFG8FQUyJG58/rtiRr4ntmViQpj4G+9pDET25X04r8MudAli8cemJ i/BiKfGr8KC9XGUgymHDjXmqkffbZNEZb5nyCefnVZ2UQK4HZmqZwOq9+NJvqPP2ghik yDOTR8bSG08icg8r0P2rnehsCiO8Fm36nyc1OE/RgxZIamgts9n3jl0ENOSm9uZV2GIU kz4b6691GKgMl3xrTRrT2ya2JY7kprpSDHLDLAs+JD3iyGXL3eXUFS6W16MtaXSk/Fii jFjt1exB0B2Y1iTjfMK6YM7vLNfZ7s32J6SQVmF6Eg7GT4SerNdkgbsVloHai52uxzNA LDng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EGVbY1wW4HGMpJzVMxKz7eRW71dvKunfgthGA8/4uGg=; b=tvWUeeTDg21y0PYUwzyvg/Wjq5iJMrRGVLSy4EotxPaXToEy8IhLQUqeCAN0aAc08v 81gV3o4h0v1QWqDnOjWhzFFtGurXubVnleMOqLZFRDjbWjCtSyXHmQ/sABbteaetXHkR aydMe9MtKTmRD409Fvay6YdcIHU7acWoUBu+xcFr0tVVAUUdNrv8Mgo1Ai1a8BLoBJdC QcdA/mFI4qHPjoLGswxaEeCY9jLXHi4dQj1/QNVePfONZZmt8fu3JsaWlzBXXLnAefOV iLgSJ8rQR557HOH4rwfkc41o/xg+RlqNEk7pk0V/fucl8avTJgvawMOLcEdhsabKsypj +kCQ== X-Gm-Message-State: AOAM532gnqSnJpt8ZcjTeh0LRDcuae8i1qRm9ioWhnNLI67Du/wgao0V TWEhgoHfVVVE4vF5mUyREzM= X-Google-Smtp-Source: ABdhPJxJmvWj9x07gPGJ+YwFye6Z0wtS/o/buS6tWtaR6axrnAMlWmHvAmMGs4xKQZLpyeN9FRRLEw== X-Received: by 2002:ac8:7f03:: with SMTP id f3mr32814340qtk.320.1634594607743; Mon, 18 Oct 2021 15:03:27 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:27 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 5/7] NFSv4.2 add tracepoint to CB_OFFLOAD Date: Mon, 18 Oct 2021 18:03:12 -0400 Message-Id: <20211018220314.85115-6-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to the CB_OFFLOAD operation. Signed-off-by: Olga Kornievskaia --- fs/nfs/callback_proc.c | 3 +++ fs/nfs/nfs4trace.h | 50 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index ed9d580826f5..09c5b1cb3e07 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -739,6 +739,9 @@ __be32 nfs4_callback_offload(void *data, void *dummy, kfree(copy); spin_unlock(&cps->clp->cl_lock); + trace_nfs4_cb_offload(&args->coa_fh, &args->coa_stateid, + args->wr_count, args->error, + args->wr_writeverf.committed); return 0; } #endif /* CONFIG_NFS_V4_2 */ diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index cc6537a20ebe..33f52d486528 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2714,6 +2714,56 @@ TRACE_EVENT(nfs4_clone, ) ); +#define show_write_mode(how) \ + __print_symbolic(how, \ + { NFS_UNSTABLE, "UNSTABLE" }, \ + { NFS_DATA_SYNC, "DATA_SYNC" }, \ + { NFS_FILE_SYNC, "FILE_SYNC"}) + +TRACE_EVENT(nfs4_cb_offload, + TP_PROTO( + const struct nfs_fh *cb_fh, + const nfs4_stateid *cb_stateid, + uint64_t cb_count, + int cb_error, + int cb_how_stable + ), + + TP_ARGS(cb_fh, cb_stateid, cb_count, cb_error, + cb_how_stable), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, fhandle) + __field(loff_t, cb_count) + __field(int, cb_how) + __field(int, cb_stateid_seq) + __field(u32, cb_stateid_hash) + ), + + TP_fast_assign( + __entry->error = cb_error < 0 ? -cb_error : 0; + __entry->fhandle = nfs_fhandle_hash(cb_fh); + __entry->cb_stateid_seq = + be32_to_cpu(cb_stateid->seqid); + __entry->cb_stateid_hash = + nfs_stateid_hash(cb_stateid); + __entry->cb_count = cb_count; + __entry->cb_how = cb_how_stable; + ), + + TP_printk( + "error=%ld (%s) fhandle=0x%08x cb_stateid=%d:0x%08x " + "cb_count=%llu cb_how=%s", + -__entry->error, + show_nfsv4_errors(__entry->error), + __entry->fhandle, + __entry->cb_stateid_seq, __entry->cb_stateid_hash, + __entry->cb_count, + show_write_mode(__entry->cb_how) + ) +); + #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */ From patchwork Mon Oct 18 22:03:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 091FCC433F5 for ; Mon, 18 Oct 2021 22:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E69266108E for ; Mon, 18 Oct 2021 22:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbhJRWFm (ORCPT ); Mon, 18 Oct 2021 18:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbhJRWFl (ORCPT ); Mon, 18 Oct 2021 18:05:41 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC48C06161C for ; Mon, 18 Oct 2021 15:03:29 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id b12so16646921qtq.3 for ; Mon, 18 Oct 2021 15:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/jnForQvzDFnZb2d3tK1EegceeQkkvIbZQo5846/nxQ=; b=eSr72Ccbl617PzjB5CyUXgMepMii2Cn1qH4Hjp8I7dGfSdm9RfTX5gW6KmYGyzcuhP BwHMN/lrEnPlnurf8z3TeqEfJXV/qMDD4UoZSRum9ygCLsk5jGlNHz7iu9lTAPJtz83Z MsOv8GFC0xEtonTutqfp2I8d56V1yLfowxcMo1RbYEQwtXrWTMGVMZAJIinKocMjcRLY g9/1jilE+Xu1DrqDhaI/FUsv6kZ1OHMRGTshdl3mZ/OuPVtEVu50DO8bvBZrIuBqa33j lHsD5B5g3Tw+n+f6pPEHst5HwxJRaUfjOGnj++CoZvUeG9cQGNLCGw4b8KyueRWwEwaY TJFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/jnForQvzDFnZb2d3tK1EegceeQkkvIbZQo5846/nxQ=; b=5QGR/+alTKoVY9RaPVeOBXvnaxXJ71YE2WIM98C0B70kcwn0BLrbpSiGpTSGDmoKsy jI9xR0gZ2Usfu4R+rLERfe3V0NP3FiaV9QzVNiBT32SiGYay1fPbV5qlCx+OrzHzRUDa ApIr8Cp4mZn4A5+6QWAYs7EplpdMIhAdYnFoJ4YJUvfGl31dr6Cm+AB+o0qaN3mrUggf p45PFWQ9qcp/0kAloOdOzQdBpTDKbQC6fCQL/HLfPkJ+fqQVgEb4yPzFpOosTmBhcjF8 bypDGKmKGBFe9Lqk1LOXZFF12JrvbkAepO+MqgOwx4zmP7E3K7Nl4UwYEFUBRakgJT1F JN2g== X-Gm-Message-State: AOAM530vZ4ZumU77RDts8c73tkGs2TkrDlH6xsLmF6ejB+rzOSLuoOyL CC2yA4pFCN8DKKN3z1fsrnfG203Sy9Vw8y7A X-Google-Smtp-Source: ABdhPJzoLLSjHYvSswCambXOBGMPkoijzKC7Ilxx51r9azpV3wBDxIJarBStu9q9OU4dMQVJkLKcCg== X-Received: by 2002:ac8:1e95:: with SMTP id c21mr33150058qtm.412.1634594608849; Mon, 18 Oct 2021 15:03:28 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:28 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 6/7] NFSv4.2 add tracepoint to COPY_NOTIFY Date: Mon, 18 Oct 2021 18:03:13 -0400 Message-Id: <20211018220314.85115-7-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add a tracepoint to COPY_NOTIFY operation. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index d3d9ea71702f..7c7399b10050 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -603,6 +603,7 @@ static int _nfs42_proc_copy_notify(struct file *src, struct file *dst, status = nfs4_call_sync(src_server->client, src_server, &msg, &args->cna_seq_args, &res->cnr_seq_res, 0); + trace_nfs4_copy_notify(file_inode(src), args, res, status); if (status == -ENOTSUPP) src_server->caps &= ~NFS_CAP_COPY_NOTIFY; diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 33f52d486528..2741e12746b2 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2764,6 +2764,56 @@ TRACE_EVENT(nfs4_cb_offload, ) ); +TRACE_EVENT(nfs4_copy_notify, + TP_PROTO( + const struct inode *inode, + const struct nfs42_copy_notify_args *args, + const struct nfs42_copy_notify_res *res, + int error + ), + + TP_ARGS(inode, args, res, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, fhandle) + __field(u32, fileid) + __field(dev_t, dev) + __field(int, stateid_seq) + __field(u32, stateid_hash) + __field(int, res_stateid_seq) + __field(u32, res_stateid_hash) + ), + + TP_fast_assign( + const struct nfs_inode *nfsi = NFS_I(inode); + + __entry->fileid = nfsi->fileid; + __entry->dev = inode->i_sb->s_dev; + __entry->fhandle = nfs_fhandle_hash(args->cna_src_fh); + __entry->error = error < 0 ? -error : 0; + __entry->stateid_seq = + be32_to_cpu(args->cna_src_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->cna_src_stateid); + __entry->res_stateid_seq = error < 0 ? 0 : + be32_to_cpu(res->cnr_stateid.seqid); + __entry->res_stateid_hash = error < 0 ? 0 : + nfs_stateid_hash(&res->cnr_stateid); + ), + + TP_printk( + "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " + "stateid=%d:0x%08x res_stateid=%d:0x%08x", + -__entry->error, + show_nfsv4_errors(__entry->error), + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long long)__entry->fileid, + __entry->fhandle, + __entry->stateid_seq, __entry->stateid_hash, + __entry->res_stateid_seq, __entry->res_stateid_hash + ) +); #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */ From patchwork Mon Oct 18 22:03:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12568167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A0BFC433FE for ; Mon, 18 Oct 2021 22:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 434F16108E for ; Mon, 18 Oct 2021 22:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231938AbhJRWFn (ORCPT ); Mon, 18 Oct 2021 18:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbhJRWFm (ORCPT ); Mon, 18 Oct 2021 18:05:42 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4540C061745 for ; Mon, 18 Oct 2021 15:03:30 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id y11so16581226qtn.13 for ; Mon, 18 Oct 2021 15:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bw7tmYKLruf/dsxGuWamVdY8tQo68VyJ6WeC6ofKfjU=; b=itiK3I+DNzeiPMizvBjMOO/PBDgMD0dxJIycyC7cGo1WYT3LrTBNfSbHLFqUe2m2jT yd/QzK5low5hcmzSt/oQnSQwfRpqSJ/bk5J/O7pWuveIvLgciGiob0Q+9eK6T6Gq9TKQ 65GV2uIqGev360XaiN4f91SW+amab8NbvXjwzDMQDPEN3EG+9dj5v6ut7Fo1+1SdzcHO WLvSNmLTpG1Ht9JjQvQpd1ByvX5QHunwOao6Ao9CtvOvIO83v3GB7BrDuA6mASJB3yab BiG+0fWxWb7TYgOM0E1iK2T0QLUbfD5RZ1shx/VXBOu1a/cUZ4qX/I8U0Bi5fThaxEy9 uthQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bw7tmYKLruf/dsxGuWamVdY8tQo68VyJ6WeC6ofKfjU=; b=T8q06F7MeCuDOCK75VO6wR05TX0eGJv+w7vGKp29ZuEL5xCDeUteRLjtdx7jbycNpv re+nv/79bQie4ii4RzmNKtWvRVTQ4xXHK3ogsH/g3LSB27pTaBAHCcSc8LXZEzlYIPrT uHIwA6F0FlLalE3R+70rPBnvIJqGDOd/VwDwNlFg26u9rz7+0ZAiMGiuLa3PgWGYRz3j HLJ/1gjUhY/ecwhba9nNiyT1gskE5BVw1gFI2yR96Xek5IhlDjPJvlDfbjopkMwLbdLj zI7a70e5eZyyYQQWRkMXB2dTdrv2jR7x2K5aQw6JSO9fVmmzeaqtE+P0/mtQm7Tcbij7 zLXw== X-Gm-Message-State: AOAM5315wSGRBF6Bc4NgLkLw9h9Gea3QPerlBAwe4Q1xfgd5839JLSsT mra26bhzfU+BMScIbRWDDfk= X-Google-Smtp-Source: ABdhPJym/y6SjH2OOSDLTQ8yQk8CGy+m3EER7a8n4PqW1M6M7YiagIq4SPi6tiZQjD6rOPCMfp5+VQ== X-Received: by 2002:a05:622a:148d:: with SMTP id t13mr24761399qtx.393.1634594609884; Mon, 18 Oct 2021 15:03:29 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com ([2600:1700:6a10:2e90:e54f:15fc:f79a:2b96]) by smtp.gmail.com with ESMTPSA id az14sm3352640qkb.125.2021.10.18.15.03.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 15:03:29 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 7/7] NFSv4.2 add tracepoint to OFFLOAD_CANCEL Date: Mon, 18 Oct 2021 18:03:14 -0400 Message-Id: <20211018220314.85115-8-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211018220314.85115-1-olga.kornievskaia@gmail.com> References: <20211018220314.85115-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia Add tracepoint to OFFLOAD_CANCEL operation. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 7c7399b10050..08355b66e7cb 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -509,6 +509,7 @@ static void nfs42_offload_cancel_done(struct rpc_task *task, void *calldata) { struct nfs42_offloadcancel_data *data = calldata; + trace_nfs4_offload_cancel(&data->args, task->tk_status); nfs41_sequence_done(task, &data->res.osr_seq_res); if (task->tk_status && nfs4_async_handle_error(task, data->seq_server, NULL, diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 2741e12746b2..476420a7985a 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2814,6 +2814,39 @@ TRACE_EVENT(nfs4_copy_notify, __entry->res_stateid_seq, __entry->res_stateid_hash ) ); + +TRACE_EVENT(nfs4_offload_cancel, + TP_PROTO( + const struct nfs42_offload_status_args *args, + int error + ), + + TP_ARGS(args, error), + + TP_STRUCT__entry( + __field(unsigned long, error) + __field(u32, fhandle) + __field(int, stateid_seq) + __field(u32, stateid_hash) + ), + + TP_fast_assign( + __entry->fhandle = nfs_fhandle_hash(args->osa_src_fh); + __entry->error = error < 0 ? -error : 0; + __entry->stateid_seq = + be32_to_cpu(args->osa_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->osa_stateid); + ), + + TP_printk( + "error=%ld (%s) fhandle=0x%08x stateid=%d:0x%08x", + -__entry->error, + show_nfsv4_errors(__entry->error), + __entry->fhandle, + __entry->stateid_seq, __entry->stateid_hash + ) +); #endif /* CONFIG_NFS_V4_1 */ #endif /* _TRACE_NFS4_H */