Function report |
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 activity | Download SCCT | Chinese |
Name:udelay_test_single
Proto:static int udelay_test_single(struct seq_file *s, int usecs, uint32_t iters)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct seq_file * | s | |
int | usecs | |
uint32_t | iters |
30 | min = 0 , max = 0 , fail_count = 0 |
31 | sum = 0 |
35 | allowed_error_ns = usecs * 5 |
41 | kt1 = ktime_get_ns() |
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 |
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) |
65 | Return 0 |
Name | Describe |
---|---|
udelay_test_show |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |