Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\bpf_trace.c Create Date:2022-07-28 12:35:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_map_perf_counter

Proto:static __always_inline int get_map_perf_counter(struct bpf_map *map, u64 flags, u64 *value, u64 *enabled, u64 *running)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
u64flags
u64 *value
u64 *enabled
u64 *running
466  array = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_array, map)
467  cpu = smp_processor_id()
468  index = flags & BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and* BPF_FUNC_perf_event_read_value flags.
471  If Value for the false possibility is greater at compile time(flags & ~(BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and* BPF_FUNC_perf_event_read_value flags.)) Then Return -EINVAL
473  If index == BPF_F_CURRENT_CPU Then index = cpu
475  If Value for the false possibility is greater at compile time(index >= max_entries) Then Return -E2BIG
478  ee = READ_ONCE(ptrs[index])
479  If Not ee Then Return -ENOENT
482  Return perf_event_read_local(event, value, enabled, running)
Caller
NameDescribe
____bpf_perf_event_read
____bpf_perf_event_read_value