aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorNeeraj Singh <neerajsi@microsoft.com>2022-03-30 05:06:40 +0000
committerJunio C Hamano <gitster@pobox.com>2022-03-30 11:15:55 -0700
commit9a4987677d3f65e8cd93b9e77216f0f1026cd9b2 (patch)
treea722fc7be1905b845fd8ef5c6e99cb1c8fc71ed4 /git-compat-util.h
parent805e0a68082a217f0112db9ee86a022227a9c81b (diff)
downloadgit-9a4987677d3f65e8cd93b9e77216f0f1026cd9b2.tar.xz
trace2: add stats for fsync operations
Add some global trace2 statistics for the number of fsyncs performed during the lifetime of a Git process. These stats are printed as part of trace2_cmd_exit_fl, which is presumably where we might want to print any other cross-cutting statistics. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 0892e209a2..4d444dca27 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1282,6 +1282,11 @@ enum fsync_action {
int git_fsync(int fd, enum fsync_action action);
/*
+ * Writes out trace statistics for fsync using the trace2 API.
+ */
+void trace_git_fsync_stats(void);
+
+/*
* Preserves errno, prints a message, but gives no warning for ENOENT.
* Returns 0 on success, which includes trying to unlink an object that does
* not exist.