Skip to content

Commit 8e21176

Browse files
jonathantanmygitster
authored andcommitted
pack: move pack_report()
Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6d6a80e commit 8e21176

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,8 +1626,6 @@ unsigned long approximate_object_count(void);
16261626
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
16271627
struct packed_git *packs);
16281628

1629-
extern void pack_report(void);
1630-
16311629
/*
16321630
* Create a temporary file rooted in the object database directory, or
16331631
* die on failure. The filename is taken from "pattern", which should have the

packfile.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,27 @@ struct packed_git *packed_git;
3535

3636
static struct mru packed_git_mru_storage;
3737
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ extern unsigned int pack_max_fds;
3333
extern size_t peak_pack_mapped;
3434
extern size_t pack_mapped;
3535

36+
extern void pack_report(void);
37+
3638
#endif

sha1_file.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
#include "quote.h"
3131
#include "packfile.h"
3232

33-
#define SZ_FMT PRIuMAX
34-
static inline uintmax_t sz_fmt(size_t s) { return s; }
35-
3633
const unsigned char null_sha1[20];
3734
const struct object_id null_oid;
3835
const struct object_id empty_tree_oid = {
@@ -684,27 +681,6 @@ static int has_loose_object(const unsigned char *sha1)
684681
return check_and_freshen(sha1, 0);
685682
}
686683

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-
708684
/*
709685
* Open and mmap the index file at path, perform a couple of
710686
* consistency checks, then record its information to p. Return 0 on

0 commit comments

Comments
 (0)