public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: send: remove btrfs_debug() calls
@ 2025-04-29  8:53 David Sterba
  2025-04-30  9:28 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: David Sterba @ 2025-04-29  8:53 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

There are debugging prints each emitted send commands and other related
actions. This does not seem right as the number of commands can be high
and dumping that to the system log will likely hit some rate limiting.
This should be done by trace points that are more lightweight and can
keep up with high frequency.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/send.c | 38 +-------------------------------------
 1 file changed, 1 insertion(+), 37 deletions(-)

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 18d14231f23b4a..0ba4f51766d601 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -819,8 +819,6 @@ static int send_rename(struct send_ctx *sctx,
 	struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
 	int ret;
 
-	btrfs_debug(fs_info, "send_rename %s -> %s", from->start, to->start);
-
 	ret = begin_cmd(sctx, BTRFS_SEND_C_RENAME);
 	if (ret < 0)
 		return ret;
@@ -843,8 +841,6 @@ static int send_link(struct send_ctx *sctx,
 	struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
 	int ret;
 
-	btrfs_debug(fs_info, "send_link %s -> %s", path->start, lnk->start);
-
 	ret = begin_cmd(sctx, BTRFS_SEND_C_LINK);
 	if (ret < 0)
 		return ret;
@@ -866,8 +862,6 @@ static int send_unlink(struct send_ctx *sctx, struct fs_path *path)
 	struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
 	int ret;
 
-	btrfs_debug(fs_info, "send_unlink %s", path->start);
-
 	ret = begin_cmd(sctx, BTRFS_SEND_C_UNLINK);
 	if (ret < 0)
 		return ret;
@@ -888,8 +882,6 @@ static int send_rmdir(struct send_ctx *sctx, struct fs_path *path)
 	struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
 	int ret;
 
-	btrfs_debug(fs_info, "send_rmdir %s", path->start);
-
 	ret = begin_cmd(sctx, BTRFS_SEND_C_RMDIR);
 	if (ret < 0)
 		return ret;
@@ -1686,14 +1678,8 @@ static int find_extent_clone(struct send_ctx *sctx,
 	}
 	up_read(&fs_info->commit_root_sem);
 
-	btrfs_debug(fs_info,
-		    "find_extent_clone: data_offset=%llu, ino=%llu, num_bytes=%llu, logical=%llu",
-		    data_offset, ino, num_bytes, logical);
-
-	if (!backref_ctx.found) {
-		btrfs_debug(fs_info, "no clones found");
+	if (!backref_ctx.found)
 		return -ENOENT;
-	}
 
 	cur_clone_root = NULL;
 	for (i = 0; i < sctx->clone_roots_cnt; i++) {
@@ -2635,8 +2621,6 @@ static int send_truncate(struct send_ctx *sctx, u64 ino, u64 gen, u64 size)
 	int ret = 0;
 	struct fs_path *p;
 
-	btrfs_debug(fs_info, "send_truncate %llu size=%llu", ino, size);
-
 	p = get_path_for_command(sctx, ino, gen);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -2662,8 +2646,6 @@ static int send_chmod(struct send_ctx *sctx, u64 ino, u64 gen, u64 mode)
 	int ret = 0;
 	struct fs_path *p;
 
-	btrfs_debug(fs_info, "send_chmod %llu mode=%llu", ino, mode);
-
 	p = get_path_for_command(sctx, ino, gen);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -2692,8 +2674,6 @@ static int send_fileattr(struct send_ctx *sctx, u64 ino, u64 gen, u64 fileattr)
 	if (sctx->proto < 2)
 		return 0;
 
-	btrfs_debug(fs_info, "send_fileattr %llu fileattr=%llu", ino, fileattr);
-
 	p = get_path_for_command(sctx, ino, gen);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -2719,9 +2699,6 @@ static int send_chown(struct send_ctx *sctx, u64 ino, u64 gen, u64 uid, u64 gid)
 	int ret = 0;
 	struct fs_path *p;
 
-	btrfs_debug(fs_info, "send_chown %llu uid=%llu, gid=%llu",
-		    ino, uid, gid);
-
 	p = get_path_for_command(sctx, ino, gen);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -2753,8 +2730,6 @@ static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen)
 	struct btrfs_key key;
 	int slot;
 
-	btrfs_debug(fs_info, "send_utimes %llu", ino);
-
 	p = get_path_for_command(sctx, ino, gen);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -2870,8 +2845,6 @@ static int send_create_inode(struct send_ctx *sctx, u64 ino)
 	u64 mode;
 	u64 rdev;
 
-	btrfs_debug(fs_info, "send_create_inode %llu", ino);
-
 	p = fs_path_alloc();
 	if (!p)
 		return -ENOMEM;
@@ -4224,8 +4197,6 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
 	bool orphanized_dir = false;
 	bool orphanized_ancestor = false;
 
-	btrfs_debug(fs_info, "process_recorded_refs %llu", sctx->cur_ino);
-
 	/*
 	 * This should never happen as the root dir always has the same ref
 	 * which is always '..'
@@ -5338,8 +5309,6 @@ static int send_write(struct send_ctx *sctx, u64 offset, u32 len)
 	int ret = 0;
 	struct fs_path *p;
 
-	btrfs_debug(fs_info, "send_write offset=%llu, len=%d", offset, len);
-
 	p = get_cur_inode_path(sctx);
 	if (IS_ERR(p))
 		return PTR_ERR(p);
@@ -5372,11 +5341,6 @@ static int send_clone(struct send_ctx *sctx,
 	struct fs_path *cur_inode_path;
 	u64 gen;
 
-	btrfs_debug(sctx->send_root->fs_info,
-		    "send_clone offset=%llu, len=%d, clone_root=%llu, clone_inode=%llu, clone_offset=%llu",
-		    offset, len, btrfs_root_id(clone_root->root),
-		    clone_root->ino, clone_root->offset);
-
 	cur_inode_path = get_cur_inode_path(sctx);
 	if (IS_ERR(cur_inode_path))
 		return PTR_ERR(cur_inode_path);
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: send: remove btrfs_debug() calls
  2025-04-29  8:53 [PATCH] btrfs: send: remove btrfs_debug() calls David Sterba
@ 2025-04-30  9:28 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-04-30  9:28 UTC (permalink / raw)
  To: David Sterba, linux-btrfs; +Cc: oe-kbuild-all, David Sterba

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on linus/master v6.15-rc4 next-20250429]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Sterba/btrfs-send-remove-btrfs_debug-calls/20250429-165603
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
patch link:    https://lore.kernel.org/r/20250429085349.2169622-1-dsterba%40suse.com
patch subject: [PATCH] btrfs: send: remove btrfs_debug() calls
config: arc-randconfig-001-20250430 (https://download.01.org/0day-ci/archive/20250430/202504301726.KJfSXyNW-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250430/202504301726.KJfSXyNW-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504301726.KJfSXyNW-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/btrfs/send.c: In function 'send_rename':
>> fs/btrfs/send.c:819:31: warning: unused variable 'fs_info' [-Wunused-variable]
     819 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_link':
   fs/btrfs/send.c:841:31: warning: unused variable 'fs_info' [-Wunused-variable]
     841 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_unlink':
   fs/btrfs/send.c:862:31: warning: unused variable 'fs_info' [-Wunused-variable]
     862 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_rmdir':
   fs/btrfs/send.c:882:31: warning: unused variable 'fs_info' [-Wunused-variable]
     882 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'find_extent_clone':
>> fs/btrfs/send.c:1568:13: warning: variable 'logical' set but not used [-Wunused-but-set-variable]
    1568 |         u64 logical;
         |             ^~~~~~~
   fs/btrfs/send.c: In function 'send_truncate':
   fs/btrfs/send.c:2620:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2620 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_chmod':
   fs/btrfs/send.c:2645:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2645 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_fileattr':
   fs/btrfs/send.c:2670:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2670 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_chown':
   fs/btrfs/send.c:2698:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2698 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_utimes':
   fs/btrfs/send.c:2724:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2724 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_create_inode':
   fs/btrfs/send.c:2839:31: warning: unused variable 'fs_info' [-Wunused-variable]
    2839 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~
   fs/btrfs/send.c: In function 'send_write':
   fs/btrfs/send.c:5308:31: warning: unused variable 'fs_info' [-Wunused-variable]
    5308 |         struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
         |                               ^~~~~~~


vim +/fs_info +819 fs/btrfs/send.c

31db9f7c23fbf7e Alexander Block 2012-07-25  812  
31db9f7c23fbf7e Alexander Block 2012-07-25  813  /*
31db9f7c23fbf7e Alexander Block 2012-07-25  814   * Sends a move instruction to user space
31db9f7c23fbf7e Alexander Block 2012-07-25  815   */
31db9f7c23fbf7e Alexander Block 2012-07-25  816  static int send_rename(struct send_ctx *sctx,
31db9f7c23fbf7e Alexander Block 2012-07-25  817  		     struct fs_path *from, struct fs_path *to)
31db9f7c23fbf7e Alexander Block 2012-07-25  818  {
04ab956ee69cdbe Jeff Mahoney    2016-09-20 @819  	struct btrfs_fs_info *fs_info = sctx->send_root->fs_info;
31db9f7c23fbf7e Alexander Block 2012-07-25  820  	int ret;
31db9f7c23fbf7e Alexander Block 2012-07-25  821  
31db9f7c23fbf7e Alexander Block 2012-07-25  822  	ret = begin_cmd(sctx, BTRFS_SEND_C_RENAME);
31db9f7c23fbf7e Alexander Block 2012-07-25  823  	if (ret < 0)
264515c7cb62661 Filipe Manana   2025-02-20  824  		return ret;
31db9f7c23fbf7e Alexander Block 2012-07-25  825  
31db9f7c23fbf7e Alexander Block 2012-07-25  826  	TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, from);
31db9f7c23fbf7e Alexander Block 2012-07-25  827  	TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH_TO, to);
31db9f7c23fbf7e Alexander Block 2012-07-25  828  
31db9f7c23fbf7e Alexander Block 2012-07-25  829  	ret = send_cmd(sctx);
31db9f7c23fbf7e Alexander Block 2012-07-25  830  
31db9f7c23fbf7e Alexander Block 2012-07-25  831  tlv_put_failure:
31db9f7c23fbf7e Alexander Block 2012-07-25  832  	return ret;
31db9f7c23fbf7e Alexander Block 2012-07-25  833  }
31db9f7c23fbf7e Alexander Block 2012-07-25  834  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-30  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29  8:53 [PATCH] btrfs: send: remove btrfs_debug() calls David Sterba
2025-04-30  9:28 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox