From 8e21176c3cff203c1b991fda55df3ac7904d09fa Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Fri, 18 Aug 2017 15:20:18 -0700 Subject: pack: move pack_report() Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- packfile.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'packfile.c') diff --git a/packfile.c b/packfile.c index 0f46e06175..60d9fc3b03 100644 --- a/packfile.c +++ b/packfile.c @@ -35,3 +35,27 @@ struct packed_git *packed_git; static struct mru packed_git_mru_storage; struct mru *packed_git_mru = &packed_git_mru_storage; + +#define SZ_FMT PRIuMAX +static inline uintmax_t sz_fmt(size_t s) { return s; } + +void pack_report(void) +{ + fprintf(stderr, + "pack_report: getpagesize() = %10" SZ_FMT "\n" + "pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n" + "pack_report: core.packedGitLimit = %10" SZ_FMT "\n", + sz_fmt(getpagesize()), + sz_fmt(packed_git_window_size), + sz_fmt(packed_git_limit)); + fprintf(stderr, + "pack_report: pack_used_ctr = %10u\n" + "pack_report: pack_mmap_calls = %10u\n" + "pack_report: pack_open_windows = %10u / %10u\n" + "pack_report: pack_mapped = " + "%10" SZ_FMT " / %10" SZ_FMT "\n", + pack_used_ctr, + pack_mmap_calls, + pack_open_windows, peak_pack_open_windows, + sz_fmt(pack_mapped), sz_fmt(peak_pack_mapped)); +} -- cgit v1.3