pack: move pack_report()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Aug 18, 2017 at 15:20 UTC 8e21176c3cff203c1b991fda55df3ac7904d09fa
4 files changed +26 -26
cache.h
-2
@@ -1626,8 +1626,6 @@ unsigned long approximate_object_count(void);
1626 extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
1627 struct packed_git *packs);
1628
1629 -extern void pack_report(void);
1630 -
1629 /*
1630 * Create a temporary file rooted in the object database directory, or
1631 * die on failure. The filename is taken from "pattern", which should have the
packfile.c
+24
@@ -35,3 +35,27 @@ struct packed_git *packed_git;
35
36 static struct mru packed_git_mru_storage;
37 struct mru *packed_git_mru = &packed_git_mru_storage;
38 +
39 +#define SZ_FMT PRIuMAX
40 +static inline uintmax_t sz_fmt(size_t s) { return s; }
41 +
42 +void pack_report(void)
43 +{
44 + fprintf(stderr,
45 + "pack_report: getpagesize() = %10" SZ_FMT "\n"
46 + "pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
47 + "pack_report: core.packedGitLimit = %10" SZ_FMT "\n",
48 + sz_fmt(getpagesize()),
49 + sz_fmt(packed_git_window_size),
50 + sz_fmt(packed_git_limit));
51 + fprintf(stderr,
52 + "pack_report: pack_used_ctr = %10u\n"
53 + "pack_report: pack_mmap_calls = %10u\n"
54 + "pack_report: pack_open_windows = %10u / %10u\n"
55 + "pack_report: pack_mapped = "
56 + "%10" SZ_FMT " / %10" SZ_FMT "\n",
57 + pack_used_ctr,
58 + pack_mmap_calls,
59 + pack_open_windows, peak_pack_open_windows,
60 + sz_fmt(pack_mapped), sz_fmt(peak_pack_mapped));
61 +}
packfile.h
+2
@@ -33,4 +33,6 @@ extern unsigned int pack_max_fds;
33 extern size_t peak_pack_mapped;
34 extern size_t pack_mapped;
35
36 +extern void pack_report(void);
37 +
38 #endif
sha1_file.c
-24
@@ -30,9 +30,6 @@
30 #include "quote.h"
31 #include "packfile.h"
32
33 -#define SZ_FMT PRIuMAX
34 -static inline uintmax_t sz_fmt(size_t s) { return s; }
35 -
33 const unsigned char null_sha1[20];
34 const struct object_id null_oid;
35 const struct object_id empty_tree_oid = {
@@ -684,27 +681,6 @@ static int has_loose_object(const unsigned char *sha1)
681 return check_and_freshen(sha1, 0);
682 }
683
687 -void pack_report(void)
688 -{
689 - fprintf(stderr,
690 - "pack_report: getpagesize() = %10" SZ_FMT "\n"
691 - "pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
692 - "pack_report: core.packedGitLimit = %10" SZ_FMT "\n",
693 - sz_fmt(getpagesize()),
694 - sz_fmt(packed_git_window_size),
695 - sz_fmt(packed_git_limit));
696 - fprintf(stderr,
697 - "pack_report: pack_used_ctr = %10u\n"
698 - "pack_report: pack_mmap_calls = %10u\n"
699 - "pack_report: pack_open_windows = %10u / %10u\n"
700 - "pack_report: pack_mapped = "
701 - "%10" SZ_FMT " / %10" SZ_FMT "\n",
702 - pack_used_ctr,
703 - pack_mmap_calls,
704 - pack_open_windows, peak_pack_open_windows,
705 - sz_fmt(pack_mapped), sz_fmt(peak_pack_mapped));
706 -}
707 -
684 /*
685 * Open and mmap the index file at path, perform a couple of
686 * consistency checks, then record its information to p. Return 0 on