Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This gets called in a loop recording the time it took to write* the tracepoint

Proto:static void trace_do_benchmark(void)

Type:void

Parameter:Nothing

46  std = 0
49  If Not trace_benchmark_event_enabled() || Not racing_is_on - show state of ring buffers enabled Then Return
52  local_irq_disable()
53  start = race_clock_local(): the simplest and least coherent tracing clock.* Useful for tracing that does not cross to other CPUs nor* does it go through idle events.
54  trace_benchmark_event(bm_str)
55  stop = race_clock_local(): the simplest and least coherent tracing clock.* Useful for tracing that does not cross to other CPUs nor* does it go through idle events.
56  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
58  bm_cnt++
60  delta = stop - start
66  If bm_cnt == 1 Then
67  bm_first = delta
68  scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
70  Return
73  bm_last = delta
75  If delta > bm_max Then bm_max = delta
77  If Not bm_min || delta < bm_min Then bm_min = delta
85  If bm_cnt > UINT_MAX Then
86  scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
89  Return
92  bm_total += delta
93  bm_totalsq += delta * delta
96  If bm_cnt > 1 Then
101  stddev = bm_cnt * bm_totalsq - bm_total * bm_total
102  do_div() is NOT a C function(stddev, (u32)bm_cnt)
103  do_div() is NOT a C function(stddev, (u32)bm_cnt - 1)
104  Else stddev = 0
107  delta = bm_total
108  do_div() is NOT a C function(delta, bm_cnt)
109  avg = delta
111  If stddev > 0 Then
112  i = 0
124  seed = avg
125  Do
126  last_seed = seed
127  seed = stddev
128  If Not last_seed Then Break
131  seed += last_seed
133  When i++ < 10 && last_seed != seed cycle
135  std = seed
138  scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
142  bm_std = std
143  bm_avg = avg
144  bm_stddev = stddev
Caller
NameDescribe
benchmark_event_kthread