]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'bb/use-trace2-counters-for-fsync-stats'
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 Aug 2023 16:37:23 +0000 (09:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Aug 2023 16:37:23 +0000 (09:37 -0700)
Instead of inventing a custom counter variables for debugging,
use existing trace2 facility in the fsync customization codepath.

* bb/use-trace2-counters-for-fsync-stats:
  wrapper: use trace2 counters to collect fsync stats

1  2 
trace2.h
trace2/tr2_ctr.c
wrapper.c

diff --cc trace2.h
index d7c3b30538d7ce54b77026e7a3f7140f392c837f,1890de343691a4662eb5e1e7cfbd48ab0d4eb649..40d8c2e02a5e50ce4f24bc4bd656498773e0853e
+++ b/trace2.h
@@@ -552,8 -552,10 +552,12 @@@ enum trace2_counter_id 
        TRACE2_COUNTER_ID_TEST1 = 0, /* emits summary event only */
        TRACE2_COUNTER_ID_TEST2,     /* emits summary and thread events */
  
 +      TRACE2_COUNTER_ID_PACKED_REFS_JUMPS, /* counts number of jumps */
 +
+       /* 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
  };
index 50570d0165324f6eaaaff581fdea664a1261068f,6491d25396e06ae5f8aec3d04ec74eba5de788b9..87cf9034fba4b91b4d569ea4013e13f9d19b4aa9
@@@ -27,11 -27,16 +27,21 @@@ static struct tr2_counter_metadata tr2_
                .name = "test2",
                .want_per_thread_events = 1,
        },
 +      [TRACE2_COUNTER_ID_PACKED_REFS_JUMPS] = {
 +              .category = "packed-refs",
 +              .name = "jumps_made",
 +              .want_per_thread_events = 0,
 +      },
+       [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. */
  };
diff --cc wrapper.c
Simple merge