Fix a SEGV when running --roctx-trace

There's a typo in RegisterApiCallback, roctx::cb_table.Get should be
roctx::cb_table.Set.

Change-Id: I47ec8ac666f783ff4e03f35d13e375e645899900


[ROCm/roctracer commit: 0d7d56eea5]
This commit is contained in:
Laurent Morichetti
2022-04-27 08:36:54 -07:00
zatwierdzone przez Laurent Morichetti
rodzic 140d2d4bc2
commit 576554dcea
2 zmienionych plików z 2 dodań i 1 usunięć
@@ -45,6 +45,7 @@ template <uint32_t N> class CallbackTable {
void Get(uint32_t id, activity_rtapi_callback_t* callback, void** arg) const {
assert(id < N && "id is out of range");
assert(callback != nullptr && arg != nullptr && "invalid arguments");
std::lock_guard lock(mutex_);
std::tie(*callback, *arg) = callbacks_[id];
}
+1 -1
Wyświetl plik
@@ -230,7 +230,7 @@ PUBLIC_API bool RegisterApiCallback(uint32_t op, void* callback, void* arg) {
PUBLIC_API bool RemoveApiCallback(uint32_t op) {
if (op >= ROCTX_API_ID_NUMBER) return false;
roctx::cb_table.Get(op, NULL, NULL);
roctx::cb_table.Set(op, nullptr, nullptr);
return true;
}