msm: camera: common: Append timestamp in INFO LOGS

Use Kernel time to obtain the current time when IFE is acquired
/released and when sensor is streamed on/off. Convert the Ktime
to a timestamp format and log it in existing info prints. This
will help to co-relate timestamp between user-space and kernel
logs. The change also replaces the current usage of direct calls
to ktime_get_real_ts64 with macro across all drivers.

CRs-Fixed: 2987320
Change-Id: I87c4790164d222fc1ed6ff41ad00eeb1ed8c8867
Signed-off-by: Sokchetra Eung <eung@codeaurora.org>
此提交包含在:
Sokchetra Eung
2021-06-30 14:57:56 -07:00
父節點 823a276cb2
當前提交 5a11ba0725
共有 6 個檔案被更改,包括 78 行新增91 行删除

查看文件

@@ -17,21 +17,30 @@
#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; \
} \
#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; \
} \
})
#define CAM_CONVERT_TIMESTAMP_FORMAT(ts, hrs, min, sec, ms) \
({ \
uint64_t tmp = ((ts).tv_sec); \
(ms) = ((ts).tv_nsec) / 1000000; \
(sec) = do_div(tmp, 60); \
(min) = do_div(tmp, 60); \
(hrs) = do_div(tmp, 24); \
})