diff options
author | Devika Krishnadas <kdevika@google.com> | 2022-04-25 21:43:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-04-25 21:43:51 +0000 |
commit | cbc8a1480cfb2dc69b5da436a27c10d7f28adcf5 (patch) | |
tree | 6acc51e14e3af283161516c48f1ab82e23747734 | |
parent | fe28ef1e51d5786e41e55592bd26e457791e07a1 (diff) | |
parent | 044032e6b9257eafe4c8e0b9c85dc5656842a9fa (diff) | |
download | gchips-cbc8a1480cfb2dc69b5da436a27c10d7f28adcf5.tar.gz |
Merge "Gralloc: add tracing" into tm-dev am: 793e03473f am: 044032e6b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/17914744
Change-Id: I7ca337a65df9f4b4eaf8348924faa4d564963a3f
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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; |