CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2023/10/22 13:30:35

Modified files:
        usr.sbin/btrace: btrace.c bt.5 
        regress/usr.sbin/btrace: exit.bt exit.ok mapoverwrite.ok 

Log message:
bt(5), btrace(8): execute END probe and print non-empty maps upon exit()

BPFTrace's exit() statement executes the END probe (if any) and prints
the contents of all non-empty maps before terminating the interpreter.

Implement this in btrace(8) with a halting check after each statement.
If a statement causes the program to halt, the condition bubbles up to
the top-level evaluation loop and causes rules_teardown() to run
immediately.

btrace(8) still performs a full rules_setup() if exit() is called
during the BEGIN probe, though the top-level evaluation loop is never
run.

One edge-like case: an exit() from the END probe is treated as an
early return; END is not executed multiple times.

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

ok mpi@

Reply via email to