Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_main.c Create Date:2022-07-28 11:40:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kdb_set - This function implements the 'set' command. Alter an* existing environment variable or create a new one.

Proto:int kdb_set(int argc, const char **argv)

Type:int

Parameter:

TypeParameterName
intargc
const char **argv
394  If argc == 3 Then
395  argv[2] = argv[3]
396  argc--
399  If argc != 2 Then Return KDB_ARGCOUNT
405  If strcmp(argv[1], "KDBDEBUG") == 0 Then
409  debugflags = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
410  If cp == argv[2] || debugflags & ~All debug flags Then
411  kdb_printf("kdb: illegal debug flags '%s'\n", argv[2])
413  Return 0
415  Kernel debugger state flags = Kernel debugger state flags & ~(All debug flags << Shift factor for dbflags ) | debugflags << Shift factor for dbflags
419  Return 0
426  varlen = strlen - Find the length of a string*@s: The string to be sized
427  vallen = strlen - Find the length of a string*@s: The string to be sized
428  ep = kdballocenv - This function is used to allocate bytes for* environment entries.* Parameters:* match A character string representing a numeric value* Outputs:* *value the unsigned long representation of the env variable 'match'* Returns:
429  If ep == 0 Then Return KDB_ENVBUFFULL
432  sprintf(ep, "%s=%s", argv[1], argv[2])
434  ep[varlen + vallen + 1] = '\0'
436  When i < __nenv cycle
437  If Initial environment[i] && strncmp(Initial environment[i], argv[1], varlen) == 0 && ( Initial environment[i][varlen] == '\0' || Initial environment[i][varlen] == '=' ) Then
442  Return 0
449  When i < __nenv - 1 cycle
450  If Initial environment[i] == 0 Then
452  Return 0
456  Return KDB_ENVFULL
Caller
NameDescribe
kdb_dmesgkdb_dmesg - This function implements the 'dmesg' command to display* the contents of the syslog buffer.* dmesg [lines] [adjust]