Skip to content

[Proposal] Potential APIs for enumerating USDT probes in libbpf #918

@Phoenix500526

Description

@Phoenix500526

The bcc framework is not a recommendation for ebpf program writing, and projects like bpftrace are migrating towards libbpf.
In bcc, there are APIs available for querying USDT probe information (see example in bpftrace
). With the migration, we run into the gap that libbpf currently doesn’t provide similar functionality, which forces users to parse ELF files manually.

The process of discovering USDTs actually involves two distinct responsibilities:

  1. Discovering binaries (executables and shared libraries) that constitute a process. This is not something libbpf needs to handle. It should be up to the user (e.g. bpftrace) to implement.
  2. Discovering which USDTs belong to a given binary. In principle, this could be provided by libbpf.

At this stage, however, libbpf does not expose any “USDT manager” through its public API, so it seems premature to add such functionality now.

This issue is meant to track the idea and provide context for possible future work, in case we decide to expose APIs such as bpf_program__usdt_probe_list() later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions