函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-27 12:52:01
Last Modify:2020-03-17 19:20:22 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lay_switch_subbuf - switch to a new sub-buffer*@buf: channel buffer*@length: size of current event* Returns either the length passed in or 0 if full.* Performs sub-buffer-switch tasks such as invoking callbacks,

函数原型:size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)

返回类型:size_t

参数:

类型参数名称
struct rchan_buf *buf
size_tlength
746  如果此条件成立可能性小(为编译器优化)(length > sub-buffer size )则转到:toobig
749  如果current offset into sub-buffer 不等于 sub-buffer size 加1则
750  mporary variable 等于 sub-buffer size current offset into sub-buffer
751  old_subbuf等于count of sub-buffers produced 取模 number of sub-buffers per buffer
752  padding counts per sub-buffer [old_subbuf]等于mporary variable
753  count of sub-buffers produced 自加
754  如果channel file dentry i_size加等于 sub-buffer size padding counts per sub-buffer [old_subbuf]
758  否则ytes consumed before VFS inited 加等于 sub-buffer size padding counts per sub-buffer [old_subbuf]
761  smp_mb()
773  old等于start of current sub-buffer
774  new_subbuf等于count of sub-buffers produced 取模 number of sub-buffers per buffer
775  new等于start of channel buffer new_subbuf sub-buffer size
776  current offset into sub-buffer 等于0
777  如果非subbuf_start(buf, new, old, mporary variable )则
778  current offset into sub-buffer 等于 sub-buffer size 加1
779  返回:0
781  start of current sub-buffer 等于new
782  padding counts per sub-buffer [new_subbuf]等于0
784  如果此条件成立可能性小(为编译器优化)(length + current offset into sub-buffer > sub-buffer size )则转到:toobig
787  返回:length
789  toobig :
790  tried to log event > subbuf size 等于length
791  返回:0
调用者
名称描述
relay_flushlay_flush - close the channel*@chan: the channel* Flushes all channel buffers, i.e. forces buffer switch.