函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kdb_dmesg - This function implements the 'dmesg' command to display* the contents of the syslog buffer.* dmesg [lines] [adjust]

函数原型:static int kdb_dmesg(int argc, const char **argv)

返回类型:int

参数:

类型参数名称
intargc
const char **argv
2096  lines等于0
2097  adjust等于0
2098  n等于0
2099  skip等于0
2100  struct kmsg_dumper dumper = {active = 1}
2104  如果argc大于2则返回:KDB_ARGCOUNT
2106  如果argc
2108  lines等于转换字符串为整形
2109  如果cplines等于0
2111  如果argc大于1则
2113  如果cpadjust小于0则adjust等于0
2119  diag等于kdbgetintenv - This function will return the value of an* integer-valued environment variable
2120  如果非diaglogging
2121  const char * setargs[] = {"set", "LOGGING", "0"}
2122  kdb_set - This function implements the 'set' command. Alter an* existing environment variable or create a new one.
2125  kmsg_dump_rewind_nolock - reset the interator (unlocked version)*@dumper: registered kmsg dumper* Reset the dumper's iterator so that kmsg_dump_get_line() and* kmsg_dump_get_buffer() can be called again and used multiple* times within the same dumper
2126 kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version)*@dumper: registered kmsg dumper*@syslog: include the "<4>" prefixes*@line: buffer to copy the line to*@size: maximum size of the buffer*@len: length of line placed into buffer* 循环
2127  n自加
2129  如果lines小于0则
2130  如果adjust大于等于nkdb_printf("buffer only contains %d lines, nothing printed\n", n)
2133  否则如果adjustlines大于等于nkdb_printf("buffer only contains %d lines, last %d lines printed\n", n, n - adjust)
2136  skip等于adjust
2137  lines等于abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.(lines)
2138  否则如果lines大于0则
2139  skip等于nlinesadjust
2140  lines等于abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.(lines)
2141  如果adjust大于等于n
2142  kdb_printf("buffer only contains %d lines, nothing printed\n", n)
2144  skip等于n
2145  否则如果skip小于0则
2146  lines加等于skip
2147  skip等于0
2148  kdb_printf("buffer only contains %d lines, first %d lines printed\n", n, lines)
2151  否则
2152  lines等于n
2155  如果skip大于等于nskip小于0则返回:0
2158  kmsg_dump_rewind_nolock - reset the interator (unlocked version)*@dumper: registered kmsg dumper* Reset the dumper's iterator so that kmsg_dump_get_line() and* kmsg_dump_get_buffer() can be called again and used multiple* times within the same dumper
2159 kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version)*@dumper: registered kmsg dumper*@syslog: include the "<4>" prefixes*@line: buffer to copy the line to*@size: maximum size of the buffer*@len: length of line placed into buffer* 循环
2160  如果skip
2161  skip自减
2162  继续下一循环
2164  如果非lines自减则退出
2166  如果KDB_FLAG(CMD_INTERRUPT)则返回:0
2169  kdb_printf("%.*s\n", (int)len - 1, buf)
2172  返回:0