函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:trace_pid_write

函数原型:int trace_pid_write(struct trace_pid_list *filtered_pids, struct trace_pid_list **new_pid_list, const char __user *ubuf, size_t cnt)

返回类型:int

参数:

类型参数名称
struct trace_pid_list *filtered_pids
struct trace_pid_list **new_pid_list
const char __user *ubuf
size_tcnt
518  nr_pids等于0
519  read等于0
520  ret等于0
524  如果race_parser_get_init - gets the buffer for trace parser则返回:负ENOMEM
533  pid_list等于开辟内存
534  如果非pid_list
535  race_parser_put - frees the buffer for trace parser
536  返回:负ENOMEM
539  pid_max等于READ_ONCE(PID filtering )
542  如果filtered_pidspid_max大于pid_maxpid_max等于pid_max
545  pids等于vzalloc((pid_max + 7) >> 3)
546  如果非pids
547  race_parser_put - frees the buffer for trace parser
548  kfree(pid_list)
549  返回:负ENOMEM
552  如果filtered_pids
556  设置内存位
557  nr_pids自加
561 cnt大于0循环
563  pos等于0
565  ret等于race_get_user - reads the user input string separated by space* (matched by isspace(ch))* For each string found the 'struct trace_parser' is updated,* and the function returns.* Returns number of bytes read.* See kernel/trace/trace
566  如果ret小于0或非trace_parser_loaded( & parser)则退出
569  read加等于ret
570  ubuf加等于ret
571  cnt减等于ret
573  ret等于负EINVAL
574  如果kstrtoul - convert a string to an unsigned long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign, but not a minus sign.退出
576  如果val大于等于pid_max退出
579  pid等于val
581  设置内存位
582  nr_pids自加
584  trace_parser_clear( & parser)
585  ret等于0
587  race_parser_put - frees the buffer for trace parser
589  如果ret小于0则
590  trace_free_pid_list(pid_list)
591  返回:ret
594  如果非nr_pids
596  trace_free_pid_list(pid_list)
597  read等于ret
598  pid_list = NULL
601  new_pid_list等于pid_list
603  返回:read
调用者
名称描述
ftrace_event_pid_write
ftrace_pid_write