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

Commit 59c5e352 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: msm_bus: Add means to dump all client requests to trace buffer"

parents dae2dc0e 5fe9c2e7
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -725,6 +725,47 @@ static const struct file_operations msm_bus_dbg_update_request_fops = {
	.write = msm_bus_dbg_update_request_write,
};

static int msm_bus_dbg_dump_clients_open(struct inode *inode, struct file *file)
{
	file->private_data = inode->i_private;
	return 0;
}

static ssize_t msm_bus_dbg_dump_clients_read(struct file *file,
	char __user *buf, size_t count, loff_t *ppos)
{
	int j, cnt;
	char msg[50];
	struct msm_bus_cldata *cldata = NULL;

	cnt = scnprintf(msg, 50,
		"\nDumping curent client votes to trace log\n");
	if (*ppos)
		goto exit_dump_clients_read;
	list_for_each_entry(cldata, &cl_list, list) {
		if (IS_ERR_OR_NULL(cldata->pdata))
			continue;
		for (j = 0; j < cldata->pdata->usecase->num_paths; j++) {
			if (cldata->index == -1)
				continue;
			trace_bus_client_status(
			cldata->pdata->name,
			cldata->pdata->usecase[cldata->index].vectors[j].src,
			cldata->pdata->usecase[cldata->index].vectors[j].dst,
			cldata->pdata->usecase[cldata->index].vectors[j].ab,
			cldata->pdata->usecase[cldata->index].vectors[j].ib,
			cldata->pdata->active_only);
		}
	}
exit_dump_clients_read:
	return simple_read_from_buffer(buf, count, ppos, msg, cnt);
}

static const struct file_operations msm_bus_dbg_dump_clients_fops = {
	.open		= msm_bus_dbg_dump_clients_open,
	.read		= msm_bus_dbg_dump_clients_read,
};

/**
 * msm_bus_dbg_client_data() - Add debug data for clients
 * @pdata: Platform data of the client
@@ -860,6 +901,10 @@ static int __init msm_bus_debugfs_init(void)
		}
	}

	if (debugfs_create_file("dump_clients", S_IRUGO | S_IWUSR,
		clients, NULL, &msm_bus_dbg_dump_clients_fops) == NULL)
		goto err;

	mutex_lock(&msm_bus_dbg_fablist_lock);
	list_for_each_entry(fablist, &fabdata_list, list) {
		fablist->file = debugfs_create_file(fablist->name, S_IRUGO,
+34 −0
Original line number Diff line number Diff line
@@ -170,6 +170,40 @@ TRACE_EVENT(bus_bke_params,
		__entry->gc, __entry->gp, __entry->thl, __entry->thm,
			__entry->thh)
);

TRACE_EVENT(bus_client_status,

	TP_PROTO(const char *name, int src, int dest,
		unsigned long long ab, unsigned long long ib, int active_only),

	TP_ARGS(name, src, dest, ab, ib, active_only),

	TP_STRUCT__entry(
		__string(name, name)
		__field(int, src)
		__field(int, dest)
		__field(u64, ab)
		__field(u64, ib)
		__field(int, active_only)
	),

	TP_fast_assign(
		__assign_str(name, name);
		__entry->src = src;
		__entry->dest = dest;
		__entry->ab = ab;
		__entry->ib = ib;
		__entry->active_only = active_only;
	),

	TP_printk("name=%s src=%d dest=%d ab=%llu ib=%llu active_only=%d",
		__get_str(name),
		__entry->src,
		__entry->dest,
		(unsigned long long)__entry->ab,
		(unsigned long long)__entry->ib,
		__entry->active_only)
);
#endif
#define TRACE_INCLUDE_FILE trace_msm_bus
#include <trace/define_trace.h>