Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-28 13:31:32
Last Modify:2022-05-20 07:50:19 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:perf_sample_event_took

Proto:void perf_sample_event_took(u64 sample_len_ns)

Type:void

Parameter:

TypeParameterName
u64sample_len_ns
507  max_len = READ_ONCE(perf_sample_allowed_ns)
512  If max_len == 0 Then Return
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_len / perf 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_len / perf 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  If avg_len <= max_len Then Return
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  If avg_len < max Then max /= avg_len
540  Else 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 = max * HZ
547  perf_sample_period_ns = NSEC_PER_SEC / sysctl_perf_event_sample_rate
549  If Not Enqueue the irq work @work on the current CPU Then
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)