函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Add a message to per-CPU context-dependent buffer

函数原型:static __printf(2, 0) int printk_safe_log_store(struct printk_safe_seq_buf *s, const char *fmt, va_list args)

返回类型:int

参数:

类型参数名称
struct printk_safe_seq_buf *s
const char *fmt
va_listargs
75  again :
76  len等于atomic_read( & length of written data )
79  如果len大于等于buffer的长度减1则
80  atomic_inc( & message_lost)
81  Get flushed in a more safe context.
82  返回:0
89  如果非lensmp_rmb()
92  va_copy(ap, args)
93  add等于格式化输出字符串
94  va_end(ap)
95  如果非add则返回:0
103  如果atomic_cmpxchg( & length of written data , len, len + add)不等于len则转到:again
106  Get flushed in a more safe context.
107  返回:add
调用者
名称描述
vprintk_safeLock-less printk(), to avoid deadlocks should the printk() recurse* into itself. It uses a per-CPU buffer to store the message, just like* NMI.