函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer.c Create Date:2022-07-27 13:01:21
Last Modify:2020-03-17 19:30:04 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:We only allocate new buffers, never free them if the CPU goes down.* If we were to free the buffer, then the user would lose any trace that was in* the buffer.

函数原型:int trace_rb_cpu_prepare(unsigned int cpu, struct hlist_node *node)

返回类型:int

参数:

类型参数名称
unsigned intcpu
struct hlist_node *node
4876  buffer等于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.(node, structring_buffer, node)
4877  如果测试CPU信息则返回:0
4880  nr_pages等于0
4881  nr_pages_same等于1
4883  for_each_buffer_cpu(buffer, cpu_i)
4885  如果nr_pages恒等于0则nr_pages等于nr_pages
4887  如果nr_pages不等于nr_pages
4888  nr_pages_same等于0
4889  退出
4893  如果非nr_pages_samenr_pages等于2
4895  buffers[cpu]等于rb_allocate_cpu_buffer(buffer, nr_pages, cpu)
4897  如果非buffers[cpu]则
4898  WARN(1, "failed to allocate ring buffer on CPU %u\n", cpu)
4900  返回:负ENOMEM
4902  smp_wmb()
4903  设置CPU信息
4904  返回:0