[RFC] filter profiling
Vincent Bernat
bernat at luffy.cx
Tue Aug 29 10:07:03 CEST 2017
❦ 29 août 2017 10:42 +0300, Lennert Buytenhek <buytenh at wantstofly.org> :
>> > Feedback appreciated! (Better ideas also appreciated. :D)
>>
>> Using USDT probes? You can attach arbitrary strings to them. I know perf
>> supports them (with a recent kernel) but I don't know how
>> exactly. However, with systemtap, it's dead easy to see them:
>>
>> stap -e 'probe bird.* { print($$vars) }'
>>
>> For implementation, see:
>> https://github.com/vincentbernat/lldpd/commit/bdfe419389075af3cdfeadc78008a157afc2d5d7
>> https://github.com/vincentbernat/lldpd/commit/140e34f057462d5ff7818ab4af368f055eaad4e3
>
> As far as I can see, these are tracepoints, but they wouldn't let me do
> profiling? What I need is profiling, as I want to know what's consuming
> the most CPU, so I want to be able to fire an event N times per second
> to tell me what bird is doing right at that specific moment, and listing
> or counting tracepoint invocations won't necessarily tell me what's using
> up the most CPU.
I didn't look at your patch, but from my understanding, when you see a
CPU pike, you sent USR2 and it started "tracing". Use of tracepoints
would do the same thing without having to send a signal.
You could also have a tracepoint for "begin", a tracepoint for "end",
you record the current filter by intercepting "begin", remove it on
"end" and you can profile on CPU to know which is the current
filter if BIRD is currently running on a CPU.
--
Conscience doth make cowards of us all.
-- Shakespeare
More information about the Bird-users
mailing list