函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:50:23
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perf_sample_event_took

函数原型:void perf_sample_event_took(u64 sample_len_ns)

返回类型:void

参数:

类型参数名称
u64sample_len_ns
507  max_len等于READ_ONCE(perf_sample_allowed_ns)
512  如果max_len恒等于0则返回
516  running_len等于Operations for contexts that are safe from preemption/interrupts. These* operations verify that preemption is disabled.(running_sample_length)
517  running_len减等于running_lenperf samples are done in some very critical code paths (NMIs).* If they take too much CPU time, the system can lock up and not* get any real work done. This will drop the sample rate when* we detect that events are taking too long.
518  running_len加等于sample_len_ns
519  __this_cpu_write(running_sample_length, running_len)
526  avg_len等于running_lenperf samples are done in some very critical code paths (NMIs).* If they take too much CPU time, the system can lock up and not* get any real work done. This will drop the sample rate when* we detect that events are taking too long.
527  如果avg_len小于等于max_len则返回
530  __report_avg等于avg_len
531  __report_allowed等于max_len
536  avg_len加等于avg_len除4
537  max等于TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ 除100乘sysctl_perf_cpu_time_max_percent
538  如果avg_len小于maxmax除等于avg_len
540  否则max等于1
543  WRITE_ONCE(perf_sample_allowed_ns, avg_len)
544  WRITE_ONCE(max_samples_per_tick, max)
546  sysctl_perf_event_sample_rate等于maxHZ
547  perf_sample_period_ns等于NSEC_PER_SECsysctl_perf_event_sample_rate
549  如果非Enqueue the irq work @work on the current CPU
550  early_printk("perf: interrupt took too long (%lld > %lld), lowering kernel.perf_event_max_sample_rate to %d\n", __report_avg, __report_allowed, sysctl_perf_event_sample_rate)