函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_syslog

函数原型:int do_syslog(int type, char __user *buf, int len, int source)

返回类型:int

参数:

类型参数名称
inttype
char __user *buf
intlen
intsource
1505  bool clear = false
1506  saved_console_loglevel等于default (or last) loglevel
1509  error等于check_syslog_permissions(type, source)
1510  如果error则返回:error
1514  :type恒等于Close the log. Currently a NOP.
1515  退出
1516  :type恒等于Open the log. Currently a NOP.
1517  退出
1518  :type恒等于Read from the log.
1519  如果非buflen小于0则返回:负EINVAL
1521  如果非len则返回:0
1523  如果非access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(buf, len)则返回:负EFAULT
1525  error等于wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(log_wait, he next printk record to read by syslog(READ) or /proc/kmsg != dex and sequence number of the next record to store in the buffer )
1527  如果error则返回:error
1529  error等于syslog_print(buf, len)
1530  退出
1532  :type恒等于Read and clear all messages remaining in the ring buffer
1533  clear = true
1536  :type恒等于Read all messages remaining in the ring buffer.
1537  如果非buflen小于0则返回:负EINVAL
1539  如果非len则返回:0
1541  如果非access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(buf, len)则返回:负EFAULT
1543  error等于syslog_print_all(buf, len, clear)
1544  退出
1546  :type恒等于Clear ring buffer.
1547  syslog_clear()
1548  退出
1550  :type恒等于Disable printk's to console
1551  如果saved_console_loglevel恒等于default (or last) loglevel saved_console_loglevel等于console_loglevel
1553  console_loglevel等于minimum_console_loglevel
1554  退出
1556  :type恒等于Enable printk's to console
1561  退出
1563  :type恒等于Set level of messages printed to console
1564  如果len小于1或len大于8则返回:负EINVAL
1566  如果len小于minimum_console_loglevellen等于minimum_console_loglevel
1568  console_loglevel等于len
1570  saved_console_loglevel等于default (or last) loglevel
1571  退出
1573  :type恒等于Return number of unread characters in the log buffer
1574  Helper macros to lock/unlock logbuf_lock and switch between* printk-safe/unsafe modes.()
1579  syslog_partial等于0
1581  如果source恒等于SYSLOG_FROM_PROC
1588  否则
1590  idx等于syslog_idx
1591  time等于如果syslog_partialsyslog_time否则printk_time
1602  error减等于syslog_partial
1604  logbuf_unlock_irq()
1605  退出
1607  :type恒等于Return size of the log buffer
1608  error等于log_buf_len
1609  退出
1610  默认
1611  error等于负EINVAL
1612  退出
1615  返回:error
调用者
名称描述
SYSCALL_DEFINE3