path: bpftrace_0.24.1-1.1/tests/runtime/watchpoint NAME function_arg_addr_process_flag RUN {{BPFTRACE}} -e 'watchpoint:increment+arg1:4:w { printf("hit!\n"); exit() }' -p $(pidof watchpoint_func) BEFORE ./testprogs/watchpoint_func EXPECT hit! path: bpftrace_0.24.1-1.1/tests/runtime/usdt NAME usdt probes - lists linked library probes by pid RUN {{BPFTRACE}} -l 'usdt:*' -p $(pidof usdt_lib) EXPECT_REGEX usdt:.*/libusdt_tp.so:tracetestlib:lib_probe_1$ BEFORE ./testprogs/usdt_lib path: bpftrace_0.24.1-1.1/tests/runtime/usdt NAME usdt probes - attach to fully specified library probe by pid RUN {{BPFTRACE}} -e 'usdt:./testlibs/libusdt_tp.so:tracetestlib:lib_probe_1 { printf("here\n" ); exit(); }' -p $(pidof usdt_lib) BEFORE ./testprogs/usdt_lib EXPECT here path: bpftrace_0.24.1-1.1/tests/runtime/engine/runner.py child_name = os.path.basename(child_name) childpid = subprocess.Popen(["pidof", child_name], stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].split()[0] bpf_call = re.sub("{{BEFORE_PID}}", str(childpid), bpf_call) env = { path: bpftrace_0.24.1-1.1/docs/migration_guide.md manually include the print statements in your signal handler probe: ``` # bpftrace -e 'BEGIN { @b[1] = 2; } self:signal:SIGUSR1 { print(@b); }' & kill -s USR1 $(pidof bpftrace) ``` path: bpftrace_0.24.1-1.1/docs/migration_guide.md Previously, if the bpftrace process received a `SIGUSR1` signal, it would print all maps to stdout: ``` # bpftrace -e 'BEGIN { @b[1] = 2; }' & kill -s USR1 $(pidof bpftrace) ... @b[1]: 2 path: bpftrace_0.24.1-1.1/docs/migration_guide.md to define custom handling probes: ``` # bpftrace -e 'self:signal:SIGUSR1 { print("hello"); }' & kill -s USR1 $(pidof bpftrace) ... hello path: bpftrace_0.24.1-1.1/tests/runtime/probe NAME signal_order RUN {{BPFTRACE}} -e 'self:signal:SIGUSR1 { printf("first"); } self:signal:SIGUSR1 { printf(" second\n"); exit(); }' AFTER kill -s USR1 $(pidof bpftrace) EXPECT_REGEX (first)+ second path: bpftrace_0.24.1-1.1/tests/runtime/signals NAME custom signal handling probe RUN {{BPFTRACE}} -e 'self:signal:SIGUSR1 { print("signal handler"); exit(); }' AFTER kill -s USR1 $(pidof bpftrace) EXPECT signal handler