MINOR: activity: declare a new structure to collect per-function activity
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2021 18:19:26 +0000 (19:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Jan 2021 11:10:33 +0000 (12:10 +0100)
commit3fb6a7b46ea663c0cbece30b7979de1fc9a2b692
tree85413b0197907da066eabcdabc3f1ff54913c980
parentaa622b822bcb834405e251d007525f49dc8bfd42
MINOR: activity: declare a new structure to collect per-function activity

The new sched_activity structure will be used to collect task-level
activity based on the target function. The principle is to declare a
large enough array to make collisions rare (256 entries), and hash
the function pointer using a reduced XXH to decide where to store the
stats. On first computation an entry is definitely assigned to the
array and it's done atomically. A special entry (0) is used to store
collisions ("others"). The goal is to make it easy and inexpensive for
the scheduler code to use these to store #calls, cpu_time and lat_time
for each task.
include/haproxy/activity-t.h
include/haproxy/activity.h
src/activity.c