summaryrefslogtreecommitdiff
path: root/tests/diff/diff_helpers.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-29 11:29:49 -0700
committerRussell Belfer <rb@github.com>2014-05-02 09:21:33 -0700
commitb23b112dfe8eceb39eaaea2d5e60d971c4371aa0 (patch)
tree56a6c981856e5f1bf830c3b647a8a58838b044f5 /tests/diff/diff_helpers.h
parent225aab5d6a611076b22f00ae5a28184d92b5259c (diff)
downloadlibgit2-b23b112dfe8eceb39eaaea2d5e60d971c4371aa0.tar.gz
Add payloads, bitmaps to trace API
This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
Diffstat (limited to 'tests/diff/diff_helpers.h')
-rw-r--r--tests/diff/diff_helpers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/diff/diff_helpers.h b/tests/diff/diff_helpers.h
index bf21f4b1f..3ed538702 100644
--- a/tests/diff/diff_helpers.h
+++ b/tests/diff/diff_helpers.h
@@ -62,3 +62,17 @@ extern int diff_foreach_via_iterator(
extern void diff_print(FILE *fp, git_diff *diff);
extern void diff_print_raw(FILE *fp, git_diff *diff);
+
+#include "git2/trace.h"
+
+typedef struct {
+ size_t stat_calls;
+ size_t oid_calcs;
+ size_t submodule_lookups;
+} diff_perf;
+
+extern void diff_perf_track_stats(
+ git_trace_level_t level,
+ void *cb_payload,
+ void *msg_payload,
+ const char *msg);