Skip to content

Commit df93cf7

Browse files
committed
MINOR: mux-h2: count glitches when they're reported
The h2c_report_glitch() function is now replaced with a macro to support enumerating counters for each individual glitch line. For now this adds 43 such counters. The macro supports an optional description, though that is not being used for now. It gives outputs like this (note that the last one was purposely instrumented to pass a description): > debug dev counters glt all 0 GLT mux_h2.c:5976 h2c_dec_hdrs() 0 GLT mux_h2.c:5960 h2c_dec_hdrs() (...) 0 GLT mux_h2.c:2207 h2c_frt_recv_preface() 0 GLT mux_h2.c:1954 h2c_frt_stream_new(): new stream too early As a reminder, this requires to build with -DDEBUG_GLITCHES=1.
1 parent 502790e commit df93cf7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mux_h2.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,12 @@ static void __maybe_unused h2s_alert(struct h2s *h2s)
15861586
* glitch limit was reached, in which case an error is also reported on the
15871587
* connection.
15881588
*/
1589-
static inline int h2c_report_glitch(struct h2c *h2c, int increment)
1589+
#define h2c_report_glitch(h2c, inc, ...) ({ \
1590+
COUNT_GLITCH(__VA_ARGS__); \
1591+
_h2c_report_glitch(h2c, inc); \
1592+
})
1593+
1594+
static inline int _h2c_report_glitch(struct h2c *h2c, int increment)
15901595
{
15911596
int thres = (h2c->flags & H2_CF_IS_BACK) ?
15921597
h2_be_glitches_threshold : h2_fe_glitches_threshold;

0 commit comments

Comments
 (0)