msm: camera: smmu: Profile time taken for map, unmap

Add debugging capability to profile ion alloc,
smmu map and unmap calls. Enable below debugfs settings
to get the traces with corresponding latencies.
Alloc      : echo 1 > /sys/kernel/debug/camera_memmgr/alloc_profile_enable
Map, Unmap : echo 1 > /sys/kernel/debug/camera_smmu/map_profile_enable
Capture the profiling numbers in traces.

CRs-Fixed: 2538876
Change-Id: I92dc58416a9febc77a7836b8f7b1523b547c128f
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This commit is contained in:
Pavan Kumar Chilamkurthi
2020-04-16 20:28:26 -07:00
parent d324acfbdb
commit 1b644126dd
4 changed files with 108 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*/
#ifndef _CAM_COMMON_UTIL_H_
@@ -14,6 +14,25 @@
#define PTR_TO_U64(ptr) ((uint64_t)(uintptr_t)ptr)
#define U64_TO_PTR(ptr) ((void *)(uintptr_t)ptr)
#define CAM_GET_TIMESTAMP(timestamp) ktime_get_real_ts64(&(timestamp))
#define CAM_GET_TIMESTAMP_DIFF_IN_MICRO(ts_start, ts_end, diff_microsec) \
({ \
diff_microsec = 0; \
if (ts_end.tv_nsec >= ts_start.tv_nsec) { \
diff_microsec = \
(ts_end.tv_nsec - ts_start.tv_nsec) / 1000; \
diff_microsec += \
(ts_end.tv_sec - ts_start.tv_sec) * 1000 * 1000; \
} else { \
diff_microsec = \
(ts_end.tv_nsec + \
(1000*1000*1000 - ts_start.tv_nsec)) / 1000; \
diff_microsec += \
(ts_end.tv_sec - ts_start.tv_sec - 1) * 1000 * 1000; \
} \
})
/**
* cam_common_util_get_string_index()
*