diff options
author | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-16 18:15:27 +0300 |
---|---|---|
committer | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-17 10:35:29 +0300 |
commit | 8b926a5905c94541ec350981b55f0257ad317f75 (patch) | |
tree | f48de563a0d262a44fc1da0962d640ff073aaa2f | |
parent | 59bb481f96420cb24637ec741618cc5bd57fe829 (diff) | |
download | drm_hwcomposer-8b926a5905c94541ec350981b55f0257ad317f75.tar.gz |
drm_hwcomposer: Use atrace for framebuffer's import/remove events
This metrics are useful to check time the FB cache saves for HWC.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
-rw-r--r-- | drm/DrmFbImporter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drm/DrmFbImporter.cpp b/drm/DrmFbImporter.cpp index 96a9609..f82d674 100644 --- a/drm/DrmFbImporter.cpp +++ b/drm/DrmFbImporter.cpp @@ -15,11 +15,14 @@ */ // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ATRACE_TAG ATRACE_TAG_GRAPHICS +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define LOG_TAG "hwc-platform-drm-generic" #include "DrmFbImporter.h" #include <hardware/gralloc.h> +#include <utils/Trace.h> #include <xf86drm.h> #include <xf86drmMode.h> @@ -34,6 +37,8 @@ namespace android { auto DrmFbIdHandle::CreateInstance(hwc_drm_bo_t *bo, GemHandle first_gem_handle, DrmDevice &drm) -> std::shared_ptr<DrmFbIdHandle> { + ATRACE_NAME("Import dmabufs and register FB"); + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory): priv. constructor usage std::shared_ptr<DrmFbIdHandle> local(new DrmFbIdHandle(drm)); @@ -87,6 +92,8 @@ auto DrmFbIdHandle::CreateInstance(hwc_drm_bo_t *bo, GemHandle first_gem_handle, } DrmFbIdHandle::~DrmFbIdHandle() { + ATRACE_NAME("Close FB and dmabufs"); + /* Destroy framebuffer object */ if (drmModeRmFB(drm_->GetFd(), fb_id_) != 0) { ALOGE("Failed to rm fb"); |