函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:g_buffer_write - write data to the buffer without reserving*@buffer: The ring buffer to write to

函数原型:int ring_buffer_write(struct ring_buffer *buffer, unsigned long length, void *data)

返回类型:int

参数:

类型参数名称
struct ring_buffer *buffer
unsigned longlength
void *data
3123  ret等于负EBUSY
3126  preempt_disable_notrace()
3128  如果atomic_read( & record_disabled)则转到:out
3131  cpu等于These macros fold the SMP functionality into a single CPU system()
3133  如果非测试CPU信息则转到:out
3136  cpu_buffer等于buffers[cpu]
3138  如果atomic_read( & record_disabled)则转到:out
3141  如果length大于Max payload is BUF_PAGE_SIZE - header (8bytes) 则转到:out
3144  如果此条件成立可能性小(为编译器优化)(The lock and unlock are done within a preempt disable section)则转到:out
3147  event等于rb_reserve_next_event(buffer, cpu_buffer, length)
3148  如果非event则转到:out_unlock
3151  body等于line for ring buffer fast paths
3153  内存复制(body, data, length)
3155  rb_commit(cpu_buffer, event)
3157  rb_wakeups(buffer, cpu_buffer)
3159  ret等于0
3161  out_unlock :
3162  trace_recursive_unlock(cpu_buffer)
3164  out :
3165  preempt_enable_notrace()
3167  返回:ret
调用者
名称描述
__buffer_unlock_commit