Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sert record into the buffer, discard old ones, update heads

Proto:static int log_store(unsigned int caller_id, int facility, int level, enum log_flags flags, u64 ts_nsec, const char *dict, u16 dict_len, const char *text, u16 text_len)

Type:int

Parameter:

TypeParameterName
unsigned intcaller_id
intfacility
intlevel
enum log_flagsflags
u64ts_nsec
const char *dict
u16dict_len
const char *text
u16text_len
611  trunc_msg_len = 0
614  size = mpute the message size including the padding bytes
616  If log_make_free_space(size) Then
618  size = truncate_msg( & text_len, & trunc_msg_len, & dict_len, & pad_len)
621  If log_make_free_space(size) Then Return 0
625  If log_next_idx + size + sizeof(structprintk_log) > log_buf_len Then
631  memset(log_buf + log_next_idx, 0, sizeof(structprintk_log))
632  log_next_idx = 0
636  msg = log_buf + log_next_idx
637  No 3D Now!(human readable text of the record , text, text_len)
638  length of text buffer = text_len
639  If trunc_msg_len Then
640  No 3D Now!(human readable text of the record + text_len, trunc_msg, trunc_msg_len)
641  length of text buffer += trunc_msg_len
643  No 3D Now!(ptional key/value pair dictionary attached to the record , dict, dict_len)
644  length of dictionary buffer = dict_len
645  syslog facility = facility
646  syslog level = level & 7
647  internal record flags = flags & 0x1f
648  If ts_nsec > 0 Then timestamp in nanoseconds = ts_nsec
650  Else timestamp in nanoseconds = local_clock()
655  memset(ptional key/value pair dictionary attached to the record + dict_len, 0, pad_len)
656  length of entire record = size
659  log_next_idx += length of entire record
660  dex and sequence number of the next record to store in the buffer ++
662  Return length of text buffer
Caller
NameDescribe
cont_flush
log_output