Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int kthread_fn(void *data)

Type:int

Parameter:

TypeParameterName
void *data
323  When Not 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(). cycle
325  move_to_next_cpu()
327  local_irq_disable()
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  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
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  If interval < 1 Then interval = 1
341  If msleep_interruptible - sleep waiting for signals*@msecs: Time in milliseconds to sleep for Then Break
345  Return 0