函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sert record into the buffer, discard old ones, update heads

函数原型: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)

返回类型:int

参数:

类型参数名称
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  如果log_make_free_space(size)则
618  size等于truncate_msg( & text_len, & trunc_msg_len, & dict_len, & pad_len)
621  如果log_make_free_space(size)则返回:0
625  如果log_next_idxsizesizeof(structprintk_log)大于log_buf_len
631  memset(log_buf + log_next_idx, 0, sizeof(structprintk_log))
632  log_next_idx等于0
636  msg等于log_buflog_next_idx
637  内存复制(human readable text of the record , text, text_len)
638  length of text buffer 等于text_len
639  如果trunc_msg_len
640  内存复制(human readable text of the record + text_len, trunc_msg, trunc_msg_len)
641  length of text buffer 加等于trunc_msg_len
643  内存复制(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  如果ts_nsec大于0则 timestamp in nanoseconds 等于ts_nsec
650  否则 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  返回: length of text buffer
调用者
名称描述
cont_flush
log_output