MINOR: activity: make profiling more manageable
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2021 20:44:22 +0000 (21:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Jan 2021 11:10:33 +0000 (12:10 +0100)
commitaa622b822bcb834405e251d007525f49dc8bfd42
tree0d115fa812984aebc3e77b1d52f8adc2a638e895
parent4deeb1055f8f7e3feec195233f1ad3b3bf90accb
MINOR: activity: make profiling more manageable

In 2.0, commit d2d3348ac ("MINOR: activity: enable automatic profiling
turn on/off") introduced an automatic mode to enable/disable profiling.
The problem is that the automatic mode automatically changes to on/off,
which implied that the forced on/off modes aren't sticky anymore. It's
annoying when debugging because as soon as the load decreases, profiling
stops.

This makes a small change which ought to have been done first, which
consists in having two states for "auto" (auto-on, auto-off) to
distinguish them from the forced states. Setting to "auto" in the config
defaults to "auto-off" as before, and setting it on the CLI switches to
auto but keeps the current operating state.

This is simple enough to be backported to older releases if needed.
include/haproxy/activity-t.h
include/haproxy/activity.h
src/activity.c