函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int start_kthread(struct trace_array *tr)

返回类型:int

参数:

类型参数名称
struct trace_array *tr
356  current_mask等于save_cpumask
360  如果WARN_ON(sampling thread)则返回: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等于kthread_create - create a kthread on the current node*@threadfn: the function to run in the thread*@data: data pointer for @threadfn()*@namefmt: printf-style format string for the thread name*@arg(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  如果是错误
372  打印错误信息(BANNER"could not start sampling thread\n")
373  返回:负ENOMEM
376  清空全部CPU信息
377  设置CPU信息
378  sched_setaffinity(进程ID, current_mask)
380  sampling thread等于kthread
381  唤醒中断线程
383  返回:0
调用者
名称描述
hwlat_tracer_start