函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int format_corename(struct core_name *cn, struct coredump_params *cprm, size_t **argv, int *argc)

返回类型:int

参数:

类型参数名称
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
196  ispipe等于pat_ptr恒等于'|'
197  bool was_space = false
198  pid_in_pattern等于0
199  err等于0
201  used等于0
202  corename = NULL
203  如果The maximal length of core_pattern is also specified in sysctl.c 则返回:负ENOMEM
205  corename[0]等于'\0'
207  如果ispipe
208  argvs等于core_pattern的长度除2
209  argv等于分配数组内存
210  如果非argv则返回:负ENOMEM
212  ) = 0
213  pat_ptr先自加
218 pat_ptr循环
223  如果ispipe
225  was_space = true
226  pat_ptr自加
227  继续下一循环
228  否则如果was_space
229  was_space = false
230  err等于cn_printf(cn, "%c", '\0')
231  如果err则返回:err
233  ) = used
236  如果pat_ptr不等于'%'则
237  err等于cn_printf(cn, "%c", * pat_ptr++)
238  否则
241  :* == 0
242  转到:out
244  :* == '%'
245  err等于cn_printf(cn, "%c", '%')
246  退出
248  :* == 'p'
249  pid_in_pattern等于1
250  err等于cn_printf(cn, "%d", task_tgid_vnr(当前进程))
252  退出
254  :* == 'P'
255  err等于cn_printf(cn, "%d", task_tgid_nr(当前进程))
257  退出
258  :* == 'i'
259  err等于cn_printf(cn, "%d", task_pid_vnr(当前进程))
261  退出
262  :* == 'I'
263  err等于cn_printf(cn, "%d", task_pid_nr(当前进程))
265  退出
267  :* == 'u'
273  :* == 'g'
278  :* == 'd'
283  :* == 's'
284  err等于cn_printf(cn, "%d", si_signo)
286  退出
288  :* == 't'
296  :* == 'h'
298  err等于cn_esc_printf(cn, "%s", nodename)
301  退出
303  :* == 'e'
304  err等于cn_esc_printf(cn, "%s", comm)
305  退出
306  :* == 'E'
307  err等于cn_print_exe_file(cn)
308  退出
310  :* == 'c'
311  err等于cn_printf(cn, "%lu", rlimit(RLIMIT_CORE))
313  退出
314  默认
315  退出
317  pat_ptr先自加
320  如果err则返回:err
324  out :
330  如果非ispipe且非pid_in_patterncore_uses_pid
331  err等于cn_printf(cn, ".%d", task_tgid_vnr(当前进程))
332  如果err则返回:err
335  返回:ispipe
调用者
名称描述
do_coredump