Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcc tools fixes #2894

Merged
merged 4 commits into from
May 5, 2020
Merged

Commits on Apr 29, 2020

  1. bcc/utils: Avoid code duplication of __generate_streq_function

    bcc tools like trace.py and argdist.py uses _generate_streq_function()
    functions to convert char * read to bpf_probe_read/bpf_probe_read_user.
    Refactor it and move the common functionality to utils.py.
    
    Signed-off-by: Sumanth Korikkar <[email protected]>
    Acked-by: Ilya Leoshkevich <[email protected]>
    sumanthkorikkar committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    99739b2 View commit details
    Browse the repository at this point in the history
  2. bcc: Add __user attribute to support bpf_probe_read_user in argdist

    argdist traces probe functions and its parameter values.
    
    Add functionality to convert:
    - All userspace probes char * read to bpf_probe_read_user()
    - Syscall/kprobes char* params with __user attribute to bpf_probe_read_user()
    
    Signed-off-by: Sumanth Korikkar <[email protected]>
    Acked-by: Ilya Leoshkevich <[email protected]>
    sumanthkorikkar committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    306080b View commit details
    Browse the repository at this point in the history
  3. bcc: Support bpf_probe_read_user in trace.py

    Arguments of a probe point can be either user pointer or kernel
    pointer.
    
    Previously:
    - tools/trace.py 'do_sys_open "%s", arg2'
      When reading arg2 as char *, it would resolve to bpf_probe_read.
    
    Now:
    - tools/trace.py 'do_sys_open "%s", arg2@user'
      - When reading arg2 as char *, it is resolved to bpf_probe_read_user.
    - tools/trace.py 'do_sys_open (STRCMP("test.txt", arg2@user)) "%s", arg2'
      - For arg2 char * read, bpf_probe_read_user is utilized
    
    To distinguish this, add arg@user.
    - All userspace probes char *read converted to bpf_probe_read_user
    - Syscall/kprobes with arg[1-6]@user attribute are converted to
      bpf_probe_read_user.
    
    Signed-off-by: Sumanth Korikkar <[email protected]>
    Acked-by: Ilya Leoshkevich <[email protected]>
    sumanthkorikkar committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    7cbd074 View commit details
    Browse the repository at this point in the history
  4. bcc/libbpf: Fix bpf_has_kernel_btf return status

    bool returns True for negative integers. Hence bcc tools
    tries to switch to kfunc instead of kprobes, even when the
    btf data is not found.
    
    For libbpf_find_vmlinux_btf_id, When err <= 0 , btf is not found.
    
    Signed-off-by: Sumanth Korikkar <[email protected]>
    Acked-by: Ilya Leoshkevich <[email protected]>
    sumanthkorikkar committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    09be5b5 View commit details
    Browse the repository at this point in the history