brendangregg / bpf-perf-tools-book

Official repository for the BPF Performance Tools book
1.61k stars 284 forks source link

5.9.2 bpftrace -l 'usdt:*' doesnt run on new version. #18

Open asmca opened 2 years ago

asmca commented 2 years ago

book section 5.9.2, page 150, quote"""

bpftrace -l 'usdt:/usr/local/cpython/python'

usdt:/usr/local/cpython/python:line usdt:/usr/local/cpython/python:functionentry usdt:/usr/local/cpython/python:functionreturn ...... """

on my env: Oracle Linux 7.9 kernel: 5.4.17-2136.304.1.el7uek.x86_64

bpftrace-0.13.0-2.el7.x86_64 $bpftrace --version bpftrace v0.13.0

[root@EL7 ~]$bpftrace -l 'usdt:/usr/bin/python' stdin:1:1-21: ERROR: usdt probe type requires 2 or 3 arguments usdt:/usr/bin/python



seems bpftrace -l parameter changes in newer versions.
tmcgilchrist commented 8 months ago

If you extend the command to bpftrace -l 'usdt:*:*' with the extra :* it will show the matched probes. The same change should work for the python example.