Ignore:
Timestamp:
Jun 24, 2020, 1:40:35 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c7816be
Parents:
de917da3
Message:

Added statistics for local success when biased

File:
1 edited

Legend:

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

    rde917da3 r52769ba  
    88#if !defined(__CFA_NO_STATISTICS__)
    99        void __init_stats( struct __stats_t * stats ) {
    10                 stats->ready.pick.push.attempt = 0;
    11                 stats->ready.pick.push.success = 0;
    12                 stats->ready.pick.pop .probe   = 0;
    13                 stats->ready.pick.pop .attempt = 0;
    14                 stats->ready.pick.pop .local   = 0;
    15                 stats->ready.pick.pop .success = 0;
     10                stats->ready.pick.push.attempt  = 0;
     11                stats->ready.pick.push.success  = 0;
     12                stats->ready.pick.push.local    = 0;
     13                stats->ready.pick.push.lsuccess = 0;
     14                stats->ready.pick.pop .probe    = 0;
     15                stats->ready.pick.pop .attempt  = 0;
     16                stats->ready.pick.pop .success  = 0;
     17                stats->ready.pick.pop .local    = 0;
     18                stats->ready.pick.pop .lsuccess = 0;
    1619                stats->ready.sleep.halts   = 0;
    1720                stats->ready.sleep.cancels = 0;
     
    3740
    3841        void __tally_stats( struct __stats_t * cltr, struct __stats_t * proc ) {
    39                 __atomic_fetch_add( &cltr->ready.pick.push.attempt, proc->ready.pick.push.attempt, __ATOMIC_SEQ_CST );
    40                 __atomic_fetch_add( &cltr->ready.pick.push.local  , proc->ready.pick.push.local  , __ATOMIC_SEQ_CST );
    41                 __atomic_fetch_add( &cltr->ready.pick.push.success, proc->ready.pick.push.success, __ATOMIC_SEQ_CST );
    42                 __atomic_fetch_add( &cltr->ready.pick.pop .probe  , proc->ready.pick.pop .probe  , __ATOMIC_SEQ_CST );
    43                 __atomic_fetch_add( &cltr->ready.pick.pop .attempt, proc->ready.pick.pop .attempt, __ATOMIC_SEQ_CST );
    44                 __atomic_fetch_add( &cltr->ready.pick.pop .local  , proc->ready.pick.pop .local  , __ATOMIC_SEQ_CST );
    45                 __atomic_fetch_add( &cltr->ready.pick.pop .success, proc->ready.pick.pop .success, __ATOMIC_SEQ_CST );
     42                __atomic_fetch_add( &cltr->ready.pick.push.attempt , proc->ready.pick.push.attempt , __ATOMIC_SEQ_CST );
     43                __atomic_fetch_add( &cltr->ready.pick.push.success , proc->ready.pick.push.success , __ATOMIC_SEQ_CST );
     44                __atomic_fetch_add( &cltr->ready.pick.push.local   , proc->ready.pick.push.local   , __ATOMIC_SEQ_CST );
     45                __atomic_fetch_add( &cltr->ready.pick.push.lsuccess, proc->ready.pick.push.lsuccess, __ATOMIC_SEQ_CST );
     46                __atomic_fetch_add( &cltr->ready.pick.pop .probe   , proc->ready.pick.pop .probe   , __ATOMIC_SEQ_CST );
     47                __atomic_fetch_add( &cltr->ready.pick.pop .attempt , proc->ready.pick.pop .attempt , __ATOMIC_SEQ_CST );
     48                __atomic_fetch_add( &cltr->ready.pick.pop .success , proc->ready.pick.pop .success , __ATOMIC_SEQ_CST );
     49                __atomic_fetch_add( &cltr->ready.pick.pop .local   , proc->ready.pick.pop .local   , __ATOMIC_SEQ_CST );
     50                __atomic_fetch_add( &cltr->ready.pick.pop .lsuccess, proc->ready.pick.pop .lsuccess, __ATOMIC_SEQ_CST );
    4651                __atomic_fetch_add( &cltr->ready.sleep.halts  , proc->ready.sleep.halts  , __ATOMIC_SEQ_CST );
    4752                __atomic_fetch_add( &cltr->ready.sleep.cancels, proc->ready.sleep.cancels, __ATOMIC_SEQ_CST );
     
    7479                double pop_len  = ((double)ready.pick.pop .attempt) / ready.pick.pop .success;
    7580
     81                double lpush_sur = (100.0 * ((double)ready.pick.push.lsuccess) / ready.pick.push.local);
     82                double lpop_sur  = (100.0 * ((double)ready.pick.pop .lsuccess) / ready.pick.pop .local);
     83
     84                double lpush_len = ((double)ready.pick.push.local) / ready.pick.push.lsuccess;
     85                double lpop_len  = ((double)ready.pick.pop .local) / ready.pick.pop .lsuccess;
     86
    7687                #if defined(HAVE_LINUX_IO_URING_H)
    7788                        double avgrdy = ((double)io.submit_q.submit_avg.rdy) / io.submit_q.submit_avg.cnt;
     
    98109                        "- total threads run      : %'15lu\n"
    99110                        "- total threads scheduled: %'15lu\n"
    100                         "- push average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts, %'15lu local)\n"
    101                         "- pop  average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts, %'15lu local)\n"
     111                        "- push average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
     112                        "- pop  average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
     113                        "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
     114                        "- local pop  avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    102115                        "- Idle Sleep -\n"
    103116                        "-- halts                 : %'15lu\n"
     
    123136                        , ready.pick.pop.success
    124137                        , ready.pick.push.success
    125                         , push_len, push_sur, ready.pick.push.attempt, ready.pick.push.local
    126                         , pop_len , pop_sur , ready.pick.pop .attempt, ready.pick.pop .local
     138                        , push_len, push_sur, ready.pick.push.attempt
     139                        , pop_len , pop_sur , ready.pick.pop .attempt
     140                        , lpush_len, lpush_sur, ready.pick.push.local
     141                        , lpop_len , lpop_sur , ready.pick.pop .local
    127142                        , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits
    128143                        #if defined(HAVE_LINUX_IO_URING_H)
Note: See TracChangeset for help on using the changeset viewer.