- File:
-
- 1 edited
-
libcfa/src/concurrency/stats.hfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/stats.hfa
r3bd4293 rb7664a03 1 1 #pragma once 2 3 // #define CFA_STATS_ARRAY 100004 2 5 3 #include <stdint.h> … … 16 14 static inline void __print_stats( struct __stats_t *, int, const char *, const char *, void * ) {} 17 15 #else 18 struct __stats_readyQ_pop_t {19 // number of attemps at poping something20 volatile uint64_t attempt;21 16 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 { 37 18 struct { 19 // Push statistic 38 20 struct { 39 // number of attemps at pushing something to preferred queues21 // number of attemps at pushing something 40 22 volatile uint64_t attempt; 41 23 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 42 30 // 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 43 45 volatile uint64_t success; 44 }45 // Stats for local queue within cluster46 local,47 46 48 // Stats for non-local queues within cluster49 share,47 // number of attemps at poping something to preferred queues 48 volatile uint64_t local; 50 49 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; 70 54 struct { 71 55 volatile uint64_t migration; 72 volatile uint64_t extunpark;73 volatile int64_t threads; // number of threads in the system, includes only local change74 56 } threads; 75 57 struct { … … 84 66 struct __attribute__((aligned(64))) __stats_io_t{ 85 67 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; 92 88 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;104 89 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; 118 95 }; 119 96 #endif 120 97 121 98 struct __attribute__((aligned(128))) __stats_t { 122 __stats_read yQ_t ready;99 __stats_readQ_t ready; 123 100 #if defined(CFA_HAVE_LINUX_IO_URING_H) 124 101 __stats_io_t io; 125 102 #endif 126 127 #if defined(CFA_STATS_ARRAY)128 struct {129 __stats_elem_t * values;130 volatile size_t cnt;131 } array;132 #endif133 134 103 }; 135 104 … … 137 106 void __tally_stats( struct __stats_t *, struct __stats_t * ); 138 107 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 #else143 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 #endif146 108 #endif 147 109
Note:
See TracChangeset
for help on using the changeset viewer.