• Yonghong Song's avatar
    usdt: permit to enable probes from a pid and a particular binary · fead16ad
    Yonghong Song authored
    Currently, for usdt, the commands where both a pid and a binary path
    are specified are not well supported. For example,
    ```
    funccount -p <pid> 'u:<binary_path>:probe'
    ```
    will count `probe` occurances for all binary paths in `pid`, not just
    `<binary_path>`. The command
    ```
    argdist -p <pid> 'u:<binary_path>:probe():s64:arg1'
    ```
    will also count `probe` occurances for all binary paths in `pid`
    with my previous patch.
    
    Furthermore, suppose user want to trace linker `setjmp` probe point
    with command
    ```
    trace.py -p <pid> 'u:/usr/lib64/ld-2.17.so:setjmp'
    ```
    Without my previous patch, user will have incorrect results as both
    `libc:setjmp` and `rtld:setjmp` exists and the bcc just picks the first
    one which is `libc:setjmp`. My last patch will cause `enable_probe`
    failures if in the same usdt context, two probes have the same
    probe_name but different provider name.
    
    To fix all these issues, this patch passes additional binary path
    to the pid-based usdt context, so that only probes from that particular
    binary will be added to the context. This solved all the above
    mentioned issues.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    fead16ad
bcc_usdt.h 2.54 KB