Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\test_udelay.c Create Date:2022-07-28 10:52:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:udelay_test_single

Proto:static int udelay_test_single(struct seq_file *s, int usecs, uint32_t iters)

Type:int

Parameter:

TypeParameterName
struct seq_file *s
intusecs
uint32_titers
30  min = 0 , max = 0 , fail_count = 0
31  sum = 0
35  allowed_error_ns = usecs * 5
37  When i < iters cycle
41  kt1 = ktime_get_ns()
42  0x10c7 is 2**32 / 1000000 (rounded up) (usecs)
43  kt2 = ktime_get_ns()
44  time_passed = kt2 - kt1
46  If i == 0 || time_passed < min Then min = time_passed
48  If i == 0 || time_passed > max Then max = time_passed
50  If (time_passed + allowed_error_ns) / 1000 < usecs Then ++fail_count
52  WARN_ON(time_passed < 0)
53  sum += time_passed
56  avg = sum
57  do_div() is NOT a C function(avg, iters)
58  seq_printf(s, "%d usecs x %d: exp=%d allowed=%d min=%d avg=%lld max=%d", usecs, iters, usecs * 1000, (usecs * 1000) - allowed_error_ns, min, avg, max)
61  If fail_count Then seq_printf(s, " FAIL=%d", fail_count)
63  seq_puts(s, "\n")
65  Return 0
Caller
NameDescribe
udelay_test_show