pNFS: Add prepare commit trace to block/scsi layout

Replace dprintk with trace event in ext_tree_prepare_commit() function.

Co-developed-by: Konstantin Evtushenko <koevtushenko@yandex.com>
Signed-off-by: Konstantin Evtushenko <koevtushenko@yandex.com>
Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250630183537.196479-4-sergeybashirov@gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Sergey Bashirov
2025-06-30 21:35:28 +03:00
committed by Trond Myklebust
parent d84c4754f8
commit 66642bbee5
3 changed files with 38 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
#include <linux/vmalloc.h>
#include "blocklayout.h"
#include "../nfs4trace.h"
#define NFSDBG_FACILITY NFSDBG_PNFS_LD
@@ -637,8 +638,6 @@ ext_tree_prepare_commit(struct nfs4_layoutcommit_args *arg)
__be32 *start_p;
int ret;
dprintk("%s enter\n", __func__);
arg->layoutupdate_page = alloc_page(GFP_NOFS);
if (!arg->layoutupdate_page)
return -ENOMEM;
@@ -685,7 +684,8 @@ ext_tree_prepare_commit(struct nfs4_layoutcommit_args *arg)
}
}
dprintk("%s found %zu ranges\n", __func__, count);
trace_bl_ext_tree_prepare_commit(ret, count,
arg->lastbytewritten, !!ret);
return ret;
}

View File

@@ -32,6 +32,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_read_error);
EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_write_error);
EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_commit_error);
EXPORT_TRACEPOINT_SYMBOL_GPL(bl_ext_tree_prepare_commit);
EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_reg);
EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_reg_err);
EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_unreg);

View File

@@ -2295,6 +2295,40 @@ TRACE_EVENT(ff_layout_commit_error,
)
);
TRACE_EVENT(bl_ext_tree_prepare_commit,
TP_PROTO(
int ret,
size_t count,
u64 lwb,
bool not_all_ranges
),
TP_ARGS(ret, count, lwb, not_all_ranges),
TP_STRUCT__entry(
__field(int, ret)
__field(size_t, count)
__field(u64, lwb)
__field(bool, not_all_ranges)
),
TP_fast_assign(
__entry->ret = ret;
__entry->count = count;
__entry->lwb = lwb;
__entry->not_all_ranges = not_all_ranges;
),
TP_printk(
"ret=%d, found %zu ranges, lwb=%llu%s",
__entry->ret,
__entry->count,
__entry->lwb,
__entry->not_all_ranges ? ", not all ranges encoded" :
""
)
);
DECLARE_EVENT_CLASS(pnfs_bl_pr_key_class,
TP_PROTO(
const struct block_device *bdev,