函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rb_alloc_aux

函数原型:int rb_alloc_aux(struct ring_buffer *rb, struct perf_event *event, unsigned long pgoff, int nr_pages, long watermark, int flags)

返回类型:int

参数:

类型参数名称
struct ring_buffer *rb
struct perf_event *event
unsigned longpgoff
intnr_pages
longwatermark
intflags
668  overwrite等于非flags按位与Buffer handling 的值
669  node等于如果cpu恒等于负1则负1否则cpu_to_node(cpu)
670  ret等于负ENOMEM
672  如果非has_aux(event)则返回:负EOPNOTSUPP
679  max_order等于log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (nr_pages)
685  如果非overwrite
686  如果非max_order则返回:负EINVAL
689  max_order自减
692  aux_pages等于kcalloc_node(nr_pages, *的长度, GFP_KERNEL, node)
694  如果非aux_pages则返回:负ENOMEM
697  free_aux等于free_aux
698 aux_nr_pages小于nr_pages循环
702  order等于两数取小(max_order, log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (nr_pages - aux_nr_pages))
703  page等于rb_alloc_aux_page(node, order)
704  如果非page则转到:out
707 last大于aux_nr_pages循环aux_pages[aux_nr_pages]等于page_address(page++)
718  如果capabilities按位与PERF_PMU_CAP_AUX_NO_SGoverwrite
720  page等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(aux_pages[0])
722  如果page_private(page)不等于max_order则转到:out
726  aux_priv等于setup_aux(event, aux_pages, nr_pages, overwrite)
728  如果非aux_priv则转到:out
731  ret等于0
739  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
741  aux_overwrite等于overwrite
742  aux_watermark等于watermark
744  如果非aux_watermark且非aux_overwriteaux_watermark等于nr_pages左移PAGE_SHIFT determines the page size 减1位
747  out :
748  如果非retaux_pgoff等于pgoff
750  否则__rb_free_aux(rb)
753  返回:ret
调用者
名称描述
perf_mmap