summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11daf39)
raw | patch | inline | side by side (parent: 11daf39)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 23 Dec 2006 07:34:47 +0000 (02:34 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 29 Dec 2006 19:36:45 +0000 (11:36 -0800) |
Much like the alloc_report() function can be useful to report on
object allocation statistics while debugging the new pack_report()
function can be useful to report on the behavior of the mmap window
code used for packfile access.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
object allocation statistics while debugging the new pack_report()
function can be useful to report on the behavior of the mmap window
code used for packfile access.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
sha1_file.c | patch | blob | history |
index c7d7e4dcc0c088ff73ce7fbfb5e13a45d92f0853..a5fc23235ea57cc562074276845e23608eea4960 100644 (file)
--- a/cache.h
+++ b/cache.h
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs);
+extern void pack_report();
extern unsigned char* use_pack(struct packed_git *, struct pack_window **, unsigned long, unsigned int *);
extern void unuse_pack(struct pack_window **);
extern struct packed_git *add_packed_git(char *, int, int);
diff --git a/sha1_file.c b/sha1_file.c
index 01a2f8779e955a0ffa37440e5e680905155e84fe..8de8ce0a728bb5df75557d85c2ad0d55648af90d 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
}
static unsigned int pack_used_ctr;
+static unsigned int pack_mmap_calls;
+static unsigned int peak_pack_open_windows;
+static unsigned int pack_open_windows;
+static size_t peak_pack_mapped;
static size_t pack_mapped;
static size_t page_size;
struct packed_git *packed_git;
+void pack_report()
+{
+ fprintf(stderr,
+ "pack_report: getpagesize() = %10lu\n"
+ "pack_report: core.packedGitWindowSize = %10lu\n"
+ "pack_report: core.packedGitLimit = %10lu\n",
+ page_size,
+ packed_git_window_size,
+ 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 = %10lu / %10lu\n",
+ pack_used_ctr,
+ pack_mmap_calls,
+ pack_open_windows, peak_pack_open_windows,
+ pack_mapped, peak_pack_mapped);
+}
+
static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
void **idx_map_)
{
}
}
free(lru_w);
+ pack_open_windows--;
return 1;
}
return 0;
die("packfile %s cannot be mapped: %s",
p->pack_name,
strerror(errno));
+ pack_mmap_calls++;
+ pack_open_windows++;
+ if (pack_mapped > peak_pack_mapped)
+ peak_pack_mapped = pack_mapped;
+ if (pack_open_windows > peak_pack_open_windows)
+ peak_pack_open_windows = pack_open_windows;
win->next = p->windows;
p->windows = win;
}