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:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:start_kthread - Kick off the hardware latency sampling/detector kthread* This starts the kernel thread that will sit and sample the CPU timestamp* counter (TSC or similar) and look for potential hardware latencies.

Proto:static int start_kthread(struct trace_array *tr)

Type:int

Parameter:

TypeParameterName
struct trace_array *tr
356  current_mask = save_cpumask
360  If WARN_ON(sampling thread) Then Return 0
364  current_mask = save_cpumask
365  get_online_cpus()
366  pumask_and - *dstp = *src1p & *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
367  put_online_cpus()
368  next_cpu = Uniprocessor. Assume all masks are "1".
370  kthread = Create kernel thread(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, NULL, "hwlatd")
371  If IS_ERR(kthread) Then
372  pr_err(BANNER"could not start sampling thread\n")
373  Return -ENOMEM
376  pumask_clear - clear all cpus (< nr_cpu_ids) in a cpumask*@dstp: the cpumask pointer
377  pumask_set_cpu - set a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@dstp: the cpumask pointer
378  sched_setaffinity(process id, current_mask)
380  sampling thread = kthread
381  wake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
383  Return 0
Caller
NameDescribe
hwlat_tracer_start