Changeset 1b033b8 for libcfa


Ignore:
Timestamp:
Nov 13, 2020, 11:32:15 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ac12f1f
Parents:
0989e79
Message:

Alarm loop now has it's own stats block

Location:
libcfa/src/concurrency
Files:
5 edited

Legend:

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

    r0989e79 r1b033b8  
    742742
    743743        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;
    745750        }
    746751#endif
  • libcfa/src/concurrency/kernel/startup.cfa

    r0989e79 r1b033b8  
    360360                __tally_stats(proc->cltr->stats, &local_stats);
    361361                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 );
    363363                }
    364364        #endif
     
    622622        #if !defined(__CFA_NO_STATISTICS__)
    623623                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 );
    625625                }
    626626                free( this.stats );
  • libcfa/src/concurrency/preemption.cfa

    r0989e79 r1b033b8  
    393393// reserved for future use
    394394static void timeout( $thread * this ) {
    395         #if !defined( __CFA_NO_STATISTICS__ )
    396                 kernelTLS().this_stats = this->curr_cluster->stats;
    397         #endif
    398395        unpark( this );
    399396}
     
    610607}
    611608
     609#if !defined(__CFA_NO_STATISTICS__)
     610        int __print_alarm_stats = 0;
     611#endif
     612
    612613// Main of the alarm thread
    613614// Waits on SIGALRM and send SIGUSR1 to whom ever needs it
     
    617618        id.id = doregister(&id);
    618619        __cfaabi_tls.this_proc_id = &id;
     620
     621        #if !defined(__CFA_NO_STATISTICS__)
     622                struct __stats_t local_stats;
     623                __cfaabi_tls.this_stats = &local_stats;
     624                __init_stats( &local_stats );
     625        #endif
    619626
    620627        // Block sigalrms to control when they arrive
     
    676683        __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
    677684        unregister(&id);
     685
     686        #if !defined(__CFA_NO_STATISTICS__)
     687                if( 0 != __print_alarm_stats ) {
     688                        __print_stats( &local_stats, __print_alarm_stats, "Alarm", "Thread", 0p );
     689                }
     690        #endif
    678691        return 0p;
    679692}
  • libcfa/src/concurrency/stats.cfa

    r0989e79 r1b033b8  
    7979        }
    8080
    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 ) {
    8282
    8383                if( flags & CFA_STATS_READY_Q ) {
     
    109109                                "-- wake on exit          : %'15" PRIu64 "\n"
    110110                                "\n"
    111                                 , cluster ? "Cluster" : "Processor", name, id
     111                                , type, name, id
    112112                                , ready.pick.pop.success
    113113                                , ready.pick.push.success
  • libcfa/src/concurrency/stats.hfa

    r0989e79 r1b033b8  
    77        static inline void __init_stats( struct __stats_t * ) {}
    88        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 * ) {}
    1010#else
    1111        enum {
     
    106106        void __init_stats ( struct __stats_t * );
    107107        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 * );
    109109#endif
    110110
Note: See TracChangeset for help on using the changeset viewer.