diff options
author | Beat Bolli <dev+git@drbeat.li> | 2023-07-20 18:48:23 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-20 20:52:53 +0200 |
commit | a27eecea75b3858b4052b191143f144a7e966869 (patch) | |
tree | 23a314b2ea37269e2fedd0b3a46260fa87293030 /trace2 | |
parent | The twelfth batch (diff) | |
download | git-a27eecea75b3858b4052b191143f144a7e966869.tar.xz git-a27eecea75b3858b4052b191143f144a7e966869.zip |
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>
Diffstat (limited to 'trace2')
-rw-r--r-- | trace2/tr2_ctr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/trace2/tr2_ctr.c b/trace2/tr2_ctr.c index b342d3b1a3..6491d25396 100644 --- a/trace2/tr2_ctr.c +++ b/trace2/tr2_ctr.c @@ -27,6 +27,16 @@ static struct tr2_counter_metadata tr2_counter_metadata[TRACE2_NUMBER_OF_COUNTER .name = "test2", .want_per_thread_events = 1, }, + [TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY] = { + .category = "fsync", + .name = "writeout-only", + .want_per_thread_events = 0, + }, + [TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH] = { + .category = "fsync", + .name = "hardware-flush", + .want_per_thread_events = 0, + }, /* Add additional metadata before here. */ }; |