Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:trace_save_cmdline

Proto:static int trace_save_cmdline(struct task_struct *tsk)

Type:int

Parameter:

TypeParameterName
struct task_struct *tsk
2229  If Not process id Then Return 1
2232  If Value for the false possibility is greater at compile time(process id > This controls the default maximum pid allocated to a process) Then Return 0
2241  If Not arch_spin_trylock( & trace_cmdline_lock) Then Return 0
2244  idx = map_pid_to_cmdline[process id]
2245  If idx == NO_CMDLINE_MAP Then
2246  idx = (cmdline_idx + 1) % cmdline_num
2254  pid = map_cmdline_to_pid[idx]
2255  If pid != NO_CMDLINE_MAP Then map_pid_to_cmdline[pid] = NO_CMDLINE_MAP
2258  map_cmdline_to_pid[idx] = process id
2259  map_pid_to_cmdline[process id] = idx
2261  cmdline_idx = idx
2264  set_cmdline(idx, * executable name, excluding path. * - normally initialized setup_new_exec() * - access it with [gs]et_task_comm() * - lock it with task_lock())
2266  arch_spin_unlock( & trace_cmdline_lock)
2268  Return 1
Caller
NameDescribe
tracing_record_taskinforacing_record_taskinfo - record the task info of a task*@task: task to record*@flags: TRACE_RECORD_CMDLINE for recording comm* TRACE_RECORD_TGID for recording tgid
tracing_record_taskinfo_sched_switchracing_record_taskinfo_sched_switch - record task info for sched_switch*@prev: previous task during sched_switch*@next: next task during sched_switch*@flags: TRACE_RECORD_CMDLINE for recording comm* TRACE_RECORD_TGID for recording tgid