Logging API change (refactor) (#19324)

* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2024-07-14 14:42:59 +02:00
1 parent ae3ff686f0
commit e01ca5b057
393 files changed
+6198 -6193

No files matched your search

+7 -7
View File
@@ -88,7 +88,7 @@ static int legacy_ashmem_create_region(const char *name, size_t size) {
return fd;
error:
ERROR_LOG(MEMMAP, "NASTY ASHMEM ERROR: ret = %08x", ret);
ERROR_LOG(Log::MemMap, "NASTY ASHMEM ERROR: ret = %08x", ret);
close(fd);
return ret;
}
@@ -110,7 +110,7 @@ bool MemArena::GrabMemSpace(size_t size) {
}
// Note that it appears that ashmem is pinned by default, so no need to pin.
if (fd < 0) {
ERROR_LOG(MEMMAP, "Failed to grab ashmem space of size: %08x errno: %d", (int)size, (int)(errno));
ERROR_LOG(Log::MemMap, "Failed to grab ashmem space of size: %08x errno: %d", (int)size, (int)(errno));
return false;
}
return true;
@@ -123,7 +123,7 @@ void MemArena::ReleaseSpace() {
void *MemArena::CreateView(s64 offset, size_t size, void *base) {
void *retval = mmap(base, size, PROT_READ | PROT_WRITE, MAP_SHARED | ((base == 0) ? 0 : MAP_FIXED), fd, offset);
if (retval == MAP_FAILED) {
NOTICE_LOG(MEMMAP, "mmap on ashmem (fd: %d) failed", (int)fd);
NOTICE_LOG(Log::MemMap, "mmap on ashmem (fd: %d) failed", (int)fd);
return nullptr;
}
return retval;
@@ -142,14 +142,14 @@ u8* MemArena::Find4GBBase() {
const uint64_t EIGHT_GIGS = 0x200000000ULL;
void *base = mmap(0, EIGHT_GIGS, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
if (base && base != MAP_FAILED) {
INFO_LOG(SYSTEM, "base: %p", base);
INFO_LOG(Log::System, "base: %p", base);
uint64_t aligned_base = ((uint64_t)base + 0xFFFFFFFF) & ~0xFFFFFFFFULL;
INFO_LOG(SYSTEM, "aligned_base: %p", (void *)aligned_base);
INFO_LOG(Log::System, "aligned_base: %p", (void *)aligned_base);
munmap(base, EIGHT_GIGS);
return reinterpret_cast<u8 *>(aligned_base);
} else {
u8 *hardcoded_ptr = reinterpret_cast<u8*>(0x2300000000ULL);
INFO_LOG(SYSTEM, "Failed to anonymously map 8GB. Fall back to the hardcoded pointer %p.", hardcoded_ptr);
INFO_LOG(Log::System, "Failed to anonymously map 8GB. Fall back to the hardcoded pointer %p.", hardcoded_ptr);
// Just grab some random 4GB...
// This has been known to fail lately though, see issue #12249.
return hardcoded_ptr;
@@ -159,7 +159,7 @@ u8* MemArena::Find4GBBase() {
void *base = mmap(0, 0x10000000, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
if (base == MAP_FAILED) {
ERROR_LOG(SYSTEM, "Failed to map 256 MB of memory space: %s", strerror(errno));
ERROR_LOG(Log::System, "Failed to map 256 MB of memory space: %s", strerror(errno));
return nullptr;
}