Ignore:
File:
1 edited

Legend:

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

    r3bd4293 rb7664a03  
    11#pragma once
    2 
    3 // #define CFA_STATS_ARRAY 10000
    42
    53#include <stdint.h>
     
    1614        static inline void __print_stats( struct __stats_t *, int, const char *, const char *, void * ) {}
    1715#else
    18         struct __stats_readyQ_pop_t {
    19                 // number of attemps at poping something
    20                 volatile uint64_t attempt;
    2116
    22                 // number of successes at poping
    23                 volatile uint64_t success;
    24 
    25                 // number of attempts failed due to the lock being held
    26                 volatile uint64_t elock;
    27 
    28                 // number of attempts failed due to the queue being empty (lock held)
    29                 volatile uint64_t eempty;
    30 
    31                 // number of attempts failed due to the queue looking empty (lock not held)
    32                 volatile uint64_t espec;
    33         };
    34 
    35         struct __attribute__((aligned(64))) __stats_readyQ_t {
    36                 // Push statistic
     17        struct __attribute__((aligned(64))) __stats_readQ_t {
    3718                struct {
     19                        // Push statistic
    3820                        struct {
    39                                 // number of attemps at pushing something to preferred queues
     21                                // number of attemps at pushing something
    4022                                volatile uint64_t attempt;
    4123
     24                                // number of successes at pushing
     25                                volatile uint64_t success;
     26
     27                                // number of attemps at pushing something to preferred queues
     28                                volatile uint64_t local;
     29
    4230                                // number of successes at pushing to preferred queues
     31                                volatile uint64_t lsuccess;
     32                        } push;
     33
     34                        // Pop statistic
     35                        struct {
     36                                // number of reads of the mask
     37                                // picking an empty __cfa_readyQ_mask_t counts here
     38                                // but not as an attempt
     39                                volatile uint64_t probe;
     40
     41                                // number of attemps at poping something
     42                                volatile uint64_t attempt;
     43
     44                                // number of successes at poping
    4345                                volatile uint64_t success;
    44                         }
    45                         // Stats for local queue within cluster
    46                         local,
    4746
    48                         // Stats for non-local queues within cluster
    49                         share,
     47                                // number of attemps at poping something to preferred queues
     48                                volatile uint64_t local;
    5049
    51                         // Stats from outside cluster
    52                         extrn;
    53                 } push;
    54 
    55                 // Pop statistic
    56                 struct {
    57                         // pop from local queue
    58                         __stats_readyQ_pop_t local;
    59 
    60                         // pop before looking at local queue
    61                         __stats_readyQ_pop_t help;
    62 
    63                         // pop from some other queue
    64                         __stats_readyQ_pop_t steal;
    65 
    66                         // pop when searching queues sequentially
    67                         __stats_readyQ_pop_t search;
    68                 } pop;
    69 
     50                                // number of successes at poping to preferred queues
     51                                volatile uint64_t lsuccess;
     52                        } pop;
     53                } pick;
    7054                struct {
    7155                        volatile uint64_t migration;
    72                         volatile uint64_t extunpark;
    73                         volatile  int64_t threads; // number of threads in the system, includes only local change
    7456                } threads;
    7557                struct {
     
    8466                struct __attribute__((aligned(64))) __stats_io_t{
    8567                        struct {
    86                                 volatile uint64_t fast;
    87                                 volatile uint64_t slow;
    88                                 volatile uint64_t fail;
    89                                 volatile uint64_t revoke;
    90                                 volatile uint64_t block;
    91                         } alloc;
     68                                struct {
     69                                        volatile uint64_t rdy;
     70                                        volatile uint64_t csm;
     71                                        volatile uint64_t avl;
     72                                        volatile uint64_t cnt;
     73                                } submit_avg;
     74                                struct {
     75                                        volatile uint64_t val;
     76                                        volatile uint64_t cnt;
     77                                        volatile uint64_t block;
     78                                } look_avg;
     79                                struct {
     80                                        volatile uint64_t val;
     81                                        volatile uint64_t cnt;
     82                                        volatile uint64_t block;
     83                                } alloc_avg;
     84                                volatile uint64_t helped;
     85                                volatile uint64_t leader;
     86                                volatile uint64_t busy;
     87                        } submit_q;
    9288                        struct {
    93                                 volatile uint64_t fast;
    94                                 volatile uint64_t slow;
    95                         } submit;
    96                         struct {
    97                                 volatile uint64_t external;
    98                         } flush;
    99                         struct {
    100                                 volatile uint64_t drain;
    101                                 volatile uint64_t completed;
    102                                 volatile uint64_t flush;
    103                                 volatile uint64_t submitted;
    10489                                struct {
    105                                         volatile uint64_t busy;
    106                                 } errors;
    107                         } calls;
    108                         struct {
    109                                 volatile uint64_t sleeps;
    110                         } poller;
    111                 };
    112         #endif
    113 
    114         #if defined(CFA_STATS_ARRAY)
    115                 struct __stats_elem_t {
    116                         long long int ts;
    117                         int64_t value;
     90                                        volatile uint64_t val;
     91                                        volatile uint64_t cnt;
     92                                } completed_avg;
     93                                volatile uint64_t blocks;
     94                        } complete_q;
    11895                };
    11996        #endif
    12097
    12198        struct __attribute__((aligned(128))) __stats_t {
    122                 __stats_readyQ_t ready;
     99                __stats_readQ_t ready;
    123100                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    124101                        __stats_io_t    io;
    125102                #endif
    126 
    127                 #if defined(CFA_STATS_ARRAY)
    128                         struct {
    129                                 __stats_elem_t * values;
    130                                 volatile size_t cnt;
    131                         } array;
    132                 #endif
    133 
    134103        };
    135104
     
    137106        void __tally_stats( struct __stats_t *, struct __stats_t * );
    138107        void __print_stats( struct __stats_t *, int, const char *, const char *, void * );
    139         #if defined(CFA_STATS_ARRAY)
    140                 void __push_stat ( struct __stats_t *, int64_t value, bool external, const char * name, void * handle);
    141                 void __flush_stat( struct __stats_t *, const char *, void * );
    142         #else
    143                 static inline void __push_stat ( struct __stats_t *, int64_t, bool, const char *, void * ) {}
    144                 static inline void __flush_stat( struct __stats_t *, const char *, void * ) {}
    145         #endif
    146108#endif
    147109
Note: See TracChangeset for help on using the changeset viewer.