• Mark Drayton's avatar
    biolatency: Fix --disks bpf_probe_read() (#1980) · fc245dfe
    Mark Drayton authored
    bpf_probe_read()'s third argument is no longer rewritten. Instead, use a
    temporary variable (like #1973) to avoid a memory access error.
    
    Before:
    
    ```
    $ sudo biolatency -D 1
    bpf: Failed to load program: Permission denied
    0: (79) r1 = *(u64 *)(r1 +112)
    1: (7b) *(u64 *)(r10 -8) = r1
    [..]
    R1 invalid mem access 'inv'
    
    HINT: The invalid mem access 'inv' error can happen if you try to
    dereference memory without first using bpf_probe_read() to copy it to
    the BPF stack. Sometimes the bpf_probe_read is automatic by the bcc
    rewriter, other times you'll need to be explicit.
    ```
    
    After, works as expected.
    fc245dfe
biolatency.py 4.09 KB