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

Commit 18a8e82b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ais: add ais_tracing_mark_write for systrace"

parents 764afd02 6b718e66
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -13,4 +13,26 @@

/* Instantiate tracepoints */
#define CREATE_TRACE_POINTS

#include <linux/io.h>
#include <linux/module.h>

#include "ais_isp_trace.h"

static uint debug_trace;
module_param(debug_trace, uint, 0644);

void ais_trace_print(char c, int value, const char *fmt, ...)
{
	if (debug_trace) {
		char str_buffer[256];
		va_list args;

		va_start(args, fmt);
		vsnprintf(str_buffer, 256, fmt, args);

		trace_ais_tracing_mark_write(c, current, str_buffer, value);
		va_end(args);
	}
}
+30 −0
Original line number Diff line number Diff line
@@ -223,6 +223,36 @@ TRACE_EVENT(ais_isp_vfe_error,
	)
);

TRACE_EVENT(ais_tracing_mark_write,
	TP_PROTO(char trace_type, const struct task_struct *task,
			 const char *name, int value),
	TP_ARGS(trace_type, task, name, value),
	TP_STRUCT__entry(
					__field(char, trace_type)
					__field(int, pid)
					__string(trace_name, name)
					__field(int, value)
	),
	TP_fast_assign(
					__entry->trace_type = trace_type;
					__entry->pid = task ? task->tgid : 0;
					__assign_str(trace_name, name);
					__entry->value = value;
	),
	TP_printk("%c|%d|%s|%d", __entry->trace_type,
			__entry->pid, __get_str(trace_name), __entry->value)
);

void ais_trace_print(char c, int value, const char *fmt, ...);

#define AIS_ATRACE_BEGIN(fmt, args...) ais_trace_print('B', 0, fmt, ##args)

#define AIS_ATRACE_END(fmt, args...) ais_trace_print('E', 0, fmt, ##args)

#define AIS_ATRACE_INT(value, fmt, args...) \
		ais_trace_print('C', value, fmt, ##args)


#endif /* _AIS_ISP_TRACE_H */

/* This part must be outside protection */
+14 −1
Original line number Diff line number Diff line
@@ -1083,7 +1083,11 @@ static int ais_vfe_handle_sof(
		if (p_rdi->state != AIS_ISP_RESOURCE_STATE_STREAMING)
			continue;

		AIS_ATRACE_BEGIN("SOF_%u_%u_%lu",
			core_info->vfe_idx, path, p_rdi->frame_cnt);
		ais_vfe_handle_sof_rdi(core_info, work_data, path);
		AIS_ATRACE_END("SOF_%u_%u_%lu",
			core_info->vfe_idx, path, p_rdi->frame_cnt);

		//enq buffers
		spin_lock_bh(&p_rdi->buffer_lock);
@@ -1344,8 +1348,12 @@ static int ais_vfe_bus_handle_frame_done(

		if (client_mask & (0x1 << client)) {
			//process frame done
			AIS_ATRACE_BEGIN("FD_%u_%u_%lu",
				core_info->vfe_idx, client, p_rdi->frame_cnt);
			ais_vfe_bus_handle_client_frame_done(core_info,
				client, work_data->last_addr[client]);
			AIS_ATRACE_END("FD_%u_%u_%lu",
				core_info->vfe_idx, client, p_rdi->frame_cnt);
		}
	}

@@ -1417,8 +1425,11 @@ static int ais_vfe_handle_bus_wr_irq(struct cam_hw_info *vfe_hw,
		work_data->bus_wr_status[1],
		work_data->bus_wr_status[2]);

	if (work_data->bus_wr_status[1])
	if (work_data->bus_wr_status[1]) {
		AIS_ATRACE_BEGIN("FD_%d", core_info->vfe_idx);
		ais_vfe_bus_handle_frame_done(core_info, work_data);
		AIS_ATRACE_END("FD_%d", core_info->vfe_idx);
	}

	if (work_data->bus_wr_status[0] & 0x7800) {
		CAM_ERR(CAM_ISP, "VFE%d: WR BUS error occurred status = 0x%x",
@@ -1467,7 +1478,9 @@ static int ais_vfe_process_irq_bh(void *priv, void *data)

	switch (work_data->evt_type) {
	case AIS_VFE_HW_IRQ_EVENT_SOF:
		AIS_ATRACE_BEGIN("SOF_%d", core_info->vfe_idx);
		rc = ais_vfe_handle_sof(core_info, work_data);
		AIS_ATRACE_END("SOF_%d", core_info->vfe_idx);
		break;
	case AIS_VFE_HW_IRQ_EVENT_BUS_WR:
		rc = ais_vfe_handle_bus_wr_irq(vfe_hw, core_info, work_data);
+2 −1
Original line number Diff line number Diff line
@@ -197,11 +197,12 @@ int ais_vfe_deinit_soc_resources(struct cam_hw_soc_info *soc_info)
	if (rc)
		CAM_ERR(CAM_ISP, "CPAS0 unregistration failed rc=%d", rc);

	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120) {
		rc = cam_cpas_unregister_client(soc_private->cpas_handle[1]);
		if (rc)
			CAM_ERR(CAM_ISP, "CPAS1 unregistration failed rc=%d",
				rc);
	}

	rc = ais_vfe_release_platform_resource(soc_info);
	if (rc < 0)