mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2009-11-11 Jennifer Averett <jennifer.averett@OARcorp.com>
PR 1471/cpukit * libmisc/cpuuse/cpuusagereport.c: Rework statement to ensure 64-bit multiplication is used to avoid overflow with intermediate value.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2009-11-11 Jennifer Averett <jennifer.averett@OARcorp.com>
|
||||
|
||||
PR 1471/cpukit
|
||||
* libmisc/cpuuse/cpuusagereport.c: Rework statement to ensure 64-bit
|
||||
multiplication is used to avoid overflow with intermediate value.
|
||||
|
||||
2009-11-10 Jennifer Averett <jennifer.averett@OARcorp.com>
|
||||
|
||||
PR 1468/cpukit
|
||||
|
||||
@@ -141,8 +141,17 @@ void rtems_cpu_usage_report_with_plugin(
|
||||
ival, fval
|
||||
);
|
||||
#else
|
||||
ival = (total_units) ?
|
||||
the_thread->cpu_time_used * 10000 / total_units : 0;
|
||||
if (total_units) {
|
||||
uint64_t ival_64;
|
||||
|
||||
ival_64 = the_thread->cpu_time_used;
|
||||
ival_64 *= 10000;
|
||||
ival = ival_64 / total_units;
|
||||
|
||||
} else {
|
||||
ival = 0;
|
||||
}
|
||||
|
||||
fval = ival % 100;
|
||||
ival /= 100;
|
||||
(*print)( context,
|
||||
|
||||
Reference in New Issue
Block a user