24-28 August 2020
US/Pacific timezone

The way to d_path helper

25 Aug 2020, 07:00
Networking and BPF Summit/Virtual-Room (LPC 2020)

Networking and BPF Summit/Virtual-Room

LPC 2020

Networking & BPF Summit Networking and BPF Summit


Jiri Olsa


The d_path is eBPF tracing helper, that returns string with
full path for given 'struct path' object and was requested
long time ago by many people.

Along the way of implementing it, other features had to be
added to the verifier:

  • compile time BTF IDs resolving

    This allows using of kernel objects BTF IDs without resolving
    them in runtime and saves few cycles on resolving during kernel
    startup and introducing single interface for accessing such IDs

  • allow to pass BTF ID + offset as helper argument

    This allows to pass an argument to helper, which is defined via parent
    BTF object + offset, like for bpf_d_path (added in following changes):

int BPF_PROG(prog_close, struct file file, void id)
ret = bpf_d_path(&file->f_path, ...

In this talk I'll show implementation details of d_path helper
and details of both aforementioned features and why they are
important for d_path helper.

I agree to abide by the anti-harassment policy I agree

Primary author

Presentation Materials