函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:devkmsg_write

函数原型:static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)

返回类型:ssize_t

参数:

类型参数名称
struct kiocb *iocb
struct iov_iter *from
808  level等于default_message_loglevel
809  facility等于1
810  file等于ki_filp
811  user等于 needed for tty driver, and maybe others
812  len等于iov_iter_count(from)
813  ret等于len
815  如果非userlen大于LOG_LINE_MAX则返回:负EINVAL
819  如果devkmsg_log按位与DEVKMSG_LOG_MASK_OFF则返回:len
823  如果非devkmsg_log按位与DEVKMSG_LOG_MASK_ON的值则
824  如果非__ratelimit - rate limiting*@rs: ratelimit_state data*@func: name of calling function* This enforces a rate limit: not more than @rs->burst callbacks* in every @rs->interval* RETURNS:* 0 means callbacks will be suppressed.* 1 means go ahead and do it.则返回:ret
828  buf等于开辟内存
829  如果(buf == NULL)则返回:负ENOMEM
832  buf[len]等于'\0'
833  如果非copy_from_iter_full(buf, len, from)则
834  释放内存
835  返回:负EFAULT
847  line等于buf
848  如果line[0]恒等于'<'则
849  char * endp = NULL
852  u等于转换字符串为无符号整形
853  如果endpendp[0]恒等于'>'则
854  level等于LOG_LEVEL(u)
855  如果LOG_FACILITY(u)不等于0则facility等于LOG_FACILITY(u)
857  endp自加
858  len减等于endpline
859  line等于endp
863  devkmsg_emit(facility, level, "%s", line)
864  释放内存
865  返回:ret