All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs-progs: receive, add debug information to write and clone commands
Date: Fri, 29 Mar 2019 19:35:26 +0000	[thread overview]
Message-ID: <20190329193526.21315-1-fdmanana@kernel.org> (raw)

From: Filipe Manana <fdmanana@suse.com>

Currently, when operating in a more verbose mode (-vv), the receive command
does not mention any write or clone commands, unlike other commands.

This change adds debug messages for the write and clone operations, that do
not include data but only offsets and lengths, as this is actually very
useful to debug a send stream and I use it frequently.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 cmds-receive.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cmds-receive.c b/cmds-receive.c
index 3888149a..5d06f286 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -704,6 +704,10 @@ static int process_write(const char *path, const void *data, u64 offset,
 	if (ret < 0)
 		goto out;
 
+	if (g_verbose >= 2)
+		fprintf(stderr, "write %s - offset=%llu length=%llu\n",
+			path, offset, len);
+
 	while (pos < len) {
 		w = pwrite(rctx->write_fd, (char*)data + pos, len - pos,
 				offset + pos);
@@ -808,6 +812,11 @@ static int process_clone(const char *path, u64 offset, u64 len,
 		goto out;
 	}
 
+	if (g_verbose >= 2)
+		fprintf(stderr,
+			"clone %s - source=%s source offset=%llu offset=%llu length=%llu\n",
+			path, clone_path, clone_offset, offset, len);
+
 	clone_args.src_fd = clone_fd;
 	clone_args.src_offset = clone_offset;
 	clone_args.src_length = len;
-- 
2.11.0


             reply	other threads:[~2019-03-29 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 19:35 fdmanana [this message]
2019-05-15 14:21 ` [PATCH] Btrfs-progs: receive, add debug information to write and clone commands David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190329193526.21315-1-fdmanana@kernel.org \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.