函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kthread_fn - The CPU time sampling/hardware latency detection kernel thread* Used to periodically sample the CPU TSC via a call to get_sample. We* disable interrupts, which does (intentionally) introduce latency since we

函数原型:static int kthread_fn(void *data)

返回类型:int

参数:

类型参数名称
void *data
323  当非kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop().循环
325  move_to_next_cpu()
327  禁止中断()
328  get_sample - sample the CPU TSC and look for likely hardware latencies* Used to repeatedly capture the CPU TSC (or similar), looking for potential* hardware-induced latency. Called with interrupts disabled and with* hwlat_data.lock held.
329  开中断()
331  mutex_lock( & protect changes )
332  interval等于al sampling window (on+off) active sampling portion of window
333  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
335  do_div() is NOT a C function(interval, USEC_PER_MSEC)
338  如果interval小于1则interval等于1
341  如果msleep_interruptible - sleep waiting for signals*@msecs: Time in milliseconds to sleep for退出
345  返回:0