Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_prog_array_copy

Proto:int bpf_prog_array_copy(struct bpf_prog_array *old_array, struct bpf_prog *exclude_prog, struct bpf_prog *include_prog, struct bpf_prog_array **new_array)

Type:int

Parameter:

TypeParameterName
struct bpf_prog_array *old_array
struct bpf_prog *exclude_prog
struct bpf_prog *include_prog
struct bpf_prog_array **new_array
1960  carry_prog_cnt = 0
1963  bool found_exclude = false
1964  new_prog_idx = 0
1969  If old_array Then
1970  existing = items
1971  When prog cycle
1972  If prog == exclude_prog Then
1973  found_exclude = true
1974  Continue
1976  If prog != prog Then carry_prog_cnt++
1978  If prog == include_prog Then Return -EEXIST
1983  If exclude_prog && Not found_exclude Then Return -ENOENT
1987  new_prog_cnt = carry_prog_cnt
1988  If include_prog Then new_prog_cnt += 1
1992  If Not new_prog_cnt Then
1993  * new_array = NULL
1994  Return 0
1998  array = bpf_prog_array_alloc(new_prog_cnt + 1, GFP_KERNEL)
1999  If Not array Then Return -ENOMEM
2003  If carry_prog_cnt Then
2004  existing = items
2005  When prog cycle If prog != exclude_prog && prog != prog Then
2008  prog = prog
2012  If include_prog Then prog = include_prog
2014  prog = NULL
2015  new_array = array
2016  Return 0
Caller
NameDescribe
perf_event_detach_bpf_prog