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

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

Merge "msm: clk: qcom: add traces to DSI pll"

parents 156f0dc0 3e8b5fe2
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -20,6 +20,8 @@
#include "mdss-dsi-pll.h"
#include "mdss-pll.h"
#include <dt-bindings/clock/mdss-10nm-pll-clk.h>
#define CREATE_TRACE_POINTS
#include "mdss_pll_trace.h"

#define VCO_DELAY_USEC 1

@@ -890,8 +892,13 @@ static int vco_10nm_prepare(struct clk_hw *hw)
		MDSS_PLL_REG_W(pll->pll_base, PLL_PLL_OUTDIV_RATE,
					pll->cached_outdiv);
	}

	MDSS_PLL_ATRACE_BEGIN("pll_lock");
	trace_mdss_pll_lock_start((u64)pll->vco_cached_rate,
			pll->vco_current_rate,
			pll->cached_cfg0, pll->cached_cfg1,
			pll->cached_outdiv, pll->resource_ref_cnt);
	rc = dsi_pll_enable(vco);
	MDSS_PLL_ATRACE_END("pll_lock");
	if (rc) {
		mdss_pll_resource_enable(pll, false);
		pr_err("pll(%d) enable failed, rc=%d\n", pll->index, rc);
+116 −0
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#if !defined(_MDSS_PLL_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _MDSS_PLL_TRACE_H_

#include <linux/stringify.h>
#include <linux/types.h>
#include <linux/tracepoint.h>

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mdss_pll
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE mdss_pll_trace


TRACE_EVENT(mdss_pll_lock_start,
	TP_PROTO(
			u64 vco_cached_rate,
			s64 vco_current_rate,
			u32 cached_cfg0,
			u32 cached_cfg1,
			u32 cached_outdiv,
			u32 resource_ref_cnt),
	TP_ARGS(
			vco_cached_rate,
			vco_current_rate,
			cached_cfg0,
			cached_cfg1,
			cached_outdiv,
			resource_ref_cnt),
	TP_STRUCT__entry(
			__field(u64, vco_cached_rate)
			__field(s64, vco_current_rate)
			__field(u32, cached_cfg0)
			__field(u32, cached_cfg1)
			__field(u32, cached_outdiv)
			__field(u32, resource_ref_cnt)

	),
	TP_fast_assign(
			__entry->vco_cached_rate = vco_cached_rate;
			__entry->vco_current_rate = vco_current_rate;
			__entry->cached_cfg0 = cached_cfg0;
			__entry->cached_cfg1 = cached_cfg1;
			__entry->cached_outdiv = cached_outdiv;
			__entry->resource_ref_cnt = resource_ref_cnt;
	),
	 TP_printk(
		"vco_cached_rate=%llu vco_current_rate=%lld cached_cfg0=%d cached_cfg1=%d cached_outdiv=%d resource_ref_cnt=%d",
			__entry->vco_cached_rate,
			__entry->vco_current_rate,
			__entry->cached_cfg0,
			__entry->cached_cfg1,
			__entry->cached_outdiv,
			__entry->resource_ref_cnt)
);

TRACE_EVENT(pll_tracing_mark_write,
	TP_PROTO(int pid, const char *name, bool trace_begin),
	TP_ARGS(pid, name, trace_begin),
	TP_STRUCT__entry(
			__field(int, pid)
			__string(trace_name, name)
			__field(bool, trace_begin)
	),
	TP_fast_assign(
			__entry->pid = pid;
			__assign_str(trace_name, name);
			__entry->trace_begin = trace_begin;
	),
	TP_printk("%s|%d|%s", __entry->trace_begin ? "B" : "E",
		__entry->pid, __get_str(trace_name))
)

TRACE_EVENT(mdss_pll_trace_counter,
	TP_PROTO(int pid, char *name, int value),
	TP_ARGS(pid, name, value),
	TP_STRUCT__entry(
			__field(int, pid)
			__string(counter_name, name)
			__field(int, value)
	),
	TP_fast_assign(
			__entry->pid = current->tgid;
			__assign_str(counter_name, name);
			__entry->value = value;
	),
	TP_printk("%d|%s|%d", __entry->pid,
			__get_str(counter_name), __entry->value)
)

#define MDSS_PLL_ATRACE_END(name) trace_pll_tracing_mark_write(current->tgid,\
		name, 0)
#define MDSS_PLL_ATRACE_BEGIN(name) trace_pll_tracing_mark_write(current->tgid,\
		name, 1)
#define MDSS_PLL_ATRACE_FUNC() MDSS_PLL_ATRACE_BEGIN(__func__)
#define MDSS_PLL_ATRACE_INT(name, value) \
	trace_mdss_pll_trace_counter(current->tgid, name, value)


#endif /* _MDSS_PLL_TRACE_H_ */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#include <trace/define_trace.h>