Skip to content

Helper function bpf_read_branch_records

v5.7

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

For an eBPF program attached to a perf event, retrieve the branch records (struct perf_branch_entry) associated to ctx and store it in the buffer pointed by buf up to size size bytes.

Returns

On success, number of bytes written to buf. On error, a negative value.

The flags can be set to BPF_F_GET_BRANCH_RECORDS_SIZE to instead return the number of bytes required to store all the branch entries. If this flag is set, buf may be NULL.

-EINVAL if arguments invalid or size not a multiple of sizeof(struct perf_branch_entry).

-ENOENT if architecture does not support branch records.

static long (* const bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf, __u32 size, __u64 flags) = (void *) 119;

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome