diff mbox series

[v2] pack-objects: write objects packed to trace2

Message ID 20190411173626.61561-1-jonathantanmy@google.com (mailing list archive)
State New, archived
Headers show
Series [v2] pack-objects: write objects packed to trace2 | expand

Commit Message

Jonathan Tan April 11, 2019, 5:36 p.m. UTC
This is useful when investigating performance of pushes, and other times
when no progress information is written (because the pack is written to
stdout).

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
Thanks, Duy and Jeff for your comments. I've switched to Jeff's
suggestion (trace2_data_intmax), which also sidesteps Duy's concern
about PRIu32 vs %d.

As far as I can tell, with this change, the Git invocation needing to be
traced must be run with GIT_TR2_EVENT instead of GIT_TR2, but that's
fine.
---
 builtin/pack-objects.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a154fc29f6..3326aeb497 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -964,6 +964,8 @@  static void write_pack_file(void)
 	if (written != nr_result)
 		die(_("wrote %"PRIu32" objects while expecting %"PRIu32),
 		    written, nr_result);
+	trace2_data_intmax("pack-objects", the_repository,
+			   "write_pack_file/wrote", nr_result);
 }
 
 static int no_try_delta(const char *path)