Changeset c34ebf2
- Timestamp:
- Jun 25, 2020, 1:34:34 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8e27ac45
- Parents:
- c953163
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rc953163 rc34ebf2 240 240 runner.proc = &this; 241 241 242 #if !defined(__CFA_NO_STATISTICS__) 243 print_stats = false; 244 print_halts = false; 245 #endif 246 242 247 idle{}; 243 248 … … 293 298 #if !defined(__CFA_NO_STATISTICS__) 294 299 if(this.print_stats) { 295 __print_stats( this.stats );300 __print_stats( this.stats, true, this.name, (void*)&this ); 296 301 } 297 302 free( this.stats ); … … 563 568 #if !defined(__CFA_NO_STATISTICS__) 564 569 __tally_stats(proc->cltr->stats, &local_stats); 570 if(proc->print_stats) { 571 __print_stats( &local_stats, true, proc->name, (void*)proc ); 572 } 565 573 #endif 566 574 … … 853 861 id = -1u; 854 862 863 #if !defined(__CFA_NO_STATISTICS__) 864 print_stats = false; 865 print_halts = false; 866 #endif 867 855 868 runner{ &this }; 856 869 __cfadbg_print_safe(runtime_core, "Kernel : constructed main processor context %p\n", &runner); … … 1004 1017 } 1005 1018 1019 #if !defined(__CFA_NO_STATISTICS__) 1020 if(this->print_halts) { 1021 printf("%d - %lld 0\n", this->id, rdtscl()); 1022 } 1023 #endif 1024 1006 1025 wait( idle ); 1026 1027 #if !defined(__CFA_NO_STATISTICS__) 1028 if(this->print_halts) { 1029 printf("%d - %lld 1\n", this->id, rdtscl()); 1030 } 1031 #endif 1007 1032 } 1008 1033 … … 1190 1215 return true; 1191 1216 } 1217 1218 //----------------------------------------------------------------------------- 1219 // Statistics 1220 #if !defined(__CFA_NO_STATISTICS__) 1221 void print_halts( processor & this ) { 1222 this.print_halts = true; 1223 printf("Processor : %d - %s (%p)\n", this.id, this.name, (void*)&this); 1224 } 1225 #endif 1192 1226 // Local Variables: // 1193 1227 // mode: c // -
libcfa/src/concurrency/kernel.hfa
rc953163 rc34ebf2 104 104 // Link lists fields 105 105 Link(processor) link; 106 107 #if !defined(__CFA_NO_STATISTICS__) 108 bool print_stats; 109 bool print_halts; 110 #endif 106 111 107 112 #ifdef __CFA_DEBUG__ … … 227 232 this.print_stats = true; 228 233 } 234 235 static inline void print_stats_at_exit( processor & this ) { 236 this.print_stats = true; 237 } 238 239 void print_halts( processor & this ); 229 240 #endif 230 241 -
libcfa/src/concurrency/stats.cfa
rc953163 rc34ebf2 73 73 } 74 74 75 void __print_stats( struct __stats_t * stats ) with( *stats ) {75 void __print_stats( struct __stats_t * stats, bool cluster, const char * name, void * id ) with( *stats ) { 76 76 77 77 double push_sur = (100.0 * ((double)ready.pick.push.success) / ready.pick.push.attempt); … … 108 108 109 109 __cfaabi_bits_print_safe( STDOUT_FILENO, 110 "----- Ready Q Stats -----\n"110 "----- %s \"%s\" (%p) - Ready Q Stats -----\n" 111 111 "- total threads run : %'15lu\n" 112 112 "- total threads scheduled: %'15lu\n" … … 121 121 "-- schedule wake : %'15lu\n" 122 122 "-- wake on exit : %'15lu\n" 123 #if defined(HAVE_LINUX_IO_URING_H) 124 "\n" 125 "----- I/O Stats -----\n" 123 "\n" 124 , cluster ? "Cluster" : "Processor", name, id 125 , ready.pick.pop.success 126 , ready.pick.push.success 127 , push_len, push_sur, ready.pick.push.attempt 128 , pop_len , pop_sur , ready.pick.pop .attempt 129 , lpush_len, lpush_sur, ready.pick.push.local 130 , lpop_len , lpop_sur , ready.pick.pop .local 131 , ready.threads.migration 132 , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits 133 ); 134 #if defined(HAVE_LINUX_IO_URING_H) 135 __cfaabi_bits_print_safe( STDOUT_FILENO, 136 "----- %s \"%s\" (%p) - I/O Stats -----\n" 126 137 "- total submit calls : %'15lu\n" 127 138 "- avg ready entries : %'18.2lf\n" … … 136 147 "- total wait calls : %'15lu (%'lu slow, %'lu fast)\n" 137 148 "- avg completion/wait : %'18.2lf\n" 138 #endif 139 , ready.pick.pop.success 140 , ready.pick.push.success 141 , push_len, push_sur, ready.pick.push.attempt 142 , pop_len , pop_sur , ready.pick.pop .attempt 143 , lpush_len, lpush_sur, ready.pick.push.local 144 , lpop_len , lpop_sur , ready.pick.pop .local 145 , ready.threads.migration 146 , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits 147 #if defined(HAVE_LINUX_IO_URING_H) 149 "\n" 150 , cluster ? "Cluster" : "Processor", name, id 148 151 , io.submit_q.submit_avg.cnt 149 , avgrdy 150 , avgcsm 151 , avgavl 152 , avgrdy, avgcsm, avgavl 152 153 , io.submit_q.look_avg.cnt 153 , lavgv 154 , lavgb 154 , lavgv, lavgb 155 155 , io.submit_q.alloc_avg.cnt 156 , aavgv 157 , aavgb 156 , aavgv, aavgb 158 157 , io.complete_q.completed_avg.slow_cnt + io.complete_q.completed_avg.fast_cnt 159 158 , io.complete_q.completed_avg.slow_cnt, io.complete_q.completed_avg.fast_cnt 160 159 , ((double)io.complete_q.completed_avg.val) / (io.complete_q.completed_avg.slow_cnt + io.complete_q.completed_avg.fast_cnt) 161 #endif162 );160 ); 161 #endif 163 162 } 164 163 #endif -
libcfa/src/concurrency/stats.hfa
rc953163 rc34ebf2 7 7 static inline void __init_stats( struct __stats_t * ) {} 8 8 static inline void __tally_stats( struct __stats_t *, struct __stats_t * ) {} 9 static inline void __print_stats( struct __stats_t * ) {}9 static inline void __print_stats( struct __stats_t *, bool, const char *, void * ) {} 10 10 #else 11 11 struct __attribute__((aligned(64))) __stats_readQ_t { … … 96 96 void __init_stats ( struct __stats_t * ); 97 97 void __tally_stats( struct __stats_t *, struct __stats_t * ); 98 void __print_stats( struct __stats_t * );98 void __print_stats( struct __stats_t *, bool, const char *, void * ); 99 99 #endif 100 100
Note: See TracChangeset
for help on using the changeset viewer.