[orbis-kernel] log _umtx_op to trace

This commit is contained in:
Ivan Chikish 2023-07-13 22:15:52 +03:00
parent b9e6d952ae
commit 4c2e3c2429

View file

@ -60,7 +60,7 @@ orbis::ErrorCode orbis::umtx_unlock_umtx(Thread *thread, ptr<umtx> umtx,
orbis::ErrorCode orbis::umtx_wait(Thread *thread, ptr<void> addr, ulong id,
std::uint64_t ut, bool is32) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, addr, id, ut, is32);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, addr, id, ut, is32);
auto [chain, key, lock] = g_context.getUmtxChain0(thread->tproc->pid, addr);
auto node = chain.enqueue(key, thread);
ErrorCode result = {};
@ -97,7 +97,7 @@ orbis::ErrorCode orbis::umtx_wait(Thread *thread, ptr<void> addr, ulong id,
}
orbis::ErrorCode orbis::umtx_wake(Thread *thread, ptr<void> addr, sint n_wake) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, addr, n_wake);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, addr, n_wake);
auto [chain, key, lock] = g_context.getUmtxChain0(thread->tproc->pid, addr);
std::size_t count = chain.sleep_queue.count(key);
// TODO: check this
@ -132,7 +132,7 @@ void log_class_string<umutex_lock_mode>::format(std::string &out,
}
static ErrorCode do_lock_normal(Thread *thread, ptr<umutex> m, uint flags,
std::uint64_t ut, umutex_lock_mode mode) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, m, flags, ut, mode);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, m, flags, ut, mode);
ErrorCode error = {};
while (true) {
@ -187,7 +187,7 @@ static ErrorCode do_lock_pp(Thread *thread, ptr<umutex> m, uint flags,
return ErrorCode::NOSYS;
}
static ErrorCode do_unlock_normal(Thread *thread, ptr<umutex> m, uint flags) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, m, flags);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, m, flags);
int owner = m->owner.load(std::memory_order_acquire);
if ((owner & ~kUmutexContested) != thread->tid)
@ -277,7 +277,7 @@ orbis::ErrorCode orbis::umtx_set_ceiling(Thread *thread, ptr<umutex> m,
orbis::ErrorCode orbis::umtx_cv_wait(Thread *thread, ptr<ucond> cv,
ptr<umutex> m, std::uint64_t ut,
ulong wflags) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, cv, m, ut, wflags);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, cv, m, ut, wflags);
uint flags;
if (ErrorCode err = uread(flags, &m->flags); err != ErrorCode{})
return err;
@ -335,7 +335,7 @@ orbis::ErrorCode orbis::umtx_cv_wait(Thread *thread, ptr<ucond> cv,
}
orbis::ErrorCode orbis::umtx_cv_signal(Thread *thread, ptr<ucond> cv) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, cv);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, cv);
auto [chain, key, lock] = g_context.getUmtxChain0(thread->tproc->pid, cv);
std::size_t count = chain.sleep_queue.count(key);
if (chain.notify_one(key) >= count)
@ -344,7 +344,7 @@ orbis::ErrorCode orbis::umtx_cv_signal(Thread *thread, ptr<ucond> cv) {
}
orbis::ErrorCode orbis::umtx_cv_broadcast(Thread *thread, ptr<ucond> cv) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, cv);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, cv);
auto [chain, key, lock] = g_context.getUmtxChain0(thread->tproc->pid, cv);
chain.notify_all(key);
cv->has_waiters.store(0, std::memory_order::relaxed);
@ -431,7 +431,7 @@ orbis::ErrorCode orbis::umtx_sem_wake(Thread *thread, ptr<void> obj,
orbis::ErrorCode orbis::umtx_nwake_private(Thread *thread, ptr<void *> uaddrs,
std::int64_t count) {
ORBIS_LOG_NOTICE(__FUNCTION__, thread->tid, uaddrs, count);
ORBIS_LOG_TRACE(__FUNCTION__, thread->tid, uaddrs, count);
while (count-- > 0) {
void *uaddr;
auto error = uread(uaddr, uaddrs++);