set profiling { tasks } { auto | on | off }
Enables or disables CPU profiling for the indicated subsystem. This is
equivalent to setting or clearing the "profiling" settings in the "global"
- section of the configuration file. Please also see "show profiling".
+ section of the configuration file. Please also see "show profiling". Note
+ that manually setting the tasks profiling to "on" automatically resets the
+ scheduler statistics, thus allows to check activity over a given interval.
set rate-limit connections global <value>
Change the process-wide connection rate limit, which is set by the global
if (strcmp(args[3], "on") == 0) {
unsigned int old = profiling;
+ int i;
+
while (!_HA_ATOMIC_CAS(&profiling, &old, (old & ~HA_PROF_TASKS_MASK) | HA_PROF_TASKS_ON))
;
+ /* also flush current profiling stats */
+ for (i = 0; i < 256; i++) {
+ HA_ATOMIC_STORE(&sched_activity[i].calls, 0);
+ HA_ATOMIC_STORE(&sched_activity[i].cpu_time, 0);
+ HA_ATOMIC_STORE(&sched_activity[i].lat_time, 0);
+ HA_ATOMIC_STORE(&sched_activity[i].func, NULL);
+ }
}
else if (strcmp(args[3], "auto") == 0) {
unsigned int old = profiling;