Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:syslog_print_all

Proto:static int syslog_print_all(char __user *buf, int size, bool clear)

Type:int

Parameter:

TypeParameterName
char __user *buf
intsize
boolclear
1422  len = 0
1428  text = Allocation memory
1429  If Not text Then Return -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  When seq < dex and sequence number of the next record to store in the buffer cycle
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  When len > size && seq < dex and sequence number of the next record to store in the buffer cycle
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  When len >= 0 && seq < next_seq cycle
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  If copy_to_user(buf + len, text, textlen) Then len = -EFAULT
1474  Else len += textlen
1476  Helper macros to lock/unlock logbuf_lock and switch between* printk-safe/unsafe modes.()
1481  idx = log_first_idx
1485  If clear Then
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  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
1492  Return len
Caller
NameDescribe
do_syslog