Thread (138 messages) 138 messages, 17 authors, 2022-09-08

Re: [RFC PATCH 00/30] Code tagging framework and applications

From: Daniel Bristot de Oliveira <hidden>
Date: 2022-09-01 07:37:13
Also in: io-uring, linux-arch, linux-bcache, linux-iommu, linux-mm, lkml, xen-devel

On 9/1/22 09:05, Peter Zijlstra wrote:
quoted
Also, ftrace can drop events. Not really ideal if under system load your memory
accounting numbers start to drift.
You could attach custom handlers to tracepoints. If you were to replace
these unconditional code hooks of yours with tracepoints then you could
conditionally (say at boot) register custom handlers that do the
accounting you want.
That is strategy in RV (kernel/trace/rv/). It is in C, but I am also
adding support for monitors in bpf. The osnoise/timerlat tracers work this
way too, and they are enabled on Fedora/Red Hat/SUSE... production. They
will also be enabled in Ubuntu and Debian (the interwebs say).

The overhead of attaching code to tracepoints (or any "attachable thing") and
processing data in kernel is often lower than consuming it in user-space.
Obviously, when it is possible, e.g., when you respect locking rules, etc.

This paper (the basis for RV) shows a little comparison:
https://bristot.me/wp-content/uploads/2019/09/paper.pdf

By doing so, we also avoid problems of losing events... and you can also
generate other events from your attached code.

(It is also way easier to convince a maintainer to add a tracepoints or a trace
events than to add arbitrary code... ;-)

-- Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help