msm: mdss: add systrace begin/end trace events
Adding trace points for systrace at various points in the driver. Change-Id: I4783fd2982bddb7f111de9e064bcaff153eb1ce1 Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org> Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
This commit is contained in:
parent
52b32260ac
commit
3b634e9974
5 changed files with 83 additions and 6 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
#include "mdss.h"
|
||||
#include "mdss_mdp_trace.h"
|
||||
|
||||
#define MISR_POLL_SLEEP 2000
|
||||
#define MISR_POLL_TIMEOUT 32000
|
||||
|
@ -30,6 +31,13 @@
|
|||
#define MDSS_XLOG_TOUT_HANDLER(...) \
|
||||
mdss_xlog_tout_handler(__func__, ##__VA_ARGS__, XLOG_TOUT_DATA_LIMITER)
|
||||
|
||||
#define ATRACE_END(name) trace_tracing_mark_write(current->tgid, name, 0)
|
||||
#define ATRACE_BEGIN(name) trace_tracing_mark_write(current->tgid, name, 1)
|
||||
#define ATRACE_FUNC() ATRACE_BEGIN(__func__)
|
||||
|
||||
#define ATRACE_INT(name, value) \
|
||||
trace_mdp_trace_counter(current->tgid, name, value)
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
struct mdss_debug_base {
|
||||
struct mdss_debug_data *mdd;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "mdss_mdp.h"
|
||||
#include "mdss_debug.h"
|
||||
#include "mdss_mdp_trace.h"
|
||||
#include "mdss_debug.h"
|
||||
|
||||
static void mdss_mdp_xlog_mixer_reg(struct mdss_mdp_ctl *ctl);
|
||||
static inline u64 fudge_factor(u64 val, u32 numer, u32 denom)
|
||||
|
@ -925,7 +926,7 @@ static inline void mdss_mdp_ctl_perf_update_bus(struct mdss_mdp_ctl *ctl)
|
|||
|
||||
if (!ctl || !ctl->mdata)
|
||||
return;
|
||||
|
||||
ATRACE_BEGIN(__func__);
|
||||
mdata = ctl->mdata;
|
||||
for (i = 0; i < mdata->nctl; i++) {
|
||||
struct mdss_mdp_ctl *ctl;
|
||||
|
@ -940,8 +941,10 @@ static inline void mdss_mdp_ctl_perf_update_bus(struct mdss_mdp_ctl *ctl)
|
|||
bus_ab_quota = apply_fudge_factor(bus_ib_quota,
|
||||
&mdss_res->ab_factor);
|
||||
trace_mdp_perf_update_bus(bus_ab_quota, bus_ib_quota);
|
||||
ATRACE_INT("bus_quota", bus_ib_quota);
|
||||
mdss_mdp_bus_scale_set_quota(bus_ab_quota, bus_ib_quota);
|
||||
pr_debug("ab=%llu ib=%llu\n", bus_ab_quota, bus_ib_quota);
|
||||
ATRACE_END(__func__);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1024,7 +1027,7 @@ static void mdss_mdp_ctl_perf_update(struct mdss_mdp_ctl *ctl,
|
|||
|
||||
if (!ctl || !ctl->mdata)
|
||||
return;
|
||||
|
||||
ATRACE_BEGIN(__func__);
|
||||
mutex_lock(&mdss_mdp_ctl_lock);
|
||||
|
||||
mdata = ctl->mdata;
|
||||
|
@ -1083,11 +1086,13 @@ static void mdss_mdp_ctl_perf_update(struct mdss_mdp_ctl *ctl,
|
|||
}
|
||||
|
||||
clk_rate = mdss_mdp_select_clk_lvl(ctl, clk_rate);
|
||||
ATRACE_INT("mdp_clk", clk_rate);
|
||||
mdss_mdp_set_clk_rate(clk_rate);
|
||||
pr_debug("update clk rate = %d HZ\n", clk_rate);
|
||||
}
|
||||
|
||||
mutex_unlock(&mdss_mdp_ctl_lock);
|
||||
ATRACE_END(__func__);
|
||||
}
|
||||
|
||||
static struct mdss_mdp_ctl *mdss_mdp_ctl_alloc(struct mdss_data_type *mdata,
|
||||
|
@ -2665,8 +2670,10 @@ int mdss_mdp_display_wait4comp(struct mdss_mdp_ctl *ctl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ATRACE_BEGIN("wait_fnc");
|
||||
if (ctl->wait_fnc)
|
||||
ret = ctl->wait_fnc(ctl, NULL);
|
||||
ATRACE_END("wait_fnc");
|
||||
|
||||
trace_mdp_commit(ctl);
|
||||
|
||||
|
@ -2745,13 +2752,16 @@ int mdss_mdp_display_commit(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
if (is_bw_released || ctl->force_screen_state ||
|
||||
(ctl->mixer_left && ctl->mixer_left->params_changed) ||
|
||||
(ctl->mixer_right && ctl->mixer_right->params_changed)) {
|
||||
ATRACE_BEGIN("prepare_fnc");
|
||||
if (ctl->prepare_fnc)
|
||||
ret = ctl->prepare_fnc(ctl, arg);
|
||||
ATRACE_END("prepare_fnc");
|
||||
if (ret) {
|
||||
pr_err("error preparing display\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
ATRACE_BEGIN("mixer_programming");
|
||||
mdss_mdp_ctl_perf_update(ctl, 1);
|
||||
|
||||
mdss_mdp_mixer_setup(ctl, MDSS_MDP_MIXER_MUX_LEFT);
|
||||
|
@ -2765,17 +2775,23 @@ int mdss_mdp_display_commit(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
sctl->opmode);
|
||||
sctl->flush_bits |= BIT(17);
|
||||
}
|
||||
ATRACE_END("mixer_programming");
|
||||
}
|
||||
|
||||
ATRACE_BEGIN("frame_ready");
|
||||
if (!ctl->shared_lock)
|
||||
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_READY);
|
||||
ATRACE_END("frame_ready");
|
||||
|
||||
ATRACE_BEGIN("wait_pingpong");
|
||||
if (ctl->wait_pingpong)
|
||||
ctl->wait_pingpong(ctl, NULL);
|
||||
ATRACE_END("wait_pingpong");
|
||||
|
||||
ctl->roi_bkup.w = ctl->roi.w;
|
||||
ctl->roi_bkup.h = ctl->roi.h;
|
||||
|
||||
ATRACE_BEGIN("postproc_programming");
|
||||
if (ctl->mfd && ctl->mfd->dcm_state != DTM_ENTER)
|
||||
/* postprocessing setup, including dspp */
|
||||
mdss_mdp_pp_setup_locked(ctl);
|
||||
|
@ -2784,7 +2800,9 @@ int mdss_mdp_display_commit(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
ctl->flush_bits |= sctl->flush_bits;
|
||||
sctl->flush_bits = 0;
|
||||
}
|
||||
ATRACE_END("postproc_programming");
|
||||
|
||||
ATRACE_BEGIN("flush_kickoff");
|
||||
mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, ctl->flush_bits);
|
||||
if (sctl && sctl->flush_bits) {
|
||||
mdss_mdp_ctl_write(sctl, MDSS_MDP_REG_CTL_FLUSH,
|
||||
|
@ -2803,6 +2821,7 @@ int mdss_mdp_display_commit(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
pr_warn("error displaying frame\n");
|
||||
|
||||
ctl->play_cnt++;
|
||||
ATRACE_END("flush_kickoff");
|
||||
|
||||
done:
|
||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
|
||||
|
|
|
@ -1283,7 +1283,9 @@ static void __overlay_kickoff_requeue(struct msm_fb_data_type *mfd)
|
|||
mdss_mdp_display_commit(ctl, NULL);
|
||||
mdss_mdp_display_wait4comp(ctl);
|
||||
|
||||
ATRACE_BEGIN("sspp_programming");
|
||||
__overlay_queue_pipes(mfd);
|
||||
ATRACE_END("sspp_programming");
|
||||
|
||||
mdss_mdp_display_commit(ctl, NULL);
|
||||
mdss_mdp_display_wait4comp(ctl);
|
||||
|
@ -1298,6 +1300,7 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
|
|||
int ret = 0;
|
||||
int sd_in_pipe = 0;
|
||||
|
||||
ATRACE_BEGIN(__func__);
|
||||
if (ctl->shared_lock) {
|
||||
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_BEGIN);
|
||||
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_READY);
|
||||
|
@ -1344,13 +1347,20 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
|
|||
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_right);
|
||||
}
|
||||
|
||||
ATRACE_BEGIN("sspp_programming");
|
||||
ret = __overlay_queue_pipes(mfd);
|
||||
ATRACE_END("sspp_programming");
|
||||
mutex_unlock(&mdp5_data->list_lock);
|
||||
|
||||
if (mfd->panel.type == WRITEBACK_PANEL)
|
||||
if (mfd->panel.type == WRITEBACK_PANEL) {
|
||||
ATRACE_BEGIN("wb_kickoff");
|
||||
ret = mdss_mdp_wb_kickoff(mfd);
|
||||
else
|
||||
ATRACE_END("wb_kickoff");
|
||||
} else {
|
||||
ATRACE_BEGIN("display_commit");
|
||||
ret = mdss_mdp_display_commit(mdp5_data->ctl, NULL);
|
||||
ATRACE_END("display_commit");
|
||||
}
|
||||
|
||||
atomic_set(&mfd->kickoff_pending, 0);
|
||||
wake_up_all(&mfd->kickoff_wait_q);
|
||||
|
@ -1361,7 +1371,9 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
|
|||
mutex_unlock(&mdp5_data->ov_lock);
|
||||
mdss_mdp_overlay_update_pm(mdp5_data);
|
||||
|
||||
ATRACE_BEGIN("display_wait4comp");
|
||||
ret = mdss_mdp_display_wait4comp(mdp5_data->ctl);
|
||||
ATRACE_END("display_wait4comp");
|
||||
mutex_lock(&mdp5_data->ov_lock);
|
||||
|
||||
if (ret == 0) {
|
||||
|
@ -1374,14 +1386,16 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
|
|||
|
||||
mdss_fb_update_notify_update(mfd);
|
||||
commit_fail:
|
||||
ATRACE_BEGIN("overlay_cleanup");
|
||||
mdss_mdp_overlay_cleanup(mfd);
|
||||
ATRACE_END("overlay_cleanup");
|
||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
|
||||
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_FLUSHED);
|
||||
|
||||
mutex_unlock(&mdp5_data->ov_lock);
|
||||
if (ctl->shared_lock)
|
||||
mutex_unlock(ctl->shared_lock);
|
||||
|
||||
ATRACE_END(__func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "mdss_mdp.h"
|
||||
#include "mdss_mdp_rotator.h"
|
||||
#include "mdss_fb.h"
|
||||
#include "mdss_debug.h"
|
||||
|
||||
#define MAX_ROTATOR_SESSIONS 8
|
||||
|
||||
|
@ -283,8 +284,9 @@ static int mdss_mdp_rotator_queue_sub(struct mdss_mdp_rotator_session *rot,
|
|||
pr_err("unable to queue rot data\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
ATRACE_BEGIN("rotator_kickoff");
|
||||
ret = mdss_mdp_rotator_kickoff(rot_ctl, rot, dst_data);
|
||||
ATRACE_END("rotator_kickoff");
|
||||
|
||||
return ret;
|
||||
error:
|
||||
|
|
|
@ -215,6 +215,40 @@ TRACE_EVENT(mdp_cmd_wait_pingpong,
|
|||
__entry->kickoff_cnt)
|
||||
);
|
||||
|
||||
TRACE_EVENT(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(mdp_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)
|
||||
);
|
||||
|
||||
#endif /* if !defined(TRACE_MDSS_MDP_H) || defined(TRACE_HEADER_MULTI_READ) */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
|
Loading…
Add table
Reference in a new issue