]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: trace: implement tracing disabling API
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 17 Dec 2024 15:28:16 +0000 (16:28 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 Dec 2024 08:52:06 +0000 (09:52 +0100)
commit9d155ca7064290d3280621c85443221fa13334b2
treef950f154a6abb53e07d11ec2d1ba8ece51b374bd
parent41f0472d967b2deb095d5adc8a167da973fbee3d
MINOR: trace: implement tracing disabling API

Define a set of functions to temporarily disable/reactivate tracing for
the current thread. This could be useful when wanting to quickly remove
tracing output for some code parts.

The API relies on a disable/resume set of functions, with a thread-local
counter. This counter is tested under __trace_enabled(). It is a
cumulative value so that the same count of resume must be issued after
several disable usage. There is also the possibility to force reset the
counter to 0 before restoring the old value.

This should be backported up to 3.1.
include/haproxy/tinfo-t.h
include/haproxy/trace.h
src/trace.c