From patchwork Thu Nov 4 14:57: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: 12603313 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 2DD66C433EF for ; Thu, 4 Nov 2021 14:57:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D5D961108 for ; Thu, 4 Nov 2021 14:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230345AbhKDO76 (ORCPT ); Thu, 4 Nov 2021 10:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231230AbhKDO74 (ORCPT ); Thu, 4 Nov 2021 10:59:56 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB9BC061203 for ; Thu, 4 Nov 2021 07:57:18 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id j28so6455345ila.1 for ; Thu, 04 Nov 2021 07:57:18 -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=LcrfP4jJovoaVITSQqrtRb2Q9mKmVoN3WERKBdDo+UA=; b=OmO7/zxX+e1vEEXp4gmRLo/MHh1COWip/K/euMIzYbNRvLakMD/BCuDHp+xz4dHCGs MwAtIOD6r+hUIlvKjeefYeRjey7hOJ3d1AYxbSizN+n0I4xaf2CAqKDAFbYpmved/4QP qzlh8f3nznefJn+MOsQ8qNbQeO6DMH/1U6FeGfaEnQIocEwxDMZVpWbRqaR3t31eu225 VCTW/8ZWZtq107rgnhcTTqFiLFJsx6OfJtmd0Dn7QR9FTuKMiipiNLaC46Osx1NvTLqA 1OieWJAeADDdSQ2qEfTZWQhopJr89YTu+vORC85MOsIR8VGyFZOzjUBJb7uE8Y4m2Mfl 2sfA== 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=LcrfP4jJovoaVITSQqrtRb2Q9mKmVoN3WERKBdDo+UA=; b=FY4bqlhzqiJSdsTXIeJnUD5jEHLhxaOQJFpK9d/opV+fR1qI6onVZ8REbEGa+vZpL8 uegAoRtqV/XA+tbtP74+vkq1CPHFZ0lgXsQCq5lXxyoWUiqa84m3l9Ljz5wfHVV8P+Nm zv+WXfLaz8joNJfpiX3lc5sOsyI8VKHwYd0RhW+5c4+cjFCIGJFbjCqDOo/I+D6JJeyC LCCcPX9tnR1tCEgsTXFlfKDjSPh804uBfM2U+LgpTV4IIn4BBlAgvtSNPaBnrwS/fCRY JC1qrxN+ZJUcE246I2Fn55ewtbzJ4pDmS/ao9OIe0X+Wu/55CEqiSNnCkogjjQO9wJOh MNEA== X-Gm-Message-State: AOAM533INDv130q6W7xIvhOc8CneLkfxoV3j9pAoS2t649oAgRLXNL5y iK5gTACfSK5c3ydN5qouZDE= X-Google-Smtp-Source: ABdhPJzAuqQ+11l9+tk2runW3N4sk0hJlCRy006Eh1AK0afzDmZW03Cgk9WuNmc3jhgV3fAfTy4avQ== X-Received: by 2002:a92:1e11:: with SMTP id e17mr34830758ile.196.1636037838118; Thu, 04 Nov 2021 07:57:18 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:17 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 1/7] NFSv4.2 add tracepoint to SEEK Date: Thu, 4 Nov 2021 10:57:08 -0400 Message-Id: <20211104145714.57942-2-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 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 18f149f72160..823ac436a1da 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2054,6 +2054,80 @@ 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" }) + +#ifdef CONFIG_NFS_V4_2 +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->stateid_seq = + be32_to_cpu(args->sa_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->sa_stateid); + __entry->what = args->sa_what; + if (error) { + __entry->error = -error; + __entry->offset_r = 0; + __entry->eof = 0; + } else { + __entry->error = 0; + __entry->offset_r = res->sr_offset; + __entry->eof = 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_nfs4_status(__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_2 */ #endif /* CONFIG_NFS_V4_1 */ From patchwork Thu Nov 4 14:57: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: 12603315 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 A487EC433FE for ; Thu, 4 Nov 2021 14:57:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DB7D611C3 for ; Thu, 4 Nov 2021 14:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231230AbhKDO76 (ORCPT ); Thu, 4 Nov 2021 10:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbhKDO76 (ORCPT ); Thu, 4 Nov 2021 10:59:58 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C87C061714 for ; Thu, 4 Nov 2021 07:57:20 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id h23so6446467ila.4 for ; Thu, 04 Nov 2021 07:57:20 -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=4tAxnw/v2l2V3KwJcHJCQQ+ZoVxVjSCmPO+OTALYGGM=; b=nEZZgoQfb6phY5wGzZqFG17Uw3mv3l/3MD9w+cQSbTlPIBXJnpS2J9Vwx/iKUQH8Eg TpRpBVr4pHlcUBgkhWr0fjaPPU/xIjMzAVHqBwTknxTWC2+eiv/I2JuRmRyFmTESMIvL C0P8n4WFdULreycdDnxAVfSfcWkAht03/RxNGDpTYDqSUzw6XALfVi39vJejT/48VhJs MCzEh4tGnQVwwXf1yD3YoRNuf6Weeri4RDI6qxAgYGsZ/G2EjewBrkzgLCftmxQfUYSJ fTahPEEe3SGW0Csq2EK3GypH+7Boz4ZW3p9gKm6T/DgaBFJu9Pyg42UslsIISk7qy5AF TyCw== 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=4tAxnw/v2l2V3KwJcHJCQQ+ZoVxVjSCmPO+OTALYGGM=; b=DRD5ctGNZH9AACVQqWh5uOrhMe6kttXlwd4NIpJFSpFBiB4tAK1NsdmmN3wOaSfOI9 pgrAEv7FXTqtw/JINYnM5xP4xafMlJUvMqEfzf+bVVKLXDPEUf2CAJa1et2i9Icfdwr5 FOSCSCe/U73eCTmxSyvBPzIn+xwGrtIt95jkf6xB+TSyfynEoh21+hBfAPqBIcnMyWpk VHL62Ym2NjMFbvE5g4HsHKhHQesAT01Vcaj+SKbiiRzVraDvucEGSRnbL1wLg3Ulo4Q+ CN+SKraMMtDAwsuAsuHceOIoSXwtzH41XvVbelR50ehQuGAC5710QVxGRCdGVJpXGHlY RguQ== X-Gm-Message-State: AOAM530++RSrEeoTm1WulqwEVGQgtXJt08YBJ+ZPZaVHvBWxE5agfX/l Oow9Wm7j0+XPi1XgKE4HZMbT+PN3BJH3IQ== X-Google-Smtp-Source: ABdhPJxM+7JsoKn8T+ElU969BTY0D/qJ9yqhutAtg1R34RBphw+GMPUePno7C7IUlK/JH0nCTAgzEA== X-Received: by 2002:a92:d411:: with SMTP id q17mr20896086ilm.116.1636037839500; Thu, 04 Nov 2021 07:57:19 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:18 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 2/7] NFSv4.2 add tracepoints to FALLOCATE and DEALLOCATE Date: Thu, 4 Nov 2021 10:57:09 -0400 Message-Id: <20211104145714.57942-3-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 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 823ac436a1da..a88464238b88 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2127,6 +2127,62 @@ 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_nfs4_status(__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_2 */ #endif /* CONFIG_NFS_V4_1 */ From patchwork Thu Nov 4 14:57: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: 12603317 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 7A310C433F5 for ; Thu, 4 Nov 2021 14:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E09C61108 for ; Thu, 4 Nov 2021 14:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbhKDPAC (ORCPT ); Thu, 4 Nov 2021 11:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbhKDPAC (ORCPT ); Thu, 4 Nov 2021 11:00:02 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0256DC061714 for ; Thu, 4 Nov 2021 07:57:24 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id l19so6506833ilk.0 for ; Thu, 04 Nov 2021 07:57:23 -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=mNr5CYTHWJ4RFnVTFiYYlmXsAzABz7rwUHM1bbulcQo=; b=J1hlMh2lrEKjOI4JsvcRTbTFxftrhFMJHQnRBE/JWdJ+9kVLeSXLVL1yW68vipq939 acUSqeKP1tNGSpS7a2FeC14RfpYhmXwJMndhOn3d/GKkCxlX8NeZ0u2tuByW0kFFdIHE ae+/3dtlVNqQ8ppAoXEgmdH32bqLd4YbXOnq+X0RZ2Hw4Bk5RM7u7Cb1iQ/tV9BGhTQP lAxvZEm+jTmq2Rf1TJkHD1tlQ5ZH+SltylOgbLN6LufK1SwqZD+4B/BY0iypCq1WUkgw ud5z5xmk5+ZHNDDngaboXDB5jw97+sh7xtTa9ZnNgqEBePw9tjQwseaHrBJn3mQyLPEk FQ7A== 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=mNr5CYTHWJ4RFnVTFiYYlmXsAzABz7rwUHM1bbulcQo=; b=6dEvtvYHrrWedkmluAaiHPufnGJZbZzeDmcFRyw3a9DDScZubJ4YYzg5EsZQE1uWYr TpwTSXNtrXAm6Xk2ZrqnBLKWQijSajyAhvIzlwsug8pw/jSTw8mQYcxjbBVDIOcYaRdS PKbxDLJ8U2U2Hx7Z3UXnKHUB7OK8/3jSSGHk5I8jlqnfMWlEXVRo/BR2nfgo2g6my8hl Ih0syAUEruxqy+ROrsjmGCv5o2TT5/qDJOJJ+vjQ7aD26V23Nwwd5mzy3YkYx7durFha P6oeTV7zpOJjmGZ+07KxgNLyElPTR9lOsIKAG6iklZR5WSeyJ0EOsuW+9sMlaLANhicy C49A== X-Gm-Message-State: AOAM531Jh+HVYwfkVzI6Lq2ftvXIucckb78TqAuVskb6IpNIM6aCNgA4 l9XJjgYgC3x3JphDkpY0WL6tISyOJVwIHA== X-Google-Smtp-Source: ABdhPJxDIHzcZGcECD4vm/BCm84OhKU2ZJ3drho285kXbM6O/oJus/mFTfoNRd9giPlpjhNcJqPF0g== X-Received: by 2002:a05:6e02:1bec:: with SMTP id y12mr2382712ilv.74.1636037843455; Thu, 04 Nov 2021 07:57:23 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:20 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 3/7] NFSv4.2 add tracepoint to COPY Date: Thu, 4 Nov 2021 10:57:10 -0400 Message-Id: <20211104145714.57942-4-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 --- fs/nfs/nfs42proc.c | 1 + fs/nfs/nfs4trace.h | 107 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 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 a88464238b88..bdccaec504d8 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2183,6 +2183,113 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event, TP_ARGS(inode, args, error)) 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->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->intra = nss ? 0 : 1; + if (error) { + __entry->error = -error; + __entry->res_stateid_seq = 0; + __entry->res_stateid_hash = 0; + __entry->res_count = 0; + __entry->res_sync = 0; + __entry->res_cons = 0; + } else { + __entry->error = 0; + __entry->res_stateid_seq = + be32_to_cpu(res->write_res.stateid.seqid); + __entry->res_stateid_hash = + nfs_stateid_hash(&res->write_res.stateid); + __entry->res_count = res->write_res.count; + __entry->res_sync = res->synchronous; + __entry->res_cons = res->consecutive; + } + ), + + 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_nfs4_status(__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_2 */ #endif /* CONFIG_NFS_V4_1 */ From patchwork Thu Nov 4 14:57: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: 12603319 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 34A61C433FE for ; Thu, 4 Nov 2021 14:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D9B161108 for ; Thu, 4 Nov 2021 14:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231325AbhKDPAD (ORCPT ); Thu, 4 Nov 2021 11:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbhKDPAD (ORCPT ); Thu, 4 Nov 2021 11:00:03 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54635C061714 for ; Thu, 4 Nov 2021 07:57:25 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id s14so6433558ilv.10 for ; Thu, 04 Nov 2021 07:57: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=pwZZda3fnrEzoQoUgBAuIW6Jl+466RRYUR0Wt7GVS+4=; b=VEQ4OAw6D2cMWl+GUbRlcla3lZfp2KwPZ5AO+UFMWt2OlSoWSo0OTqBmwOyuXXHOK6 GSSBugv6JnzkpP2RMlGSGsKOBPVTZE4x41wXq2NrAmDsH3BJOSaB0pNfHQg46Z0ojVxZ 33VulTdhgqyuxF5XREo0sDzYRLwDno87vlve2skmTcdlbC5YEDvF+o3rZHdBTYttKSEX ZqS155UPNKUoy5e5xMYQtHxqY/jqHkye6LoSQlzPCohOf1QQYCg5k4fYC4QBlaQnqPC2 X0cci+NGM1QXUROe7NMi2lKlmZneeTqmxukCCc86OZyCx+ymvWUGoXt7FHR/4sl7Dth3 gOiA== 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=pwZZda3fnrEzoQoUgBAuIW6Jl+466RRYUR0Wt7GVS+4=; b=KKjWPrY70gRGyPtar9iRAIGvZtlcZWW6O89wVVbHWvi9KNX3Dn6Grrcr0nmDvBlSKD +uWHTudD1xz75iL1cV+C+bOV9UG4rKNoobvoRTdRU9WAsnfcCG3JZ5+gKX6M8GxkF7HS aQ56sWfRz4aY3dq4MQK5ute/nnw6LegjjxW2qPOuHXr27enSQY9XUlhRoYWFhz+rQG+P b0s81tlpkmsMAWE7sonYuTtVqlOLQgbXeYsat1zZVM1ZeASM6mJH3edD5SDsUKbtPM5O nRw9TIgwAWJ0oF3KSJ/p5ylgb9U01tyTswZ/2w4h8cU72tTgu/iBaZfUUP2e2R/TPIWr e6Xw== X-Gm-Message-State: AOAM533yDBEhPMMXVXZ+MlU9xDlIWQL6gRP/3GbyTQE2gH32OISzk/P8 6Gdtn+s4gcd9LTjZmguWNko= X-Google-Smtp-Source: ABdhPJx3C73o8wKIumsMvFSgh/4hQDVQves7l1JIG1S4Ezd0q70GjTRTMxzVAG2rWinpS4c50G2w7Q== X-Received: by 2002:a92:d341:: with SMTP id a1mr28772510ilh.59.1636037844813; Thu, 04 Nov 2021 07:57:24 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:24 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 4/7] NFSv4.2 add tracepoint to CLONE Date: Thu, 4 Nov 2021 10:57:11 -0400 Message-Id: <20211104145714.57942-5-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 bdccaec504d8..af7e59aa9265 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2290,6 +2290,79 @@ TRACE_EVENT(nfs4_copy, __entry->res_count ) ); + +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_nfs4_status(__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_2 */ #endif /* CONFIG_NFS_V4_1 */ From patchwork Thu Nov 4 14:57: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: 12603321 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 3B8DDC433F5 for ; Thu, 4 Nov 2021 14:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23F7561108 for ; Thu, 4 Nov 2021 14:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230420AbhKDPAF (ORCPT ); Thu, 4 Nov 2021 11:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbhKDPAE (ORCPT ); Thu, 4 Nov 2021 11:00:04 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE945C061714 for ; Thu, 4 Nov 2021 07:57:26 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id k1so6435967ilo.7 for ; Thu, 04 Nov 2021 07:57: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=RwnNqgv9ccoYl352WSb+exKQaGiQEt1N3MQu3C5Jlck=; b=LI7AiAHOb3Q0DDMlSV3EV0wTB7WmzCMk450QGfA93vLGdi1kZ2XsokTg4Tnc08aE2o /nb7N6J1mJtdot6FXf8azjxAAjkqeXPX8tjQhkkARnxQ6DeGKsL1Tkb/39Zye2I9NcmA khzlX7w7mHIYiEpjj8EACFa3nAqHYVpUOIBWZMAJxGp6frrnuGu6rlfW4iOy6TrzvcGj deyNbAUIXVlGHL6aTS8MGo3MhwY/bsrvoqDFXORgoB5slFg8wJWoTv5gylK2Eld0gfh2 +G4LSbj5m0/Wj14AvePZjzBjMg7y5mmsnrYL5nCH9lKzmX/IFDEhdbgXWNrw9SpUuu10 hMww== 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=RwnNqgv9ccoYl352WSb+exKQaGiQEt1N3MQu3C5Jlck=; b=rRZawLnxA6LrSCRqCScSfuk994jdU+rYHy+rZLZX3MCpf5xqS/WalRiaN4lSBDp/yZ Kh2wQVbLVfJhbFOKKDRoDa1AtUi/+AWWAzgUt+1oeWJKrxGhGtwnMfzIemTGHqvZQX5L xQF2CM0queH4mNIaj0/E8Tw+wpln9EqN9nQ6qY0nHJ/v1bera7jubs5v/hPLTy2btBf8 EGEaeLXfu/CSp8wbUE/LQLTXEWDv0gJYVSwFfSpOuguF6Eo8SyPsE8FRclMzEWyWg0uB GfaVisR245GO/dv2LAUTYpSkRypejjcAJAWGQsfaIlC6mLK6T7AVIHK+GyCZ68lb7/Cl Xdcw== X-Gm-Message-State: AOAM530QBshDjpFcrc3Wv1xFJJJcmabdvHrbpIsb1+VMzo2LBRCSzqq0 DAMT4xlC8uRLOAxdiNRdJWo= X-Google-Smtp-Source: ABdhPJwVe6Xnu9OYu5YnMFNrKfjf3D/tXK8IR9rI88XKwPQFLQNDS+sNZPZFsesL9FB2QCdpMOJ1Rw== X-Received: by 2002:a92:6f0c:: with SMTP id k12mr28772988ilc.240.1636037846255; Thu, 04 Nov 2021 07:57:26 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:25 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 5/7] NFSv4.2 add tracepoint to CB_OFFLOAD Date: Thu, 4 Nov 2021 10:57:12 -0400 Message-Id: <20211104145714.57942-6-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 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 af7e59aa9265..f971e38a6e3a 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -200,6 +200,50 @@ TRACE_EVENT(nfs4_cb_seqid_err, ) ); +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_nfs4_status(__entry->error), + __entry->fhandle, + __entry->cb_stateid_seq, __entry->cb_stateid_hash, + __entry->cb_count, + show_nfs_stable_how(__entry->cb_how) + ) +); + #endif /* CONFIG_NFS_V4_1 */ TRACE_EVENT(nfs4_setup_sequence, From patchwork Thu Nov 4 14:57: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: 12603323 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 0BB0FC433EF for ; Thu, 4 Nov 2021 14:57:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E66DF61108 for ; Thu, 4 Nov 2021 14:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231243AbhKDPAI (ORCPT ); Thu, 4 Nov 2021 11:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231293AbhKDPAH (ORCPT ); Thu, 4 Nov 2021 11:00:07 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F379C061714 for ; Thu, 4 Nov 2021 07:57:29 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id i12so6415535ila.12 for ; Thu, 04 Nov 2021 07:57: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=aHj+KkDaysdYnyxwY/EhiY2zyJowRkz3pBrEozVC1QA=; b=R6ndz/xSBUUn/rrWHZCRenY7YjQ0JSEQVfkhdc2lW49DbLDLwK2szORoT1aYxAcDuA BAXwBKU1cAXAZnkKbXg2/fmlVeVi2rcVGprJj9EFa+Q22aHjhdajISG9qkN35LEDfoaw CjNgmIqlkvWpSVKfWixoEF9grWZP/qaHhNMBEA4E35qiUL/pPgefzvOnNGcPE0pKJd38 Q+Dr0lXmwPqnSxtW34UZHZhDtICml7oaUBZ2x5i1Gi7FMqUA64a5dG1JZoAy9vK8TCwK l2SwsS1kQq9JeJRTWr75pC7/UJOResWY8zMkrui2xky4zGHaDZvYizqf19Vx1MxzRmwt EUAA== 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=aHj+KkDaysdYnyxwY/EhiY2zyJowRkz3pBrEozVC1QA=; b=CR64IAPvpD0uPeMRTL0ohYWximx0ZUBnVPed8wSKhwvNOf/rm+7TnmB6irYl2+P3Do ymxjgvJs7PTkdQpA0upoYZ9RYVkrr3Wu85x8ueuI21c23lfLlKEf5mkHBIevmZvDmgO2 DkTk1IDd6MmsRDksulA3h90K4y6O54QzKGxLf6tPWiuEPD+WQHhcDBSFq009406cquMK j+7rTf52LzaNNUOfAx8O1zhn/HxNsVmtb1C9ctvFlplphFgPHs+IFgCWq1CAxrA3zGyV 5XlckXJS5U9mmyBqjZf4EZfdPSV8WL9vFaT8XA/RR3t3AjGhtFPZU1tsHWG7Bh3H/BCV Mu9A== X-Gm-Message-State: AOAM533T5XeSDZaM2F3oHJjWrubZLxcHfHn7ILGpb9eTrnj3PfLL+p+C eFrBx/37YSL7KtKkEvggoRo= X-Google-Smtp-Source: ABdhPJwLMmoXsR5ed2/S8vuNkO09MwuFeTC+ED/fIGzF00+QvkF72aQQcDHUXkicS48ubtOTihmSRw== X-Received: by 2002:a92:c08d:: with SMTP id h13mr27664566ile.60.1636037848868; Thu, 04 Nov 2021 07:57:28 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:27 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 6/7] NFSv4.2 add tracepoint to COPY_NOTIFY Date: Thu, 4 Nov 2021 10:57:13 -0400 Message-Id: <20211104145714.57942-7-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 | 58 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) 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 f971e38a6e3a..f337a25c67b3 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -243,7 +243,6 @@ TRACE_EVENT(nfs4_cb_offload, show_nfs_stable_how(__entry->cb_how) ) ); - #endif /* CONFIG_NFS_V4_1 */ TRACE_EVENT(nfs4_setup_sequence, @@ -2407,6 +2406,63 @@ TRACE_EVENT(nfs4_clone, __entry->len ) ); + +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->stateid_seq = + be32_to_cpu(args->cna_src_stateid.seqid); + __entry->stateid_hash = + nfs_stateid_hash(&args->cna_src_stateid); + if (error) { + __entry->error = -error; + __entry->res_stateid_seq = 0; + __entry->res_stateid_hash = 0; + } else { + __entry->error = 0; + __entry->res_stateid_seq = + be32_to_cpu(res->cnr_stateid.seqid); + __entry->res_stateid_hash = + 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_nfs4_status(__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_2 */ #endif /* CONFIG_NFS_V4_1 */ From patchwork Thu Nov 4 14:57: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: 12603325 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 DA44AC433FE for ; Thu, 4 Nov 2021 14:57:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC61B61108 for ; Thu, 4 Nov 2021 14:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbhKDPAJ (ORCPT ); Thu, 4 Nov 2021 11:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbhKDPAI (ORCPT ); Thu, 4 Nov 2021 11:00:08 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E712C061714 for ; Thu, 4 Nov 2021 07:57:30 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id j28so6455948ila.1 for ; Thu, 04 Nov 2021 07:57: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=vjWWHMx05nyI41glpjb83c/ixWOqf5zmv65wzd4pvU0=; b=RhRBErrrhPrP6+4H6DalvxxBs9UtV5xLaSJzSQF9Wuk2ZBj/LizevI9qP/hvlFfXsi aQSNkxqSmlqQD7qQhEGOr1CA2mIMzDQnkFGJUYvDZRDzmT3n6ukW5adqYt+3empjteer /C+gKR4kmpWa/wiQKpcCoc3YVfSKkkYfnFl+Le5KS4Uq/msgRWaK37Xqa2sXep2rjkcl ZxqWwlawDQTG18UfWwsZr0hR4wtiQV5xf19Gkd8yOOnCSTtss2w0q26eZlhKP/8w0kuw +ue2+MAoDuMnRgw5QXx5MFf+v7XClyrSpb7N815VPlNewYpp/6M/sOYkueNUkRg/ISi9 7auQ== 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=vjWWHMx05nyI41glpjb83c/ixWOqf5zmv65wzd4pvU0=; b=cDPUclsA7g364PTSL2MleqQ9T+zo3nEeSqGxXdx0ZcrTclfgZQRwmTewfL/RRfCPcF +i41S6fmYnEeH/4aGE9ztrtHAYm/g2xfy5bweSCX4Wkc8VJ1oFgE5wB7adrkoZRdVwbK lt9wB1rsR+nDG0HolYaewpCRM8gS6sE2+pLfP+htGGEkMnkf7NExt5ROg9jXU8rAEhRy MVGJso8lfIZ/zJzxRxZK2QoHjcX0pkLCGQQdvwJ7PVpJsmQSGtdcXSbOUkbaHtwnHFxx kZWDraNT4rXovi/nOaStJ5cFiuK7P7zHO3SNx85ZoQ1A/0rQkn5PQsD/aMi8X84iGy3J 4vOw== X-Gm-Message-State: AOAM532LHJsFDboRGzDbhh7b9jDjxW8HncxJ3+1W5rdrQF5opCUoJrEg kMJn2bSEcm2t5GL7ADlZ23j3/F/qzBN2Sw== X-Google-Smtp-Source: ABdhPJxN5cTcY2/pagu2dVUjbFZMVovJcFR3hXAkWBdn/0V3e9y1UzXsMGu1uy3NyavOx1+BFBkqVg== X-Received: by 2002:a05:6e02:12e5:: with SMTP id l5mr12919449iln.36.1636037849992; Thu, 04 Nov 2021 07:57:29 -0700 (PDT) Received: from kolga-mac-1.attlocal.net ([2600:1700:6a10:2e90:886c:a169:fafb:e7cf]) by smtp.gmail.com with ESMTPSA id c12sm3007157ils.31.2021.11.04.07.57.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 07:57:29 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chuck.level@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 7/7] NFSv4.2 add tracepoint to OFFLOAD_CANCEL Date: Thu, 4 Nov 2021 10:57:14 -0400 Message-Id: <20211104145714.57942-8-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211104145714.57942-1-olga.kornievskaia@gmail.com> References: <20211104145714.57942-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 f337a25c67b3..6ee6ad3674a2 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2463,6 +2463,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_nfs4_status(__entry->error), + __entry->fhandle, + __entry->stateid_seq, __entry->stateid_hash + ) +); #endif /* CONFIG_NFS_V4_2 */ #endif /* CONFIG_NFS_V4_1 */