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

Commit 757a1fd6 authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: msm_bus: Add trace events to ad-hoc bus driver



Add trace events to the ad-hoc bus driver to assist in
client agg vote, clocks, QOS debugging and rules applied.

Change-Id: I46ae10bd550117dea2f3c2934e8335c8c0b0e1bd
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent 7558a649
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -497,6 +497,7 @@ static int msm_bus_apply_rules(struct list_head *list, bool after_clk_commit)
							rule->lim_bw);
		if (ret)
			MSM_BUS_ERR("Failed to set limiter for %d", rule->id);
		trace_bus_rules_apply(rule->id, rule->lim_bw, throttle_en);
	}

	return ret;
+4 −2
Original line number Diff line number Diff line
@@ -395,7 +395,8 @@ int msm_bus_dbg_rec_transaction(const struct msm_bus_client_handle *pdata,
	cldata->size = i;

	trace_bus_update_request((int)ts.tv_sec, (int)ts.tv_nsec,
		pdata->name, pdata->mas, pdata->slv, ab, ib);
		pdata->name, pdata->mas, pdata->slv, ab, ib,
		pdata->active_only);

	return i;
}
@@ -511,7 +512,8 @@ static int msm_bus_dbg_fill_cl_buffer(const struct msm_bus_scale_pdata *pdata,
		pdata->usecase[index].vectors[j].src,
		pdata->usecase[index].vectors[j].dst,
		pdata->usecase[index].vectors[j].ab,
		pdata->usecase[index].vectors[j].ib);
		pdata->usecase[index].vectors[j].ib,
		pdata->active_only);

	cldata->index = index;
	cldata->size = i;
+8 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <soc/qcom/rpm-smd.h>
#include <trace/events/trace_msm_bus.h>
#include "msm_bus_core.h"
#include "msm_bus_adhoc.h"
#include "msm_bus_noc.h"
@@ -198,6 +199,9 @@ static int send_rpm_msg(struct device *device)
					 ndev->node_info->mas_rpm_id);
				goto exit_send_rpm_msg;
			}
			trace_bus_agg_bw(ndev->node_info->id,
				ndev->node_info->mas_rpm_id, ctx,
				ndev->node_ab.ab[ctx]);
		}

		if (ndev->node_info->slv_rpm_id != -1) {
@@ -212,6 +216,9 @@ static int send_rpm_msg(struct device *device)
					ndev->node_info->slv_rpm_id);
				goto exit_send_rpm_msg;
			}
			trace_bus_agg_bw(ndev->node_info->id,
				ndev->node_info->slv_rpm_id, ctx,
				ndev->node_ab.ab[ctx]);
		}
	}
exit_send_rpm_msg:
@@ -308,6 +315,7 @@ static int flush_clk_data(struct device *node_device, int ctx)
			ret = -ENODEV;
			goto exit_flush_clk_data;
		}
		trace_bus_agg_clk(node->node_info->id, ctx, nodeclk->rate);
		MSM_BUS_DBG("%s: Updated %d clk to %llu", __func__,
				node->node_info->id, nodeclk->rate);

