函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__account_scheduler_latency - record an occurred latency*@tsk - the task struct of the task hitting the latency*@usecs - the duration of the latency in microseconds*@inter - 1 if the sleep was interruptible, 0 if uninterruptible* This function is the main

函数原型:void __sched __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)

返回类型:void

参数:

类型参数名称
struct task_struct *tsk
intusecs
intinter
158  如果interusecs大于5000则返回
163  如果usecs小于等于0则返回
166  memset( & lat, 0, lat的长度)
167  count等于1
168  time等于usecs
169  max等于usecs
171  stack_trace_save_tsk - Save a task stack trace into a storage array*@task: The task to examine*@store: Pointer to storage array*@size: Size of the storage array*@skipnr: Number of entries to skip at the start of the stack trace
173  raw_spin_lock_irqsave( & latency_lock, flags)
175  account_global_scheduler_latency(tsk, & lat)
177 i小于latency_record_count循环
179  same等于1
181  mylat等于latency_record[i]
182 q小于LT_BACKTRACEDEPTH循环
183  record等于backtrace[q]
185  如果backtrace[q]不等于record
186  same等于0
187  退出
191  如果非record退出
194  如果same
195  count自加
196  time加等于time
197  如果time大于maxmax等于time
199  转到:out_unlock
206  如果latency_record_count大于等于LT_SAVECOUNT则转到:out_unlock
210  i等于latency_record_count自加
211  内存复制( & latency_record[i], & lat, latency_record的长度)
213  out_unlock :
214  raw_spin_unlock_irqrestore( & latency_lock, flags)