Function report |
Source Code:fs\coredump.c |
Create Date:2022-07-28 20:30:53 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:rmat_corename will inspect the pattern parameter, and output a* name into corename, which must have space for at least* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
Proto:static int format_corename(struct core_name *cn, struct coredump_params *cprm, size_t **argv, int *argc)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct core_name * | cn | |
| struct coredump_params * | cprm | |
| size_t ** | argv | |
| int * | argc |
| 194 | cred = current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.() |
| 195 | pat_ptr = core_pattern |
| 197 | bool was_space = false |
| 198 | pid_in_pattern = 0 |
| 199 | err = 0 |
| 201 | used = 0 |
| 202 | corename = NULL |
| 203 | If The maximal length of core_pattern is also specified in sysctl.c Then Return -ENOMEM |
| 205 | corename[0] = '\0' |
| 207 | If ispipe Then |
| 208 | argvs = size of core_pattern / 2 |
| 209 | argv = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
| 212 | ) = 0 |
| 213 | ++pat_ptr |
| 223 | If ispipe Then |
| 224 | If Note: isspace() must return false for %NUL-terminator ( * pat_ptr) Then |
| 228 | Else if was_space Then |
| 236 | If pat_ptr != '%' Then |
| 238 | Else |
| 241 | Case * == 0 |
| 242 | Go to out |
| 244 | Case * == '%' |
| 248 | Case * == 'p' |
| 254 | Case * == 'P' |
| 255 | err = cn_printf(cn, "%d", task_tgid_nr(current process)) |
| 257 | Break |
| 258 | Case * == 'i' |
| 259 | err = cn_printf(cn, "%d", task_pid_vnr(current process)) |
| 261 | Break |
| 262 | Case * == 'I' |
| 263 | err = cn_printf(cn, "%d", task_pid_nr(current process)) |
| 265 | Break |
| 267 | Case * == 'u' |
| 271 | Break |
| 273 | Case * == 'g' |
| 277 | Break |
| 278 | Case * == 'd' |
| 281 | Break |
| 283 | Case * == 's' |
| 288 | Case * == 't' |
| 296 | Case * == 'h' |
| 303 | Case * == 'e' |
| 304 | err = cn_esc_printf(cn, "%s", comm) |
| 305 | Break |
| 306 | Case * == 'E' |
| 307 | err = cn_print_exe_file(cn) |
| 308 | Break |
| 310 | Case * == 'c' |
| 311 | err = cn_printf(cn, "%lu", rlimit(RLIMIT_CORE)) |
| 313 | Break |
| 314 | Default |
| 315 | Break |
| 317 | ++pat_ptr |
| 324 | out : |
| 330 | If Not ispipe && Not pid_in_pattern && core_uses_pid Then |
| 331 | err = cn_printf(cn, ".%d", task_tgid_vnr(current process)) |
| 335 | Return ispipe |
| Name | Describe |
|---|---|
| do_coredump |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |