Skip to content

Commit 814989e

Browse files
committed
yukon: move dump_htlb
1 parent 21cf2aa commit 814989e

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

runtime/yukon/yukon.cpp

+17-14
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,6 @@ static void wait_for_csr_zero(void) {
8686
}
8787

8888

89-
static void dump_htlb() {
90-
auto &rt = alaska::Runtime::get();
91-
auto size = 576;
92-
auto *space = rt.locality_manager.get_hotness_buffer(size);
93-
memset(space, 0, size * sizeof(alaska::handle_id_t));
94-
95-
asm volatile("fence" ::: "memory");
96-
97-
write_csr(0xc3, (uint64_t)space);
98-
wait_for_csr_zero();
99-
asm volatile("fence" ::: "memory");
100-
101-
rt.locality_manager.feed_hotness_buffer(size, space);
102-
}
10389

10490
#define BACKTRACE_SIZE 100
10591

@@ -176,6 +162,23 @@ static alaska::ThreadCache *get_tc() {
176162
return tc;
177163
}
178164

165+
166+
static void dump_htlb() {
167+
auto tc = get_tc();
168+
auto size = 576;
169+
auto *space = tc->localizer.get_hotness_buffer(size);
170+
memset(space, 0, size * sizeof(alaska::handle_id_t));
171+
172+
asm volatile("fence" ::: "memory");
173+
174+
write_csr(0xc3, (uint64_t)space);
175+
wait_for_csr_zero();
176+
asm volatile("fence" ::: "memory");
177+
tc->localizer.feed_hotness_buffer(size, space);
178+
asm volatile("fence" ::: "memory");
179+
}
180+
181+
179182
void __attribute__((constructor(102))) alaska_init(void) {
180183
unsetenv("LD_PRELOAD"); // make it so we don't run alaska in subprocesses!
181184
get_tc();

0 commit comments

Comments
 (0)