All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] connect, protocol: log negotiated protocol version
@ 2021-08-03 20:13 Josh Steadmon
  2021-08-03 21:12 ` Taylor Blau
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Josh Steadmon @ 2021-08-03 20:13 UTC (permalink / raw)
  To: git

It is useful for performance monitoring and debugging purposes to know
the wire protocol used for remote operations. This may differ from the
version set in local configuration due to differences in version and/or
configuration between the server and the client. Therefore, log the
negotiated wire protocol version via trace2, for both clients and
servers.

Signed-off-by: Josh Steadmon <steadmon@google.com>
---

Do people have a preference for logging this as an integer (and
therefore having "unknown protocol version" show up as "-1", or should I
add a protocol_version_to_string function so that we can format it
properly? For now I've erred on the side of having a smaller diff.

 connect.c  | 1 +
 protocol.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/connect.c b/connect.c
index 70b13389ba..6e23e3ff2d 100644
--- a/connect.c
+++ b/connect.c
@@ -164,6 +164,7 @@ enum protocol_version discover_version(struct packet_reader *reader)
 		BUG("unknown protocol version");
 	}
 
+	trace2_data_intmax("transfer", NULL, "negotiated-version", version);
 	return version;
 }
 
diff --git a/protocol.c b/protocol.c
index 052d7edbb9..3791d8499e 100644
--- a/protocol.c
+++ b/protocol.c
@@ -89,5 +89,6 @@ enum protocol_version determine_protocol_version_client(const char *server_respo
 			die("protocol error: server explicitly said version 0");
 	}
 
+	trace2_data_intmax("transfer", NULL, "negotiated-version", version);
 	return version;
 }
-- 
2.32.0.554.ge1b32706d8-goog


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

end of thread, other threads:[~2021-08-16 18:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 20:13 [PATCH] connect, protocol: log negotiated protocol version Josh Steadmon
2021-08-03 21:12 ` Taylor Blau
2021-08-04 21:37   ` Josh Steadmon
2021-08-04 21:56     ` Junio C Hamano
2021-08-04 22:17 ` [PATCH v2 0/2] " Josh Steadmon
2021-08-04 22:17   ` [PATCH v2 1/2] protocol: add protocol version formatting function Josh Steadmon
2021-08-04 23:32     ` Ævar Arnfjörð Bjarmason
2021-08-04 22:17   ` [PATCH v2 2/2] connect, protocol: log negotiated protocol version Josh Steadmon
2021-08-04 22:28     ` Eric Sunshine
2021-08-06 21:15       ` Josh Steadmon
2021-08-04 23:40     ` Ævar Arnfjörð Bjarmason
2021-08-05  1:26       ` Taylor Blau
2021-08-05  2:47         ` Ævar Arnfjörð Bjarmason
2021-08-06 21:22           ` Josh Steadmon
2021-08-10 17:20 ` [PATCH v3] " Josh Steadmon
2021-08-16 18:03   ` Taylor Blau

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.