+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/msm-bus-board.h>
#include <trace/events/trace_msm_bus.h>
#include "msm_bus_core.h"
#include "msm_bus_noc.h"
#include "msm_bus_adhoc.h"
@@ -196,6 +197,8 @@ static void noc_set_qos_mode(void __iomem *base, uint32_t qos_off,
		uint32_t mport, uint32_t qos_delta, uint8_t mode,
		uint8_t perm_mode)
{
	trace_bus_noc_set_qos_mode((long)base, qos_off, mport, qos_delta, mode,
			perm_mode);
	if (mode < NOC_QOS_MODE_MAX &&
		((1 << mode) & perm_mode)) {
		uint32_t reg_val;
+122 −9
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@
TRACE_EVENT(bus_update_request,

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

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

	TP_STRUCT__entry(
		__field(int, sec)
@@ -33,6 +33,7 @@ TRACE_EVENT(bus_update_request,
		__field(int, dest)
		__field(u64, ab)
		__field(u64, ib)
		__field(int, active_only)
	),

	TP_fast_assign(
@@ -43,16 +44,18 @@ TRACE_EVENT(bus_update_request,
		__entry->dest = dest;
		__entry->ab = ab;
		__entry->ib = ib;
		__entry->active_only = active_only;
	),

	TP_printk("time= %d.%d name=%s src=%d dest=%d ab=%llu ib=%llu",
	TP_printk("time:%d.%d name:%s src:%d dest:%d ab:%llu ib:%llu active:%d",
		__entry->sec,
		__entry->nsec,
		__get_str(name),
		__entry->src,
		__entry->dest,
		(unsigned long long)__entry->ab,
		(unsigned long long)__entry->ib)
		(unsigned long long)__entry->ib,
		__entry->active_only)
);

TRACE_EVENT(bus_update_request_end,
@@ -69,7 +72,7 @@ TRACE_EVENT(bus_update_request_end,
		__assign_str(name, name);
	),

	TP_printk("client-name=%s", __get_str(name))
	TP_printk("client-name:%s", __get_str(name))
);

TRACE_EVENT(bus_bimc_config_limiter,
@@ -88,7 +91,7 @@ TRACE_EVENT(bus_bimc_config_limiter,
		__entry->cur_lim_bw = cur_lim_bw;
	),

	TP_printk("Master=%d cur_lim_bw=%llu",
	TP_printk("Master:%d cur_lim_bw:%llu",
		__entry->mas_id,
		(unsigned long long)__entry->cur_lim_bw)
);
@@ -109,7 +112,7 @@ TRACE_EVENT(bus_avail_bw,
		__entry->cur_mdp_bw = cur_mdp_bw;
	),

	TP_printk("cur_bimc_bw = %llu cur_mdp_bw = %llu",
	TP_printk("cur_bimc_bw:%llu cur_mdp_bw:%llu",
		(unsigned long long)__entry->cur_bimc_bw,
		(unsigned long long)__entry->cur_mdp_bw)
);
@@ -137,7 +140,7 @@ TRACE_EVENT(bus_rules_matches,
		__entry->node_clk = node_clk;
	),

	TP_printk("Rule match node%d rule%d node-ab%llu:ib%llu:clk%llu",
	TP_printk("node:%d rule:%d node-ab:%llu ib:%llu clk:%llu",
		__entry->node_id, __entry->rule_id,
		(unsigned long long)__entry->node_ab,
		(unsigned long long)__entry->node_ib,
@@ -166,11 +169,121 @@ TRACE_EVENT(bus_bke_params,
		__entry->thh = thh;
	),

	TP_printk("BKE Params GC=0x%x GP=0x%x THL=0x%x THM=0x%x THH=0x%x",
	TP_printk("GC:0x%x GP:0x%x THL:0x%x THM:0x%x THH:0x%x",
		__entry->gc, __entry->gp, __entry->thl, __entry->thm,
			__entry->thh)
);

TRACE_EVENT(bus_noc_set_qos_mode,
	TP_PROTO(long base, uint32_t qos_off,
		uint32_t mport, uint32_t qos_delta, uint8_t mode,
		uint8_t perm_mode),

	TP_ARGS(base, qos_off, mport, qos_delta, mode, perm_mode),

	TP_STRUCT__entry(
		__field(long, base)
		__field(uint32_t, qos_off)
		__field(uint32_t, mport)
		__field(uint32_t, qos_delta)
		__field(uint8_t, mode)
		__field(uint8_t, perm_mode)
	),

	TP_fast_assign(
		__entry->base = base;
		__entry->qos_off = qos_off;
		__entry->mport = mport;
		__entry->qos_delta = qos_delta;
		__entry->mode = mode;
		__entry->perm_mode = perm_mode;
	),

	TP_printk("base:%ld q_off:%d mport:%d q_delta:%d mode:%d perm_mode:%d",
		__entry->base,
		__entry->qos_off,
		__entry->mport,
		__entry->qos_delta,
		(uint32_t)__entry->mode,
		(uint32_t)__entry->perm_mode)
);

TRACE_EVENT(bus_agg_bw,

	TP_PROTO(unsigned int node_id, int rpm_id, int ctx_set,
		unsigned long long agg_ab),

	TP_ARGS(node_id, rpm_id, ctx_set, agg_ab),

	TP_STRUCT__entry(
		__field(unsigned int, node_id)
		__field(int, rpm_id)
		__field(int, ctx_set)
		__field(u64, agg_ab)
	),

	TP_fast_assign(
		__entry->node_id = node_id;
		__entry->rpm_id = rpm_id;
		__entry->ctx_set = ctx_set;
		__entry->agg_ab = agg_ab;
	),

	TP_printk("node_id:%u rpm_id:%d ctx:%d agg_ab:%llu",
		__entry->node_id,
		__entry->rpm_id,
		__entry->ctx_set,
		(unsigned long long)__entry->agg_ab)
);

TRACE_EVENT(bus_agg_clk,

	TP_PROTO(unsigned int node_id, int ctx_set,
		unsigned long long agg_clk),

	TP_ARGS(node_id, ctx_set, agg_clk),

	TP_STRUCT__entry(
		__field(unsigned int, node_id)
		__field(int, ctx_set)
		__field(u64, agg_clk)
	),

	TP_fast_assign(
		__entry->node_id = node_id;
		__entry->ctx_set = ctx_set;
		__entry->agg_clk = agg_clk;
	),

	TP_printk("node_id:%u ctx:%d agg_clk:%llu",
		__entry->node_id,
		__entry->ctx_set,
		(unsigned long long)__entry->agg_clk)
);

TRACE_EVENT(bus_rules_apply,

	TP_PROTO(int rule_id, unsigned long long limit_bw, bool throttle_en),

	TP_ARGS(rule_id, limit_bw, throttle_en),

	TP_STRUCT__entry(
		__field(int, rule_id)
		__field(u64, limit_bw)
		__field(bool, throttle_en)
	),

	TP_fast_assign(
		__entry->rule_id = rule_id;
		__entry->limit_bw = limit_bw;
		__entry->throttle_en = throttle_en;
	),

	TP_printk("rule:%d limit_bw:%llu throttle_enable:%d",
		__entry->rule_id,
		(unsigned long long)__entry->limit_bw,
		__entry->throttle_en)
);
#endif
#define TRACE_INCLUDE_FILE trace_msm_bus
#include <trace/define_trace.h>