Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kdbnearsym - Return the name of the symbol with the nearest address* less than 'addr'

Proto:int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab)

Type:int

Parameter:

TypeParameterName
unsigned longaddr
kdb_symtab_t *symtab
84  ret = 0
85  symbolsize = 0
86  offset = 0
88  char * knt1 = NULL
90  If KDB_DEBUG(AR) Then kdb_printf("kdbnearsym: addr=0x%lx, symtab=%px\n", addr, symtab)
92  memset(symtab, 0, size of symtab )
94  If addr < 4096 Then Go to out
96  knt1 = debug_kmalloc(must be >= kallsyms table size , DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear)
97  If Not knt1 Then
98  kdb_printf("kdbnearsym: addr=0x%lx cannot kmalloc knt1\n", addr)
100  Go to out
102  Full symbol name, including* any version = Lookup an address* - modname is set to NULL if it's in the kernel.* - We guarantee that the returned name is valid until we reschedule even if.* It resides in a module.* - We also guarantee that modname will be valid until rescheduled.
104  If offset > 8 * 1024 * 1024 Then
105  Full symbol name, including* any version = NULL
106  addr = offset = symbolsize = 0
108  sym_start = addr - offset
109  sym_end = sym_start + symbolsize
110  ret = Full symbol name, including* any version != NULL && *Full symbol name, including* any version != '\0'
112  If ret Then
126  If arbitrary size [i] && strcmp(arbitrary size [i], knt1) == 0 Then Break
135  Else
136  debug_kfree(knt1)
142  i = ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(arbitrary size ) - 1
143  arbitrary size [i] = knt1
144  Full symbol name, including* any version = arbitrary size [i]
145  knt1 = NULL
148  If (Module containing symbol or* "kernel" == NULL) Then Module containing symbol or* "kernel" = "kernel"
150  If KDB_DEBUG(AR) Then kdb_printf("kdbnearsym: returns %d symtab->sym_start=0x%lx, symtab->mod_name=%px, symtab->sym_name=%px (%s)\n", ret, sym_start, Module containing symbol or* "kernel" , Full symbol name, including* any version , Full symbol name, including* any version )
156  out :
157  debug_kfree(knt1)
158  Return ret
Caller
NameDescribe
kdb_md_linekdb_md - This function implements the 'md', 'md1', 'md2', 'md4',* 'md8' 'mdr' and 'mds' commands.* md|mds [ [ []]]* mdWcN [ [ []]]* where W = is the width (1, 2, 4 or 8) and N is the count.* for eg
kdb_symbol_printkdb_symbol_print - Standard method for printing a symbol name and offset
kdb_print_namevalkdb_print_nameval - Print a name and its value, converting the* value to a symbol lookup if possible.* Inputs:* name field name to print* val value of field
kdbgetaddrargkdbgetaddrarg - This function is responsible for parsing an* address-expression and returning the value of the expression,* symbol name, and offset to the caller