Changeset ba068c0
- Timestamp:
- Sep 9, 2023, 2:11:23 PM (20 months ago)
- Branches:
- master
- Children:
- fc9f514
- Parents:
- 5cfb8b1
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/clock.hfa ¶
r5cfb8b1 rba068c0 10 10 // Created On : Thu Apr 12 14:36:06 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Apr 18 08:12:16 202113 // Update Count : 2812 // Last Modified On : Sat Sep 9 14:07:17 2023 13 // Update Count : 30 14 14 // 15 15 … … 91 91 // discontinuous jumps when the OS is not running the kernal thread. A duration is returned because the value is 92 92 // relative and cannot be converted to real-time (wall-clock) time. 93 Duration processor () {// non-monotonic duration of kernel thread93 Duration processor_cpu() { // non-monotonic duration of kernel thread 94 94 timespec ts; 95 95 clock_gettime( CLOCK_THREAD_CPUTIME_ID, &ts ); 96 96 return (Duration){ ts }; 97 } // processor 97 } // processor_cpu 98 98 99 99 // Program CPU-time watch measures CPU time consumed by all processors (kernel threads) in the UNIX process. This 100 100 // watch is affected by discontinuous jumps when the OS is not running the kernel threads. A duration is returned 101 101 // because the value is relative and cannot be converted to real-time (wall-clock) time. 102 Duration program () {// non-monotonic duration of program CPU102 Duration program_cpu() { // non-monotonic duration of program CPU 103 103 timespec ts; 104 104 clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &ts ); 105 105 return (Duration){ ts }; 106 } // program 106 } // program_cpu 107 107 108 108 // Monotonic duration from machine boot and including system suspension. This watch is unaffected by discontinuous -
TabularUnified libcfa/src/concurrency/kernel/cluster.hfa ¶
r5cfb8b1 rba068c0 31 31 32 32 // warn normally all ints 33 #define warn_large_before warnf( !strict || old_avg < 33_000_000_000, "Suspiciously large previous average: %'llu (%llx), %'" PRId64 "ms \n", old_avg, old_avg, program ()`ms )34 #define warn_large_after warnf( !strict || ret < 33_000_000_000, "Suspiciously large new average after %'" PRId64 "ms cputime: %'llu (%llx) from %'llu-%'llu (%'llu, %'llu) and %'llu\n", program ()`ms, ret, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg )33 #define warn_large_before warnf( !strict || old_avg < 33_000_000_000, "Suspiciously large previous average: %'llu (%llx), %'" PRId64 "ms \n", old_avg, old_avg, program_cpu()`ms ) 34 #define warn_large_after warnf( !strict || ret < 33_000_000_000, "Suspiciously large new average after %'" PRId64 "ms cputime: %'llu (%llx) from %'llu-%'llu (%'llu, %'llu) and %'llu\n", program_cpu()`ms, ret, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ) 35 35 36 36 // 8X linear factor is just 8 * x … … 42 42 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2((__readyQ_avg_t)intsc); } 43 43 44 #define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'" PRId64 "ms \n", old_avg, program ()`ms )45 #define warn_large_after warnf( !strict || ret < 35.3, "Suspiciously large new average after %'" PRId64 "ms cputime: %'lf from %'llu-%'llu (%'llu, %'llu) and %'lf\n", program ()`ms, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ); \44 #define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'" PRId64 "ms \n", old_avg, program_cpu()`ms ) 45 #define warn_large_after warnf( !strict || ret < 35.3, "Suspiciously large new average after %'" PRId64 "ms cputime: %'lf from %'llu-%'llu (%'llu, %'llu) and %'lf\n", program_cpu()`ms, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ); \ 46 46 verify(ret >= 0) 47 47
Note: See TracChangeset
for help on using the changeset viewer.