浏览代码

msm: camera: isp: Modify the timestamp format of ISP state monitor

Modify the timestamp format of ISP state monitor. We need to use the
dump info from CRM and ISP to draw a timing diagram for debugging,
so we need to keep their timestamp format same.

CRs-Fixed: 3413642
Change-Id: Icc397a04f18fe1fd41c2c78e228730c245f8ef49
Signed-off-by: mingpan <[email protected]>
mingpan 2 年之前
父节点
当前提交
8b33590932
共有 2 个文件被更改,包括 10 次插入6 次删除
  1. 9 5
      drivers/cam_isp/cam_isp_context.c
  2. 1 1
      drivers/cam_isp/cam_isp_context.h

+ 9 - 5
drivers/cam_isp/cam_isp_context.c

@@ -475,8 +475,7 @@ static void __cam_isp_ctx_update_state_monitor_array(
 		trigger_type;
 	ctx_isp->cam_isp_ctx_state_monitor[iterator].req_id =
 		req_id;
-	ctx_isp->cam_isp_ctx_state_monitor[iterator].evt_time_stamp =
-		jiffies_to_msecs(jiffies) - ctx_isp->init_timestamp;
+	ktime_get_clocktai_ts64(&ctx_isp->cam_isp_ctx_state_monitor[iterator].evt_time_stamp);
 }
 
 static const char *__cam_isp_ctx_substate_val_to_type(
@@ -539,6 +538,7 @@ static void __cam_isp_ctx_dump_state_monitor_array(
 	int i = 0;
 	int64_t state_head = 0;
 	uint32_t index, num_entries, oldest_entry;
+	struct tm ts;
 
 	state_head = atomic64_read(&ctx_isp->state_monitor_head);
 
@@ -559,10 +559,13 @@ static void __cam_isp_ctx_dump_state_monitor_array(
 	index = oldest_entry;
 
 	for (i = 0; i < num_entries; i++) {
+		time64_to_tm(ctx_isp->cam_isp_ctx_state_monitor[index].evt_time_stamp.tv_sec,
+			0, &ts);
 		CAM_ERR(CAM_ISP,
-		"Index[%d] time[%d] : Substate[%s] Frame[%lld] ReqId[%llu] evt_type[%s]",
+		"Idx[%d] time[%d-%d %d:%d:%d.%lld]:Substate[%s] Frame[%lld] Req[%llu] evt[%s]",
 		index,
-		ctx_isp->cam_isp_ctx_state_monitor[index].evt_time_stamp,
+		ts.tm_mon + 1, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec,
+		ctx_isp->cam_isp_ctx_state_monitor[index].evt_time_stamp.tv_nsec / 1000000,
 		__cam_isp_ctx_substate_val_to_type(
 		ctx_isp->cam_isp_ctx_state_monitor[index].curr_state),
 		ctx_isp->cam_isp_ctx_state_monitor[index].frame_id,
@@ -584,7 +587,8 @@ static void *cam_isp_ctx_user_dump_state_monitor_array_info(
 
 	addr = (uint64_t *)addr_ptr;
 
-	*addr++ = evt->evt_time_stamp;
+	*addr++ = evt->evt_time_stamp.tv_sec;
+	*addr++ = evt->evt_time_stamp.tv_nsec / NSEC_PER_USEC;
 	*addr++ = evt->frame_id;
 	*addr++ = evt->req_id;
 	return addr;

+ 1 - 1
drivers/cam_isp/cam_isp_context.h

@@ -212,7 +212,7 @@ struct cam_isp_context_state_monitor {
 	enum cam_isp_state_change_trigger    trigger;
 	uint64_t                             req_id;
 	int64_t                              frame_id;
-	unsigned int                         evt_time_stamp;
+	struct timespec64                    evt_time_stamp;
 };
 
 /**