btrace(8) support to symbolize utrace addresses.
authorclaudio <claudio@openbsd.org>
Fri, 12 May 2023 14:14:16 +0000 (14:14 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 12 May 2023 14:14:16 +0000 (14:14 +0000)
commit5e6104a1cca873aa48d4fcbbe867cf81070014b5
treefccbecebc5bf1123c32b386f72e8d92ff20155e6
parent6538316403f5b4a503c4cfbad96069b4942cf92e
btrace(8) support to symbolize utrace addresses.

This only works for a single static binary where everything was compiled
with -fno-omit-frame-pointer since the stack unwinder requires the
frame-pointer.

A possible btrace script to capture performace of a single process is:
profile:hz:100 / pid == $1 / {
        @[ustack] = count();
}
Then using btrace -p program uprofile.bt `pgrep program` will collect
the information for program.

This is far from perfect but should allow other people to play with this
and hopefully improve work.
OK mpi@
usr.sbin/btrace/btrace.c
usr.sbin/btrace/btrace.h
usr.sbin/btrace/ksyms.c