src/common/backtrace_utils.h


Log

Author Commit Date CI Message
Amirali Abdolrashidi 156efe9e 2023-02-23T14:07:23 Fix the alloc error with enabled backtrace feature When angle_enable_unwind_backtrace_support is enabled, an assertion occurs on memory allocation with the following message: "constructed value does not match the lookup key" The assertion comes from PolicyTraits::apply() in the hash map. * In MemoryTracking.h, the type of mMemoryAllocationRecord is now std::unordered_map instead of angle::HashMap. Bug: b/262029018 Change-Id: I11a6d8e99a129759c046e37cef9e74f7db193066 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289947 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 58d7ace2 2022-11-22T16:08:07 Vulkan: Add memory allocation log support in debug * Added a memory tracker to the renderer object to keep track of the memory allocations and deallocations in more detail. * This feature is used for debugging only. * To enable it, set angle_enable_memory_alloc_logging=true in GN args (added in renderer/vulkan/BUILD). * It is related to ANGLE_ENABLE_MEMORY_ALLOC_LOGGING in the code. * The tracker are updated in the memory allocation tracking functions if the feature is enabled. (The counter is always updated, even if the feature is disabled.) * At the end of a RendererVk object, it checks for and logs any remaining allocated memory from MemoryAllocationType members. * The data is stored in the map object "mMemoryAllocationTracker". The key used for it is currently of type angle::BacktraceInfo. * If angle_enable_unwind_backtrace_support is disabled, or not on Android, the key is an empty object. * MemoryAllocInfoMapKey is used as a key to access the allocation information. Bug: b/242641395 Change-Id: If701a4bdea2f8738a830ee47e0c7c5cdacf95b87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4050103 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi f62405c5 2022-10-31T18:47:52 Add utilities to get the Android backtrace * Added getBacktraceInfo(), which returns the backtrace information from the ANGLE code, including the addresses and the symbols if possible * Returns the data in an instance of the new class BacktraceInfo. * In order to access this function, backtrace_utils.h has been included in vk_utils.h * New GN flag to make use of this feature: * angle_enable_unwind_backtrace_support * Current only available on Android (debug mode) * If the flag is disabled, getBacktraceInfo() returns an empty object. * Added functions in util/ (per platform) to print the BacktraceInfo data. * Example of usage: angle::printBacktraceInfo(angle::getBacktraceInfo()); * Minor edit: Moved cstdint from android_util.cpp to its header. Bug: b/258475923 Change-Id: I6115462a1a2845d40c7cafc14ce52df09ecdcf34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3995843 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>