msm: camera: utils: Route camera logs to ftrace

Add debugfs setting to route camera logs : ERR,
WARN, INFO, DBG to ftrace.
Add CAM_TRACE macro for adding any new traces in drivers.

Usage:
CAM_TRACE : By default printed in ftrace
CAM_ERR, CAM_WARN, CAM_INFO, CAM_DBG : enable using
debugfs debug_type = 1 or 2
For CAM_DBG : In addition to above enable debug_mdl with
required mask.

adb shell "echo <value> > /sys/module/camera/parameters/debug_type"
All CAM_xx (except CAM_TRACE) logs are routed as below :
0 (default) - only logcat
1 - only ftrace
2 - both logcat and ftrace.

CRs-Fixed: 2762931
Change-Id: I5254a7fef346c7ba21a3ea1eed21e5353f42fd03
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This commit is contained in:
Pavan Kumar Chilamkurthi
2020-08-25 04:13:14 -07:00
父節點 80e8ff8cff
當前提交 ca73e251f0
共有 3 個文件被更改,包括 216 次插入61 次删除

查看文件

@@ -86,6 +86,21 @@ TRACE_EVENT(cam_log_event,
)
);
TRACE_EVENT(cam_log_debug,
TP_PROTO(const char *string1),
TP_ARGS(string1),
TP_STRUCT__entry(
__string(string1, string1)
),
TP_fast_assign(
__assign_str(string1, string1);
),
TP_printk(
"%s",
__get_str(string1)
)
);
TRACE_EVENT(cam_icp_fw_dbg,
TP_PROTO(char *dbg_message, uint64_t timestamp),
TP_ARGS(dbg_message, timestamp),