函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\bpf_trace.c Create Date:2022-07-27 13:45:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:get_map_perf_counter

函数原型:static __always_inline int get_map_perf_counter(struct bpf_map *map, u64 flags, u64 *value, u64 *enabled, u64 *running)

返回类型:int

参数:

类型参数名称
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等于当前cpu ID()
468  index等于flags按位与BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and* BPF_FUNC_perf_event_read_value flags.
471  如果此条件成立可能性小(为编译器优化)(flags & ~(BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and* BPF_FUNC_perf_event_read_value flags.))则返回:负EINVAL
473  如果index恒等于BPF_F_CURRENT_CPUindex等于cpu
475  如果此条件成立可能性小(为编译器优化)(index >= max_entries)则返回:负E2BIG
478  ee等于READ_ONCE(ptrs[index])
479  如果非ee则返回:负ENOENT
482  返回:perf_event_read_local(event, value, enabled, running)
调用者
名称描述
____bpf_perf_event_read
____bpf_perf_event_read_value