Changeset 6e09a41e
- Timestamp:
- Nov 13, 2020, 6:41:17 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7232fe2
- Parents:
- 26ceca1 (diff), 1e208ea (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
r26ceca1 r6e09a41e 195 195 196 196 #if defined( __CFA_WITH_VERIFY__ ) 197 unsigned long longcanary;197 void * canary; 198 198 #endif 199 199 }; -
libcfa/src/concurrency/kernel.cfa
r26ceca1 r6e09a41e 255 255 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); // add escape condition if we are setting up the processor 256 256 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor 257 /* paranoid */ verify( 0x0D15EA5E0D15EA5E == thrd_dst->canary );257 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_dst->canary ); 258 258 259 259 … … 263 263 // when __cfactx_switch returns we are back in the processor coroutine 264 264 265 /* paranoid */ verify( 0x0D15EA5E0D15EA5E == thrd_dst->canary );265 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_dst->canary ); 266 266 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); 267 267 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); … … 335 335 #endif 336 336 /* paranoid */ verify( proc_cor->context.SP ); 337 /* paranoid */ verify( 0x0D15EA5E0D15EA5E == thrd_src->canary );337 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_src->canary ); 338 338 __cfactx_switch( &thrd_src->context, &proc_cor->context ); 339 /* paranoid */ verify( 0x0D15EA5E0D15EA5E == thrd_src->canary );339 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_src->canary ); 340 340 #if defined( __i386 ) || defined( __x86_64 ) 341 341 __x87_load; … … 370 370 /* paranoid */ #endif 371 371 /* paranoid */ verifyf( thrd->link.next == 0p, "Expected null got %p", thrd->link.next ); 372 /* paranoid */ verify( 0x0D15EA5E0D15EA5E == thrd->canary );372 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary ); 373 373 374 374 … … 742 742 743 743 void print_stats_now( cluster & this, int flags ) { 744 __print_stats( this.stats, this.print_stats, true, this.name, (void*)&this ); 744 __print_stats( this.stats, this.print_stats, "Cluster", this.name, (void*)&this ); 745 } 746 747 extern int __print_alarm_stats; 748 void print_alarm_stats() { 749 __print_alarm_stats = -1; 745 750 } 746 751 #endif -
libcfa/src/concurrency/kernel/startup.cfa
r26ceca1 r6e09a41e 360 360 __tally_stats(proc->cltr->stats, &local_stats); 361 361 if( 0 != proc->print_stats ) { 362 __print_stats( &local_stats, proc->print_stats, true, proc->name, (void*)proc );362 __print_stats( &local_stats, proc->print_stats, "Processor ", proc->name, (void*)proc ); 363 363 } 364 364 #endif … … 456 456 link.prev = 0p; 457 457 #if defined( __CFA_WITH_VERIFY__ ) 458 canary = 0x0D15EA5E0D15EA5E ;458 canary = 0x0D15EA5E0D15EA5Ep; 459 459 #endif 460 460 … … 622 622 #if !defined(__CFA_NO_STATISTICS__) 623 623 if( 0 != this.print_stats ) { 624 __print_stats( this.stats, this.print_stats, true, this.name, (void*)&this );624 __print_stats( this.stats, this.print_stats, "Cluster", this.name, (void*)&this ); 625 625 } 626 626 free( this.stats ); -
libcfa/src/concurrency/preemption.cfa
r26ceca1 r6e09a41e 386 386 // reserved for future use 387 387 static void timeout( $thread * this ) { 388 #if !defined( __CFA_NO_STATISTICS__ )389 kernelTLS().this_stats = this->curr_cluster->stats;390 #endif391 388 unpark( this ); 392 389 } … … 615 612 } 616 613 614 #if !defined(__CFA_NO_STATISTICS__) 615 int __print_alarm_stats = 0; 616 #endif 617 617 618 // Main of the alarm thread 618 619 // Waits on SIGALRM and send SIGUSR1 to whom ever needs it … … 622 623 id.id = doregister(&id); 623 624 __cfaabi_tls.this_proc_id = &id; 625 626 #if !defined(__CFA_NO_STATISTICS__) 627 struct __stats_t local_stats; 628 __cfaabi_tls.this_stats = &local_stats; 629 __init_stats( &local_stats ); 630 #endif 624 631 625 632 // Block sigalrms to control when they arrive … … 681 688 __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" ); 682 689 unregister(&id); 690 691 #if !defined(__CFA_NO_STATISTICS__) 692 if( 0 != __print_alarm_stats ) { 693 __print_stats( &local_stats, __print_alarm_stats, "Alarm", "Thread", 0p ); 694 } 695 #endif 683 696 return 0p; 684 697 } -
libcfa/src/concurrency/stats.cfa
r26ceca1 r6e09a41e 44 44 45 45 void __tally_stats( struct __stats_t * cltr, struct __stats_t * proc ) { 46 __atomic_fetch_add( &cltr->ready.pick.push.attempt , proc->ready.pick.push.attempt , __ATOMIC_SEQ_CST ); 47 __atomic_fetch_add( &cltr->ready.pick.push.success , proc->ready.pick.push.success , __ATOMIC_SEQ_CST ); 48 __atomic_fetch_add( &cltr->ready.pick.push.local , proc->ready.pick.push.local , __ATOMIC_SEQ_CST ); 49 __atomic_fetch_add( &cltr->ready.pick.push.lsuccess, proc->ready.pick.push.lsuccess, __ATOMIC_SEQ_CST ); 50 __atomic_fetch_add( &cltr->ready.pick.pop .probe , proc->ready.pick.pop .probe , __ATOMIC_SEQ_CST ); 51 __atomic_fetch_add( &cltr->ready.pick.pop .attempt , proc->ready.pick.pop .attempt , __ATOMIC_SEQ_CST ); 52 __atomic_fetch_add( &cltr->ready.pick.pop .success , proc->ready.pick.pop .success , __ATOMIC_SEQ_CST ); 53 __atomic_fetch_add( &cltr->ready.pick.pop .local , proc->ready.pick.pop .local , __ATOMIC_SEQ_CST ); 54 __atomic_fetch_add( &cltr->ready.pick.pop .lsuccess, proc->ready.pick.pop .lsuccess, __ATOMIC_SEQ_CST ); 55 __atomic_fetch_add( &cltr->ready.threads.migration , proc->ready.threads.migration, __ATOMIC_SEQ_CST );56 __atomic_fetch_add( &cltr->ready.sleep.halts , proc->ready.sleep.halts , __ATOMIC_SEQ_CST );57 __atomic_fetch_add( &cltr->ready.sleep.cancels , proc->ready.sleep.cancels, __ATOMIC_SEQ_CST );58 __atomic_fetch_add( &cltr->ready.sleep.wakes , proc->ready.sleep.wakes , __ATOMIC_SEQ_CST );59 __atomic_fetch_add( &cltr->ready.sleep.exits , proc->ready.sleep.exits , __ATOMIC_SEQ_CST );46 __atomic_fetch_add( &cltr->ready.pick.push.attempt , proc->ready.pick.push.attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.push.attempt = 0; 47 __atomic_fetch_add( &cltr->ready.pick.push.success , proc->ready.pick.push.success , __ATOMIC_SEQ_CST ); proc->ready.pick.push.success = 0; 48 __atomic_fetch_add( &cltr->ready.pick.push.local , proc->ready.pick.push.local , __ATOMIC_SEQ_CST ); proc->ready.pick.push.local = 0; 49 __atomic_fetch_add( &cltr->ready.pick.push.lsuccess, proc->ready.pick.push.lsuccess, __ATOMIC_SEQ_CST ); proc->ready.pick.push.lsuccess = 0; 50 __atomic_fetch_add( &cltr->ready.pick.pop .probe , proc->ready.pick.pop .probe , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .probe = 0; 51 __atomic_fetch_add( &cltr->ready.pick.pop .attempt , proc->ready.pick.pop .attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .attempt = 0; 52 __atomic_fetch_add( &cltr->ready.pick.pop .success , proc->ready.pick.pop .success , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .success = 0; 53 __atomic_fetch_add( &cltr->ready.pick.pop .local , proc->ready.pick.pop .local , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .local = 0; 54 __atomic_fetch_add( &cltr->ready.pick.pop .lsuccess, proc->ready.pick.pop .lsuccess, __ATOMIC_SEQ_CST ); proc->ready.pick.pop .lsuccess = 0; 55 __atomic_fetch_add( &cltr->ready.threads.migration , proc->ready.threads.migration , __ATOMIC_SEQ_CST ); proc->ready.threads.migration = 0; 56 __atomic_fetch_add( &cltr->ready.sleep.halts , proc->ready.sleep.halts , __ATOMIC_SEQ_CST ); proc->ready.sleep.halts = 0; 57 __atomic_fetch_add( &cltr->ready.sleep.cancels , proc->ready.sleep.cancels , __ATOMIC_SEQ_CST ); proc->ready.sleep.cancels = 0; 58 __atomic_fetch_add( &cltr->ready.sleep.wakes , proc->ready.sleep.wakes , __ATOMIC_SEQ_CST ); proc->ready.sleep.wakes = 0; 59 __atomic_fetch_add( &cltr->ready.sleep.exits , proc->ready.sleep.exits , __ATOMIC_SEQ_CST ); proc->ready.sleep.exits = 0; 60 60 61 61 #if defined(CFA_HAVE_LINUX_IO_URING_H) 62 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.rdy , proc->io.submit_q.submit_avg.rdy , __ATOMIC_SEQ_CST ); 63 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.csm , proc->io.submit_q.submit_avg.csm , __ATOMIC_SEQ_CST ); 64 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.avl , proc->io.submit_q.submit_avg.avl , __ATOMIC_SEQ_CST ); 65 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.cnt , proc->io.submit_q.submit_avg.cnt , __ATOMIC_SEQ_CST ); 66 __atomic_fetch_add( &cltr->io.submit_q.look_avg.val , proc->io.submit_q.look_avg.val , __ATOMIC_SEQ_CST ); 67 __atomic_fetch_add( &cltr->io.submit_q.look_avg.cnt , proc->io.submit_q.look_avg.cnt , __ATOMIC_SEQ_CST ); 68 __atomic_fetch_add( &cltr->io.submit_q.look_avg.block , proc->io.submit_q.look_avg.block , __ATOMIC_SEQ_CST ); 69 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.val , proc->io.submit_q.alloc_avg.val , __ATOMIC_SEQ_CST ); 70 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.cnt , proc->io.submit_q.alloc_avg.cnt , __ATOMIC_SEQ_CST ); 71 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.block , proc->io.submit_q.alloc_avg.block , __ATOMIC_SEQ_CST ); 72 __atomic_fetch_add( &cltr->io.submit_q.helped , proc->io.submit_q.helped , __ATOMIC_SEQ_CST ); 73 __atomic_fetch_add( &cltr->io.submit_q.leader , proc->io.submit_q.leader , __ATOMIC_SEQ_CST ); 74 __atomic_fetch_add( &cltr->io.submit_q.busy , proc->io.submit_q.busy , __ATOMIC_SEQ_CST ); 75 __atomic_fetch_add( &cltr->io.complete_q.completed_avg.val, proc->io.complete_q.completed_avg.val, __ATOMIC_SEQ_CST ); 76 __atomic_fetch_add( &cltr->io.complete_q.completed_avg.cnt, proc->io.complete_q.completed_avg.cnt, __ATOMIC_SEQ_CST ); 77 __atomic_fetch_add( &cltr->io.complete_q.blocks , proc->io.complete_q.blocks , __ATOMIC_SEQ_CST ); 62 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.rdy , proc->io.submit_q.submit_avg.rdy , __ATOMIC_SEQ_CST ); proc->io.submit_q.submit_avg.rdy = 0; 63 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.csm , proc->io.submit_q.submit_avg.csm , __ATOMIC_SEQ_CST ); proc->io.submit_q.submit_avg.csm = 0; 64 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.avl , proc->io.submit_q.submit_avg.avl , __ATOMIC_SEQ_CST ); proc->io.submit_q.submit_avg.avl = 0; 65 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.cnt , proc->io.submit_q.submit_avg.cnt , __ATOMIC_SEQ_CST ); proc->io.submit_q.submit_avg.cnt = 0; 66 __atomic_fetch_add( &cltr->io.submit_q.look_avg.val , proc->io.submit_q.look_avg.val , __ATOMIC_SEQ_CST ); proc->io.submit_q.look_avg.val = 0; 67 __atomic_fetch_add( &cltr->io.submit_q.look_avg.cnt , proc->io.submit_q.look_avg.cnt , __ATOMIC_SEQ_CST ); proc->io.submit_q.look_avg.cnt = 0; 68 __atomic_fetch_add( &cltr->io.submit_q.look_avg.block , proc->io.submit_q.look_avg.block , __ATOMIC_SEQ_CST ); proc->io.submit_q.look_avg.block = 0; 69 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.val , proc->io.submit_q.alloc_avg.val , __ATOMIC_SEQ_CST ); proc->io.submit_q.alloc_avg.val = 0; 70 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.cnt , proc->io.submit_q.alloc_avg.cnt , __ATOMIC_SEQ_CST ); proc->io.submit_q.alloc_avg.cnt = 0; 71 __atomic_fetch_add( &cltr->io.submit_q.alloc_avg.block , proc->io.submit_q.alloc_avg.block , __ATOMIC_SEQ_CST ); proc->io.submit_q.alloc_avg.block = 0; 72 __atomic_fetch_add( &cltr->io.submit_q.helped , proc->io.submit_q.helped , __ATOMIC_SEQ_CST ); proc->io.submit_q.helped = 0; 73 __atomic_fetch_add( &cltr->io.submit_q.leader , proc->io.submit_q.leader , __ATOMIC_SEQ_CST ); proc->io.submit_q.leader = 0; 74 __atomic_fetch_add( &cltr->io.submit_q.busy , proc->io.submit_q.busy , __ATOMIC_SEQ_CST ); proc->io.submit_q.busy = 0; 75 __atomic_fetch_add( &cltr->io.complete_q.completed_avg.val, proc->io.complete_q.completed_avg.val, __ATOMIC_SEQ_CST ); proc->io.complete_q.completed_avg.val = 0; 76 __atomic_fetch_add( &cltr->io.complete_q.completed_avg.cnt, proc->io.complete_q.completed_avg.cnt, __ATOMIC_SEQ_CST ); proc->io.complete_q.completed_avg.cnt = 0; 77 __atomic_fetch_add( &cltr->io.complete_q.blocks , proc->io.complete_q.blocks , __ATOMIC_SEQ_CST ); proc->io.complete_q.blocks = 0; 78 78 #endif 79 79 } 80 80 81 void __print_stats( struct __stats_t * stats, int flags, bool cluster, const char * name, void * id ) with( *stats ) {81 void __print_stats( struct __stats_t * stats, int flags, const char * type, const char * name, void * id ) with( *stats ) { 82 82 83 83 if( flags & CFA_STATS_READY_Q ) { … … 109 109 "-- wake on exit : %'15" PRIu64 "\n" 110 110 "\n" 111 , cluster ? "Cluster" : "Processor",name, id111 , type, name, id 112 112 , ready.pick.pop.success 113 113 , ready.pick.push.success … … 158 158 "- total completion blocks: %'15" PRIu64 "\n" 159 159 "\n" 160 , cluster ? "Cluster" : "Processor", name, id160 , type, name, id 161 161 , io.submit_q.submit_avg.cnt 162 162 , avgrdy, avgcsm -
libcfa/src/concurrency/stats.hfa
r26ceca1 r6e09a41e 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 *, int, bool, const char *, void * ) {}9 static inline void __print_stats( struct __stats_t *, int, const char *, const char *, void * ) {} 10 10 #else 11 11 enum { … … 106 106 void __init_stats ( struct __stats_t * ); 107 107 void __tally_stats( struct __stats_t *, struct __stats_t * ); 108 void __print_stats( struct __stats_t *, int, bool, const char *, void * );108 void __print_stats( struct __stats_t *, int, const char *, const char *, void * ); 109 109 #endif 110 110 -
libcfa/src/concurrency/thread.cfa
r26ceca1 r6e09a41e 41 41 link.preferred = -1; 42 42 #if defined( __CFA_WITH_VERIFY__ ) 43 canary = 0x0D15EA5E0D15EA5E ;43 canary = 0x0D15EA5E0D15EA5Ep; 44 44 #endif 45 45 … … 53 53 void ^?{}($thread& this) with( this ) { 54 54 #if defined( __CFA_WITH_VERIFY__ ) 55 canary = 0xDEADDEADDEADDEAD ;55 canary = 0xDEADDEADDEADDEADp; 56 56 #endif 57 57 unregister(curr_cluster, this); -
src/AST/Convert.hpp
r26ceca1 r6e09a41e 20 20 class Declaration; 21 21 namespace ast { 22 classTranslationUnit;22 struct TranslationUnit; 23 23 }; 24 24 -
src/AST/Fwd.hpp
r26ceca1 r6e09a41e 137 137 typedef unsigned int UniqueId; 138 138 139 classTranslationUnit;139 struct TranslationUnit; 140 140 // TODO: Get from the TranslationUnit: 141 141 extern Type * sizeType; -
src/AST/Pass.proto.hpp
r26ceca1 r6e09a41e 23 23 class Pass; 24 24 25 classTranslationUnit;25 struct TranslationUnit; 26 26 27 27 struct PureVisitor; … … 274 274 template< typename core_t > 275 275 static auto on_error (core_t & core, ptr<Decl> & decl, int) -> decltype(core.on_error(decl)) { 276 return core.on_error(decl); 276 return core.on_error(decl); 277 277 } 278 278
Note: See TracChangeset
for help on using the changeset viewer.