Function report | 
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 activity | Download SCCT | Chinese | 
Name:trace_save_cmdline
Proto:static int trace_save_cmdline(struct task_struct *tsk)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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 | 
| Name | Describe | 
|---|---|
| tracing_record_taskinfo | racing_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_switch | racing_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 | 
| 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  |