Skip to content

Commit 216be50

Browse files
committed
runtime: track barrier rate
1 parent 1e7522f commit 216be50

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

runtime/core/Runtime.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ namespace alaska {
6666
#undef xstr
6767
#undef str
6868

69-
for (auto *tc: this->tcs) {
70-
fprintf(stream, "tc%d allocations:%zu, rate:%.1f/s", tc->id, tc->allocation_rate.read(), tc->allocation_rate.digest());
71-
69+
fprintf(stream, "barriers: %zu, rate:%.1f/s\n", stat_barriers.read(), stat_barriers.digest());
7270

71+
for (auto *tc : this->tcs) {
72+
fprintf(stream, "tc%d allocations:%zu, rate:%.1f/s", tc->id, tc->allocation_rate.read(),
73+
tc->allocation_rate.digest());
7374
fprintf(stream, " frees:%zu, rate:%.1f/s", tc->free_rate.read(), tc->free_rate.digest());
74-
7575
fprintf(stream, "\n");
7676
}
7777
// handle_table.dump(stream);

runtime/include/alaska/Runtime.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace alaska {
5656
// A pointer to the runtime's current barrier manager.
5757
// This is defaulted to a "nop" manager which simply does nothing.
5858
alaska::BarrierManager *barrier_manager;
59+
alaska::RateCounter stat_barriers;
5960

6061
// Return the singleton instance of the Runtime if it has been allocated. Abort otherwise.
6162
static Runtime &get();
@@ -96,6 +97,7 @@ namespace alaska {
9697
lock_all_thread_caches();
9798
if (barrier_manager->begin()) {
9899
in_barrier = true;
100+
stat_barriers++;
99101
barrier_manager->barrier_count++;
100102
cb();
101103
in_barrier = false;

0 commit comments

Comments
 (0)