diff --git a/src/Logger.c b/src/Logger.c index bc884ec3c..af3069f48 100644 --- a/src/Logger.c +++ b/src/Logger.c @@ -622,6 +622,17 @@ static void DumpMisc(void* ctx) { #include #include +#ifdef CC_BUILD_ANDROID +static int SkipRange(const cc_string* str) { + /* Android has a lot of ranges in /maps, which produces 100-120 kb of logs for one single crash! */ + /* As such, to cut down the crash logs to more relevant information, ignore shared memory and fonts */ + /* (e.g. removes a ton of '/dev/ashmem/dalvik-thread local mark stack (deleted)' entries */ + return String_ContainsConst(str, "/system/fonts/") || String_ContainsConst(str, "/dev/ashmem/"); +} +#else +static int SkipRange(const cc_string* str) { return false; } +#endif + static void DumpMisc(void* ctx) { static const cc_string memMap = String_FromConst("-- memory map --\n"); cc_string str; char strBuffer[320]; @@ -635,7 +646,7 @@ static void DumpMisc(void* ctx) { while ((n = read(fd, str.buffer, str.capacity)) > 0) { str.length = n; - Logger_Log(&str); + if (!SkipRange(&str)) Logger_Log(&str); } close(fd);