Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_parse_vmlinux

Proto:struct btf *btf_parse_vmlinux(void)

Type:struct btf

Parameter:Nothing

3551  struct btf_verifier_env * env = NULL
3553  struct btf * btf = NULL
3556  env = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
3557  If Not env Then Return ERR_PTR( - ENOMEM)
3560  log = log
3561  level = kernel internal flag
3563  btf = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
3564  If Not btf Then
3565  err = -ENOMEM
3566  Go to errout
3568  btf = btf
3570  data = _binary__btf_vmlinux_bin_start
3571  data_size = _binary__btf_vmlinux_bin_end - _binary__btf_vmlinux_bin_start
3574  err = btf_parse_hdr(env)
3575  If err Then Go to errout
3578  nohdr_data = data + hdr_len
3580  err = btf_parse_str_sec(env)
3581  If err Then Go to errout
3584  err = btf_check_all_metas(env)
3585  If err Then Go to errout
3589  When i <= nr_types cycle
3593  t = btf_type_by_id(btf, i)
3594  If Not __btf_type_is_struct(t) Then Continue
3596  tname = __btf_name_by_offset(btf, name_off)
3597  If Not strcmp(tname, "bpf_ctx_convert") Then
3599  t = t
3600  Break
3603  If i > nr_types Then
3604  err = -ENOENT
3605  Go to errout
3608  btf_verifier_env_free(env)
3609  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
3610  Return btf
3612  errout :
3613  btf_verifier_env_free(env)
3614  If btf Then
3615  kvfree(types)
3616  kfree(btf)
3618  Return ERR_PTR(err)
Caller
NameDescribe
bpf_check