mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
wrapper: use trace2 counters to collect fsync stats
As mentioned in the thread starting at [1], trace2 counters should be used to count events instead of ad-hoc static variables. Convert the two fsync static variables to trace2 counters, reducing the coupling between wrapper.c and the trace2 subsystem. Adjust t/t5351 to match the trace2 counter output format. The counters are not per-thread because the ones being replaced also were not. [1] https://lore.kernel.org/git/20230627195251.1973421-2-calvinwan@google.com/ Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
cba07a324d
commit
a27eecea75
4
trace2.h
4
trace2.h
@@ -552,6 +552,10 @@ enum trace2_counter_id {
|
||||
TRACE2_COUNTER_ID_TEST1 = 0, /* emits summary event only */
|
||||
TRACE2_COUNTER_ID_TEST2, /* emits summary and thread events */
|
||||
|
||||
/* counts number of fsyncs */
|
||||
TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY,
|
||||
TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH,
|
||||
|
||||
/* Add additional counter definitions before here. */
|
||||
TRACE2_NUMBER_OF_COUNTERS
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user