Function report |
Source Code:kernel\sched\cputime.c |
Create Date:2022-07-28 09:37:37 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Perform (stime * rtime) / total, but avoid multiplication overflow by* losing precision when the numbers are big.
Proto:static u64 scale_stime(u64 stime, u64 rtime, u64 total)
Type:u64
Parameter:
Type | Parameter | Name |
---|---|---|
u64 | stime | |
u64 | rtime | |
u64 | total |
533 | cycle |
535 | If stime > rtime Then swap - swap values of @a and @b*@a: first value*@b: second value(rtime, stime) |
539 | If total >> 32 Then Go to drop_precision |
543 | If Not (rtime >> 32) Then Break |
547 | If stime >> 31 Then Go to drop_precision |
551 | stime <<= 1 |
552 | rtime >>= 1 |
553 | Continue |
555 | drop_precision : |
557 | rtime >>= 1 |
558 | total >>= 1 |
566 | Return scaled |
Name | Describe |
---|---|
cputime_adjust | Adjust tick based cputime random precision against scheduler runtime* accounting |
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 |