diff options
author | Devika Krishnadas <kdevika@google.com> | 2022-04-25 21:02:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-04-25 21:02:44 +0000 |
commit | 793e03473fc71b224d7a09bfc6e427f5a9a3f664 (patch) | |
tree | 6acc51e14e3af283161516c48f1ab82e23747734 | |
parent | de403fbacfcd111c90f0de2a26d6c521361e0505 (diff) | |
parent | ff01c8eef98fc804ae02857b38dfbbb8f51784bc (diff) | |
download | gchips-793e03473fc71b224d7a09bfc6e427f5a9a3f664.tar.gz |
Merge "Gralloc: add tracing" into tm-dev
-rw-r--r-- | gralloc4/src/allocator/mali_gralloc_ion.cpp | 7 | ||||
-rw-r--r-- | gralloc4/src/core/mali_gralloc_bufferallocation.cpp | 4 | ||||
-rw-r--r-- | gralloc4/src/hidl_common/Allocator.cpp | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/gralloc4/src/allocator/mali_gralloc_ion.cpp b/gralloc4/src/allocator/mali_gralloc_ion.cpp index 58790a3..8ac63af 100644 --- a/gralloc4/src/allocator/mali_gralloc_ion.cpp +++ b/gralloc4/src/allocator/mali_gralloc_ion.cpp @@ -16,6 +16,8 @@ * limitations under the License. */ +#define ATRACE_TAG ATRACE_TAG_GRAPHICS + #include <string.h> #include <errno.h> #include <inttypes.h> @@ -25,6 +27,8 @@ #include <log/log.h> #include <cutils/atomic.h> +#include <utils/Trace.h> + #include <linux/dma-buf.h> #include <vector> @@ -342,6 +346,7 @@ static std::string select_dmabuf_heap(unsigned int heap_mask) int ion_device::alloc_from_dmabuf_heap(const std::string& heap_name, size_t size, unsigned int flags) { + ATRACE_NAME(("alloc_from_dmabuf_heap " + heap_name).c_str()); if (!buffer_allocator) { return -1; @@ -358,6 +363,7 @@ int ion_device::alloc_from_dmabuf_heap(const std::string& heap_name, size_t size int ion_device::alloc_from_ion_heap(uint64_t usage, size_t size, unsigned int flags, int *min_pgsz) { + ATRACE_CALL(); /* TODO: remove min_pgsz? I don't think this is useful on Exynos */ if (size == 0 || min_pgsz == NULL) { @@ -541,6 +547,7 @@ static void mali_gralloc_ion_free_internal(buffer_handle_t * const pHandle, int mali_gralloc_ion_allocate_attr(private_handle_t *hnd) { + ATRACE_CALL(); ion_device *dev = ion_device::get(); if (!dev) { diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp index f81a10c..12e4494 100644 --- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp +++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp @@ -16,10 +16,13 @@ * limitations under the License. */ +#define ATRACE_TAG ATRACE_TAG_GRAPHICS + #include <inttypes.h> #include <assert.h> #include <atomic> #include <algorithm> +#include <utils/Trace.h> #include <hardware/hardware.h> #include <hardware/gralloc1.h> @@ -1097,6 +1100,7 @@ int mali_gralloc_buffer_allocate(const gralloc_buffer_descriptor_t *descriptors, uint32_t numDescriptors, buffer_handle_t *pHandle, bool *shared_backend, int fd) { + ATRACE_CALL(); bool shared = false; uint64_t backing_store_id = 0x0; int err; diff --git a/gralloc4/src/hidl_common/Allocator.cpp b/gralloc4/src/hidl_common/Allocator.cpp index 8174f05..6ca758a 100644 --- a/gralloc4/src/hidl_common/Allocator.cpp +++ b/gralloc4/src/hidl_common/Allocator.cpp @@ -16,6 +16,10 @@ * limitations under the License. */ +#define ATRACE_TAG ATRACE_TAG_GRAPHICS + +#include <utils/Trace.h> + #include "SharedMetadata.h" #include "Allocator.h" #include "core/mali_gralloc_bufferallocation.h" @@ -38,6 +42,7 @@ void allocate(const buffer_descriptor_t &bufferDescriptor, uint32_t count, IAllo #if DISABLE_FRAMEBUFFER_HAL GRALLOC_UNUSED(fb_allocator); #endif + ATRACE_CALL(); Error error = Error::NONE; int stride = 0; |