Ignore:
Timestamp:
Jun 25, 2020, 1:34:34 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Processors now have their own print stats flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    rc953163 rc34ebf2  
    240240        runner.proc = &this;
    241241
     242        #if !defined(__CFA_NO_STATISTICS__)
     243                print_stats = false;
     244                print_halts = false;
     245        #endif
     246
    242247        idle{};
    243248
     
    293298        #if !defined(__CFA_NO_STATISTICS__)
    294299                if(this.print_stats) {
    295                         __print_stats( this.stats );
     300                        __print_stats( this.stats, true, this.name, (void*)&this );
    296301                }
    297302                free( this.stats );
     
    563568        #if !defined(__CFA_NO_STATISTICS__)
    564569                __tally_stats(proc->cltr->stats, &local_stats);
     570                if(proc->print_stats) {
     571                        __print_stats( &local_stats, true, proc->name, (void*)proc );
     572                }
    565573        #endif
    566574
     
    853861                id = -1u;
    854862
     863                #if !defined(__CFA_NO_STATISTICS__)
     864                        print_stats = false;
     865                        print_halts = false;
     866                #endif
     867
    855868                runner{ &this };
    856869                __cfadbg_print_safe(runtime_core, "Kernel : constructed main processor context %p\n", &runner);
     
    10041017        }
    10051018
     1019        #if !defined(__CFA_NO_STATISTICS__)
     1020                if(this->print_halts) {
     1021                        printf("%d - %lld 0\n", this->id, rdtscl());
     1022                }
     1023        #endif
     1024
    10061025        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
    10071032}
    10081033
     
    11901215        return true;
    11911216}
     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
    11921226// Local Variables: //
    11931227// mode: c //
Note: See TracChangeset for help on using the changeset viewer.