24–28 Aug 2020
US/Pacific timezone

The way to d_path helper

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

Networking and BPF Summit/Virtual-Room

LPC Virtual

150
Networking & BPF Summit Networking and BPF Summit

Speaker

Jiri Olsa (Red Hat)

Description

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):

SEC("fentry/filp_close")
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

Jiri Olsa (Red Hat)

Presentation materials

Diamond Sponsor

Platinum Sponsors



Gold Sponsors


Silver Sponsors


Catchboxes Sponsor

Conference Services Provided By