函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kmsg_dump_get_buffer - copy kmsg log lines*@dumper: registered kmsg dumper*@syslog: include the "<4>" prefixes*@buf: buffer to copy the line to*@size: maximum size of the buffer*@len: length of line placed into buffer* Start at the end of the kmsg buffer

函数原型:bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, char *buf, size_t size, size_t *len)

返回类型:bool

参数:

类型参数名称
struct kmsg_dumper *dumper
boolsyslog
char *buf
size_tsize
size_t *len
3253  l等于0
3254  bool ret = false
3255  time等于printk_time
3257  如果非active则转到:out
3260  logbuf_lock_irqsave(flags)
3261  如果cur_seq小于dex and sequence number of the first record stored in the buffer
3263  cur_seq等于dex and sequence number of the first record stored in the buffer
3264  private state of the kmsg iterator 等于log_first_idx
3268  如果cur_seq大于等于next_seq
3269  logbuf_unlock_irqrestore(flags)
3270  转到:out
3274  seq等于cur_seq
3275  idx等于private state of the kmsg iterator
3276 seq小于next_seq循环
3277  msg等于get record by index; idx must point to valid msg
3279  l加等于msg_print_text(msg, true, time, NULL, 0)
3280  idx等于get next record; idx must point to valid msg
3281  seq自加
3285  seq等于cur_seq
3286  idx等于private state of the kmsg iterator
3287 l大于等于sizeseq小于next_seq循环
3288  msg等于get record by index; idx must point to valid msg
3290  l减等于msg_print_text(msg, true, time, NULL, 0)
3291  idx等于get next record; idx must point to valid msg
3292  seq自加
3296  next_seq等于seq
3297  next_idx等于idx
3299  l等于0
3300 seq小于next_seq循环
3301  msg等于get record by index; idx must point to valid msg
3303  l加等于msg_print_text(msg, syslog, time, buf + l, size - l)
3304  idx等于get next record; idx must point to valid msg
3305  seq自加
3308  next_seq等于next_seq
3309  next_idx等于next_idx
3310  ret = true
3311  logbuf_unlock_irqrestore(flags)
3312  out :
3313  如果lenlen等于l
3315  返回:ret