函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:syslog_print_all

函数原型:static int syslog_print_all(char __user *buf, int size, bool clear)

返回类型:int

参数:

类型参数名称
char __user *buf
intsize
boolclear
1422  len等于0
1428  text等于开辟内存
1429  如果非text则返回:负ENOMEM
1432  time等于printk_time
1433  Helper macros to lock/unlock logbuf_lock and switch between* printk-safe/unsafe modes.()
1438  seq等于he next printk record to read after the last 'clear' command
1439  idx等于clear_idx
1440 seq小于dex and sequence number of the next record to store in the buffer 循环
1441  msg等于get record by index; idx must point to valid msg
1443  len加等于msg_print_text(msg, true, time, NULL, 0)
1444  idx等于get next record; idx must point to valid msg
1445  seq自加
1449  seq等于he next printk record to read after the last 'clear' command
1450  idx等于clear_idx
1451 len大于sizeseq小于dex and sequence number of the next record to store in the buffer 循环
1452  msg等于get record by index; idx must point to valid msg
1454  len减等于msg_print_text(msg, true, time, NULL, 0)
1455  idx等于get next record; idx must point to valid msg
1456  seq自加
1460  next_seq等于dex and sequence number of the next record to store in the buffer
1462  len等于0
1463 len大于等于0且seq小于next_seq循环
1464  msg等于get record by index; idx must point to valid msg
1465  textlen等于msg_print_text(msg, true, time, text, LOG_LINE_MAX + PREFIX_MAX)
1468  idx等于get next record; idx must point to valid msg
1469  seq自加
1471  logbuf_unlock_irq()
1472  如果copy_to_user(buf + len, text, textlen)则len等于负EFAULT
1474  否则len加等于textlen
1476  Helper macros to lock/unlock logbuf_lock and switch between* printk-safe/unsafe modes.()
1481  idx等于log_first_idx
1485  如果clear
1486  he next printk record to read after the last 'clear' command 等于dex and sequence number of the next record to store in the buffer
1487  clear_idx等于log_next_idx
1489  logbuf_unlock_irq()
1491  释放内存
1492  返回:len
调用者
名称描述
do_syslog