]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: cpumap add tracepoints
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 16 Oct 2017 10:19:44 +0000 (12:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 11:12:18 +0000 (12:12 +0100)
commit0842a281335403656602003b26c495f77366618b
tree20eed724e856cfae290ed8b3730c6b2a9af819ea
parentbd6f29b9a9f6c29b030aab15912ff6a49b74ead6
bpf: cpumap add tracepoints

This adds two tracepoint to the cpumap.  One for the enqueue side
trace_xdp_cpumap_enqueue() and one for the kthread dequeue side
trace_xdp_cpumap_kthread().

To mitigate the tracepoint overhead, these are invoked during the
enqueue/dequeue bulking phases, thus amortizing the cost.

The obvious use-cases are for debugging and monitoring.  The
non-intuitive use-case is using these as a feedback loop to know the
system load.  One can imagine auto-scaling by reducing, adding or
activating more worker CPUs on demand.

V4: tracepoint remove time_limit info, instead add sched info

V8: intro struct bpf_cpu_map_entry members cpu+map_id in this patch

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/xdp.h
kernel/bpf/cpumap.c