Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sergey Bashirov and committed by
Trond Myklebust
66642bbe d84c4754

+38 -3
+3 -3
fs/nfs/blocklayout/extent_tree.c
··· 6 6 #include <linux/vmalloc.h> 7 7 8 8 #include "blocklayout.h" 9 + #include "../nfs4trace.h" 9 10 10 11 #define NFSDBG_FACILITY NFSDBG_PNFS_LD 11 12 ··· 638 637 __be32 *start_p; 639 638 int ret; 640 639 641 - dprintk("%s enter\n", __func__); 642 - 643 640 arg->layoutupdate_page = alloc_page(GFP_NOFS); 644 641 if (!arg->layoutupdate_page) 645 642 return -ENOMEM; ··· 684 685 } 685 686 } 686 687 687 - dprintk("%s found %zu ranges\n", __func__, count); 688 + trace_bl_ext_tree_prepare_commit(ret, count, 689 + arg->lastbytewritten, !!ret); 688 690 return ret; 689 691 } 690 692
+1
fs/nfs/nfs4trace.c
··· 32 32 EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_write_error); 33 33 EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_commit_error); 34 34 35 + EXPORT_TRACEPOINT_SYMBOL_GPL(bl_ext_tree_prepare_commit); 35 36 EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_reg); 36 37 EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_reg_err); 37 38 EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_unreg);
+34
fs/nfs/nfs4trace.h
··· 2295 2295 ) 2296 2296 ); 2297 2297 2298 + TRACE_EVENT(bl_ext_tree_prepare_commit, 2299 + TP_PROTO( 2300 + int ret, 2301 + size_t count, 2302 + u64 lwb, 2303 + bool not_all_ranges 2304 + ), 2305 + 2306 + TP_ARGS(ret, count, lwb, not_all_ranges), 2307 + 2308 + TP_STRUCT__entry( 2309 + __field(int, ret) 2310 + __field(size_t, count) 2311 + __field(u64, lwb) 2312 + __field(bool, not_all_ranges) 2313 + ), 2314 + 2315 + TP_fast_assign( 2316 + __entry->ret = ret; 2317 + __entry->count = count; 2318 + __entry->lwb = lwb; 2319 + __entry->not_all_ranges = not_all_ranges; 2320 + ), 2321 + 2322 + TP_printk( 2323 + "ret=%d, found %zu ranges, lwb=%llu%s", 2324 + __entry->ret, 2325 + __entry->count, 2326 + __entry->lwb, 2327 + __entry->not_all_ranges ? ", not all ranges encoded" : 2328 + "" 2329 + ) 2330 + ); 2331 + 2298 2332 DECLARE_EVENT_CLASS(pnfs_bl_pr_key_class, 2299 2333 TP_PROTO( 2300 2334 const struct block_device *bdev,