• Kirill Smelkov's avatar
    execsnoop: Fix -x handling · 3514bb12
    Kirill Smelkov authored
    Execsnoop's documentation says -x/--fails means "also include failed
    exec()s". However it was programmed to instead skip successful execs on
    -x and without -x show all - successful and unsuccessful ones.
    
    The logic was broken in 5b47e0f8 ("execsnoop: use BPF_PERF_OUTPUT
    instead of trace pipe").
    
    Fix it.
    
    P.S. current test_tools_smoke.py only provides basic infrastructure for
    testing whether tool's BPF program won't break, without anything related
    to options handling, so unfortunately the patch comes without
    corresponding test.
    3514bb12
execsnoop.py 6.93 KB