From: Junio C Hamano Date: Wed, 2 Aug 2023 16:37:23 +0000 (-0700) Subject: Merge branch 'bb/use-trace2-counters-for-fsync-stats' X-Git-Tag: v2.42.0-rc0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52d9dc20e1ddd5ac6b9e9113983b2f8d6977e6b0;p=thirdparty%2Fgit.git Merge branch 'bb/use-trace2-counters-for-fsync-stats' 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 --- 52d9dc20e1ddd5ac6b9e9113983b2f8d6977e6b0 diff --cc trace2.h index d7c3b30538,1890de3436..40d8c2e02a --- a/trace2.h +++ 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 }; diff --cc trace2/tr2_ctr.c index 50570d0165,6491d25396..87cf9034fb --- a/trace2/tr2_ctr.c +++ b/trace2/tr2_ctr.c @@@ -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. */ };