Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de3da028 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

msm: lmh_lite: Add ftrace events for LMH debug interface



Add ftrace events for LMH debug interface events like data
and config type read, debug data read and LMH configure
data.

Change-Id: Ie1e4e3fce9a933b6c6510fd93b67e7828ee0b510
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent d75ab72b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -932,6 +932,8 @@ static int lmh_debug_read(struct lmh_debug_ops *ops, uint32_t **buf)
		ret = tz_ret;
		goto get_dbg_exit;
	}
	trace_lmh_debug_data("Debug read", payload,
		curr_size / sizeof(uint32_t));

get_dbg_exit:
	if (ret && payload) {
@@ -957,6 +959,7 @@ static int lmh_debug_config_write(uint32_t cmd_id, uint32_t *buf, int size)
		uint32_t read_type;
	} cmd_buf;

	trace_lmh_debug_data("Config LMH", buf, size);
	size_bytes = (size - 3) * sizeof(uint32_t);
	payload = devm_kzalloc(lmh_data->dev, size_bytes, GFP_KERNEL);
	if (!payload) {
@@ -1016,9 +1019,15 @@ static int lmh_debug_get_types(struct lmh_debug_ops *ops, bool is_read,

	if (is_read && lmh_data->debug_info.read_type) {
		*buf = lmh_data->debug_info.read_type;
		trace_lmh_debug_data("Data type",
			lmh_data->debug_info.read_type,
			lmh_data->debug_info.read_type_count);
		return lmh_data->debug_info.read_type_count;
	} else if (!is_read && lmh_data->debug_info.config_type) {
		*buf = lmh_data->debug_info.config_type;
		trace_lmh_debug_data("Config type",
			lmh_data->debug_info.config_type,
			lmh_data->debug_info.config_type_count);
		return lmh_data->debug_info.config_type_count;
	}
	payload = devm_kzalloc(lmh_data->dev, sizeof(uint32_t) *
@@ -1043,9 +1052,11 @@ static int lmh_debug_get_types(struct lmh_debug_ops *ops, bool is_read,
	if (is_read) {
		lmh_data->debug_info.read_type = *buf = dest_buf;
		lmh_data->debug_info.read_type_count = size;
		trace_lmh_debug_data("Data type", dest_buf, size);
	} else {
		lmh_data->debug_info.config_type = *buf = dest_buf;
		lmh_data->debug_info.config_type_count = size;
		trace_lmh_debug_data("Config type", dest_buf, size);
	}

get_type_exit:
+27 −0
Original line number Diff line number Diff line
@@ -86,6 +86,33 @@ DEFINE_EVENT(msm_lmh_print_event, lmh_event_call,
	TP_ARGS(event_name)
);

TRACE_EVENT(lmh_debug_data,
	TP_PROTO(const char *pre_data, uint32_t *data_buf, uint32_t buffer_len),

	TP_ARGS(
		pre_data, data_buf, buffer_len
	),

	TP_STRUCT__entry(
		__string(_data, pre_data)
		__field(u32, _buffer_len)
		__dynamic_array(u32, _buffer, buffer_len)
	),

	TP_fast_assign(
		__assign_str(_data, pre_data);
		__entry->_buffer_len = buffer_len * sizeof(uint32_t);
		memcpy(__get_dynamic_array(_buffer), data_buf,
			buffer_len * sizeof(uint32_t));
	),

	TP_printk("%s:\t %s",
		__get_str(_data), __print_hex(__get_dynamic_array(_buffer),
			__entry->_buffer_len)
	)
);


#elif defined(TRACE_MSM_THERMAL)

DECLARE_EVENT_CLASS(msm_thermal_post_core_ctl,