- Timestamp:
- May 5, 2021, 4:42:29 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8464edf
- Parents:
- ce9ed84
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/stats.cfa
rce9ed84 r45b9b21 68 68 } 69 69 70 static inline void tally_one( volatile uint64_t * agg, volatile uint64_t * val) { 71 uint64_t add = __atomic_exchange_n(val, 0_l64u, __ATOMIC_RELAXED); 72 __atomic_fetch_add(agg, add, __ATOMIC_RELAXED); 73 } 74 75 static inline void tally_one( volatile int64_t * agg, volatile int64_t * val) { 76 int64_t add = __atomic_exchange_n(val, 0_l64, __ATOMIC_RELAXED); 77 __atomic_fetch_add(agg, add, __ATOMIC_RELAXED); 78 } 79 70 80 void __tally_stats( struct __stats_t * cltr, struct __stats_t * proc ) { 71 __atomic_fetch_add( &cltr->ready.push.local.attempt, proc->ready.push.local.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.local.attempt = 0;72 __atomic_fetch_add( &cltr->ready.push.local.success, proc->ready.push.local.success, __ATOMIC_SEQ_CST ); proc->ready.push.local.success = 0;73 __atomic_fetch_add( &cltr->ready.push.share.attempt, proc->ready.push.share.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.share.attempt = 0;74 __atomic_fetch_add( &cltr->ready.push.share.success, proc->ready.push.share.success, __ATOMIC_SEQ_CST ); proc->ready.push.share.success = 0;75 __atomic_fetch_add( &cltr->ready.push.extrn.attempt, proc->ready.push.extrn.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.extrn.attempt = 0;76 __atomic_fetch_add( &cltr->ready.push.extrn.success, proc->ready.push.extrn.success, __ATOMIC_SEQ_CST ); proc->ready.push.extrn.success = 0;77 __atomic_fetch_add( &cltr->ready.pop.local .attempt, proc->ready.pop.local .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.local .attempt = 0;78 __atomic_fetch_add( &cltr->ready.pop.local .success, proc->ready.pop.local .success, __ATOMIC_SEQ_CST ); proc->ready.pop.local .success = 0;79 __atomic_fetch_add( &cltr->ready.pop.local .elock , proc->ready.pop.local .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.local .elock = 0;80 __atomic_fetch_add( &cltr->ready.pop.local .eempty , proc->ready.pop.local .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.local .eempty = 0;81 __atomic_fetch_add( &cltr->ready.pop.local .espec , proc->ready.pop.local .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.local .espec = 0;82 __atomic_fetch_add( &cltr->ready.pop.help .attempt, proc->ready.pop.help .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.help .attempt = 0;83 __atomic_fetch_add( &cltr->ready.pop.help .success, proc->ready.pop.help .success, __ATOMIC_SEQ_CST ); proc->ready.pop.help .success = 0;84 __atomic_fetch_add( &cltr->ready.pop.help .elock , proc->ready.pop.help .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.help .elock = 0;85 __atomic_fetch_add( &cltr->ready.pop.help .eempty , proc->ready.pop.help .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.help .eempty = 0;86 __atomic_fetch_add( &cltr->ready.pop.help .espec , proc->ready.pop.help .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.help .espec = 0;87 __atomic_fetch_add( &cltr->ready.pop.steal .attempt, proc->ready.pop.steal .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.steal .attempt = 0;88 __atomic_fetch_add( &cltr->ready.pop.steal .success, proc->ready.pop.steal .success, __ATOMIC_SEQ_CST ); proc->ready.pop.steal .success = 0;89 __atomic_fetch_add( &cltr->ready.pop.steal .elock , proc->ready.pop.steal .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .elock = 0;90 __atomic_fetch_add( &cltr->ready.pop.steal .eempty , proc->ready.pop.steal .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .eempty = 0;91 __atomic_fetch_add( &cltr->ready.pop.steal .espec , proc->ready.pop.steal .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .espec = 0;92 __atomic_fetch_add( &cltr->ready.pop.search.attempt, proc->ready.pop.search.attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.search.attempt = 0;93 __atomic_fetch_add( &cltr->ready.pop.search.success, proc->ready.pop.search.success, __ATOMIC_SEQ_CST ); proc->ready.pop.search.success = 0;94 __atomic_fetch_add( &cltr->ready.pop.search.elock , proc->ready.pop.search.elock , __ATOMIC_SEQ_CST ); proc->ready.pop.search.elock = 0;95 __atomic_fetch_add( &cltr->ready.pop.search.eempty , proc->ready.pop.search.eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.search.eempty = 0;96 __atomic_fetch_add( &cltr->ready.pop.search.espec , proc->ready.pop.search.espec , __ATOMIC_SEQ_CST ); proc->ready.pop.search.espec = 0;97 __atomic_fetch_add( &cltr->ready.threads.migration , proc->ready.threads.migration , __ATOMIC_SEQ_CST ); proc->ready.threads.migration = 0;98 __atomic_fetch_add( &cltr->ready.threads.extunpark , proc->ready.threads.extunpark , __ATOMIC_SEQ_CST ); proc->ready.threads.extunpark = 0;99 __atomic_fetch_add( &cltr->ready.threads.threads , proc->ready.threads.threads , __ATOMIC_SEQ_CST ); proc->ready.threads.threads = 0;100 __atomic_fetch_add( &cltr->ready.sleep.halts , proc->ready.sleep.halts , __ATOMIC_SEQ_CST ); proc->ready.sleep.halts = 0;101 __atomic_fetch_add( &cltr->ready.sleep.cancels , proc->ready.sleep.cancels , __ATOMIC_SEQ_CST ); proc->ready.sleep.cancels = 0;102 __atomic_fetch_add( &cltr->ready.sleep.wakes , proc->ready.sleep.wakes , __ATOMIC_SEQ_CST ); proc->ready.sleep.wakes = 0;103 __atomic_fetch_add( &cltr->ready.sleep.exits , proc->ready.sleep.exits , __ATOMIC_SEQ_CST ); proc->ready.sleep.exits = 0;81 tally_one( &cltr->ready.push.local.attempt, &proc->ready.push.local.attempt ); 82 tally_one( &cltr->ready.push.local.success, &proc->ready.push.local.success ); 83 tally_one( &cltr->ready.push.share.attempt, &proc->ready.push.share.attempt ); 84 tally_one( &cltr->ready.push.share.success, &proc->ready.push.share.success ); 85 tally_one( &cltr->ready.push.extrn.attempt, &proc->ready.push.extrn.attempt ); 86 tally_one( &cltr->ready.push.extrn.success, &proc->ready.push.extrn.success ); 87 tally_one( &cltr->ready.pop.local .attempt, &proc->ready.pop.local .attempt ); 88 tally_one( &cltr->ready.pop.local .success, &proc->ready.pop.local .success ); 89 tally_one( &cltr->ready.pop.local .elock , &proc->ready.pop.local .elock ); 90 tally_one( &cltr->ready.pop.local .eempty , &proc->ready.pop.local .eempty ); 91 tally_one( &cltr->ready.pop.local .espec , &proc->ready.pop.local .espec ); 92 tally_one( &cltr->ready.pop.help .attempt, &proc->ready.pop.help .attempt ); 93 tally_one( &cltr->ready.pop.help .success, &proc->ready.pop.help .success ); 94 tally_one( &cltr->ready.pop.help .elock , &proc->ready.pop.help .elock ); 95 tally_one( &cltr->ready.pop.help .eempty , &proc->ready.pop.help .eempty ); 96 tally_one( &cltr->ready.pop.help .espec , &proc->ready.pop.help .espec ); 97 tally_one( &cltr->ready.pop.steal .attempt, &proc->ready.pop.steal .attempt ); 98 tally_one( &cltr->ready.pop.steal .success, &proc->ready.pop.steal .success ); 99 tally_one( &cltr->ready.pop.steal .elock , &proc->ready.pop.steal .elock ); 100 tally_one( &cltr->ready.pop.steal .eempty , &proc->ready.pop.steal .eempty ); 101 tally_one( &cltr->ready.pop.steal .espec , &proc->ready.pop.steal .espec ); 102 tally_one( &cltr->ready.pop.search.attempt, &proc->ready.pop.search.attempt ); 103 tally_one( &cltr->ready.pop.search.success, &proc->ready.pop.search.success ); 104 tally_one( &cltr->ready.pop.search.elock , &proc->ready.pop.search.elock ); 105 tally_one( &cltr->ready.pop.search.eempty , &proc->ready.pop.search.eempty ); 106 tally_one( &cltr->ready.pop.search.espec , &proc->ready.pop.search.espec ); 107 tally_one( &cltr->ready.threads.migration , &proc->ready.threads.migration ); 108 tally_one( &cltr->ready.threads.extunpark , &proc->ready.threads.extunpark ); 109 tally_one( &cltr->ready.threads.threads , &proc->ready.threads.threads ); 110 tally_one( &cltr->ready.sleep.halts , &proc->ready.sleep.halts ); 111 tally_one( &cltr->ready.sleep.cancels , &proc->ready.sleep.cancels ); 112 tally_one( &cltr->ready.sleep.wakes , &proc->ready.sleep.wakes ); 113 tally_one( &cltr->ready.sleep.exits , &proc->ready.sleep.exits ); 104 114 105 115 #if defined(CFA_HAVE_LINUX_IO_URING_H) 106 __atomic_fetch_add( &cltr->io.alloc.fast , proc->io.alloc.fast , __ATOMIC_SEQ_CST ); proc->io.alloc.fast = 0;107 __atomic_fetch_add( &cltr->io.alloc.slow , proc->io.alloc.slow , __ATOMIC_SEQ_CST ); proc->io.alloc.slow = 0;108 __atomic_fetch_add( &cltr->io.alloc.fail , proc->io.alloc.fail , __ATOMIC_SEQ_CST ); proc->io.alloc.fail = 0;109 __atomic_fetch_add( &cltr->io.alloc.revoke , proc->io.alloc.revoke , __ATOMIC_SEQ_CST ); proc->io.alloc.revoke = 0;110 __atomic_fetch_add( &cltr->io.alloc.block , proc->io.alloc.block , __ATOMIC_SEQ_CST ); proc->io.alloc.block = 0;111 __atomic_fetch_add( &cltr->io.submit.fast , proc->io.submit.fast , __ATOMIC_SEQ_CST ); proc->io.submit.fast = 0;112 __atomic_fetch_add( &cltr->io.submit.slow , proc->io.submit.slow , __ATOMIC_SEQ_CST ); proc->io.submit.slow = 0;113 __atomic_fetch_add( &cltr->io.flush.external , proc->io.flush.external , __ATOMIC_SEQ_CST ); proc->io.flush.external = 0;114 __atomic_fetch_add( &cltr->io.calls.flush , proc->io.calls.flush , __ATOMIC_SEQ_CST ); proc->io.calls.flush = 0;115 __atomic_fetch_add( &cltr->io.calls.submitted , proc->io.calls.submitted , __ATOMIC_SEQ_CST ); proc->io.calls.submitted = 0;116 __atomic_fetch_add( &cltr->io.calls.drain , proc->io.calls.drain , __ATOMIC_SEQ_CST ); proc->io.calls.drain = 0;117 __atomic_fetch_add( &cltr->io.calls.completed , proc->io.calls.completed , __ATOMIC_SEQ_CST ); proc->io.calls.completed = 0;118 __atomic_fetch_add( &cltr->io.calls.errors.busy, proc->io.calls.errors.busy, __ATOMIC_SEQ_CST ); proc->io.calls.errors.busy = 0;119 __atomic_fetch_add( &cltr->io.poller.sleeps , proc->io.poller.sleeps , __ATOMIC_SEQ_CST ); proc->io.poller.sleeps = 0;116 tally_one( &cltr->io.alloc.fast , &proc->io.alloc.fast ); 117 tally_one( &cltr->io.alloc.slow , &proc->io.alloc.slow ); 118 tally_one( &cltr->io.alloc.fail , &proc->io.alloc.fail ); 119 tally_one( &cltr->io.alloc.revoke , &proc->io.alloc.revoke ); 120 tally_one( &cltr->io.alloc.block , &proc->io.alloc.block ); 121 tally_one( &cltr->io.submit.fast , &proc->io.submit.fast ); 122 tally_one( &cltr->io.submit.slow , &proc->io.submit.slow ); 123 tally_one( &cltr->io.flush.external , &proc->io.flush.external ); 124 tally_one( &cltr->io.calls.flush , &proc->io.calls.flush ); 125 tally_one( &cltr->io.calls.submitted , &proc->io.calls.submitted ); 126 tally_one( &cltr->io.calls.drain , &proc->io.calls.drain ); 127 tally_one( &cltr->io.calls.completed , &proc->io.calls.completed ); 128 tally_one( &cltr->io.calls.errors.busy, &proc->io.calls.errors.busy ); 129 tally_one( &cltr->io.poller.sleeps , &proc->io.poller.sleeps ); 120 130 #endif 121 131 }
Note: See TracChangeset
for help on using the changeset viewer.