Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk_safe.c Create Date:2022-07-28 10:07:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Flush data from the associated per-CPU buffer. The function* can be called either via IRQ work or independently.

Proto:static void __printk_safe_flush(struct irq_work *work)

Type:void

Parameter:

TypeParameterName
struct irq_work *work
182  read_lock = __RAW_SPIN_LOCK_INITIALIZER(read_lock)
184  s = 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.(work, structprintk_safe_seq_buf, work)
197  raw_spin_lock_irqsave( & read_lock, flags)
199  i = 0
200  more :
201  len = atomic_read( & length of written data )
209  If i && i >= len || len > size of buffer Then
210  msg = "printk_safe_flush: internal error\n"
212  printk_safe_flush_line(msg, strlen - Find the length of a string*@s: The string to be sized)
213  len = 0
216  If Not len Then Go to out
220  smp_rmb()
221  i += printk part of the temporary buffer line by line
229  If atomic_cmpxchg( & length of written data , len, 0) != len Then Go to more
232  out :
233  report_message_lost(s)
234  raw_spin_unlock_irqrestore( & read_lock, flags)
Caller
NameDescribe
printk_safe_flushprintk_safe_flush - flush all per-cpu nmi buffers.* The buffers are flushed automatically via IRQ work. This function* is useful only when someone wants to be sure that all buffers have* been flushed at some point.