History log of /openbsd/usr.sbin/btrace/ksyms.c (Results 1 – 10 of 10)
Revision Date Author Comments
# 3e48d9ff 01-Apr-2024 jsg <jsg@openbsd.org>

init var to fix missing symtab section path
found by smatch, ok mpi@


# eaddcb2f 16-Mar-2024 cheloha <cheloha@openbsd.org>

btrace(8): cache ELF symbols in sorted array

Currently, every kelf_snprintsym() call performs a linear search
through the .symtab for a symbol matching the given PC. The search is
expensive and see

btrace(8): cache ELF symbols in sorted array

Currently, every kelf_snprintsym() call performs a linear search
through the .symtab for a symbol matching the given PC. The search is
expensive and seems to be a major source of dropped profiling events.

Storing all STT_FUNC .symtab entries and their names in a sorted array
cuts search time from O(n) to O(lg n). In practice, the faster
lookups seem to dramatically reduce the profiling drop rate.

With tweaks from mpi@.

Thread: https://marc.info/?l=openbsd-tech&m=170830125132105&w=2

ok mpi@

show more ...


# 81c0b8be 14-Mar-2024 cheloha <cheloha@openbsd.org>

Revert "btrace(8): cache ELF .symtab, .strtab entries in sorted array"

"No it's not okay." mpi@


# 43ae943e 12-Mar-2024 cheloha <cheloha@openbsd.org>

btrace(8): cache ELF .symtab, .strtab entries in sorted array

Currently, every kelf_snprintsym() call performs a linear search
through the .symtab for a matching symbol. The search is very
costly a

btrace(8): cache ELF .symtab, .strtab entries in sorted array

Currently, every kelf_snprintsym() call performs a linear search
through the .symtab for a matching symbol. The search is very
costly and causes btrace(8) to drop a lot of profiling events.

Storing the STT_FUNC .symtab entries and their corresponding .strtab
entries in a sorted array cuts the lookup cost from O(n) to O(lg n).
Lower overhead reduces the drop rate for profiling events.

With tweaks from mpi@.

Thread: https://marc.info/?l=openbsd-tech&m=170830125132105&w=2

probably ok mpi@

show more ...


# 165eb691 10-Nov-2023 jasper <jasper@openbsd.org>

zap some unused includes


# 5e6104a1 12-May-2023 claudio <claudio@openbsd.org>

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-poi

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@

show more ...


# 06176cf5 10-Feb-2021 deraadt <deraadt@openbsd.org>

cast large to reduce warning on 32-bit machines (an ELF type is printed with %ll)


# 27f0efda 07-Dec-2020 bluhm <bluhm@openbsd.org>

In btrace(8) handle snprintf(3) errors correctly. If snprintf
fails, buffer is unchanged; initialize it with empty string. snprintf
may return negative value or the length that would have been writ

In btrace(8) handle snprintf(3) errors correctly. If snprintf
fails, buffer is unchanged; initialize it with empty string. snprintf
may return negative value or the length that would have been written;
check and calculate remaining size. snprintf writes size - 1
characters; pass buffer size as length.
OK mpi@

show more ...


# 199e5b12 13-Aug-2020 mpi <mpi@openbsd.org>

Be compatible with bpftrace(8)'s output when printing stack traces in maps.

This allows us to use `stackcollapse-bpftrace.pl' from Brendan Gregg's
FrameGraph without pre-processing outputs.


# 23160851 21-Jan-2020 mpi <mpi@openbsd.org>

Import a bug tracer, companion of dt(4), that speaks the bt(5) language.

ok kettenis@, visa@, jasper@, deraadt@