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

Commit e18cd565 authored by Jonathan Wicks's avatar Jonathan Wicks
Browse files

msm: kgsl: Add a trace event for the GPU clock



If requested, trace the GPU time to ensure
a useful mapping regardless of the chosen
trace clock.

Change-Id: I76a893975de9a278c8178f935991191354f29e2f
Signed-off-by: default avatarJonathan Wicks <jwicks@codeaurora.org>
parent 03f28c16
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "adreno_iommu.h"
#include "adreno_pm4types.h"
#include "adreno_ringbuffer.h"
#include "adreno_trace.h"

#include "a3xx_reg.h"
#include "adreno_a5xx.h"
@@ -58,6 +59,7 @@ static void _cff_write_ringbuffer(struct adreno_ringbuffer *rb)
}

static void adreno_get_submit_time(struct adreno_device *adreno_dev,
		struct adreno_ringbuffer *rb,
		struct adreno_submit_time *time)
{
	unsigned long flags;
@@ -87,6 +89,9 @@ static void adreno_get_submit_time(struct adreno_device *adreno_dev,
	} else
		time->ticks = 0;

	/* Trace the GPU time to create a mapping to ftrace time */
	trace_adreno_cmdbatch_sync(rb->drawctxt_active, time->ticks);

	/* Get the kernel clock for time since boot */
	time->ktime = local_clock();

@@ -128,7 +133,7 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb,
	_cff_write_ringbuffer(rb);

	if (time != NULL)
		adreno_get_submit_time(adreno_dev, time);
		adreno_get_submit_time(adreno_dev, rb, time);

	adreno_ringbuffer_wptr(adreno_dev, rb);
}
+24 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 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
@@ -148,6 +148,29 @@ TRACE_EVENT(adreno_cmdbatch_retired,
	)
);

TRACE_EVENT(adreno_cmdbatch_sync,
	TP_PROTO(struct adreno_context *drawctxt,
		uint64_t ticks),
	TP_ARGS(drawctxt, ticks),
	TP_STRUCT__entry(
		__field(unsigned int, id)
		__field(unsigned int, timestamp)
		__field(uint64_t, ticks)
		__field(int, prio)
	),
	TP_fast_assign(
		__entry->id = drawctxt->base.id;
		__entry->timestamp = drawctxt->timestamp;
		__entry->ticks = ticks;
		__entry->prio = drawctxt->base.priority;
	),
	TP_printk(
		"ctx=%u ctx_prio=%d ts=%u ticks=%lld",
			__entry->id, __entry->prio, __entry->timestamp,
			__entry->ticks
	)
);

TRACE_EVENT(adreno_cmdbatch_fault,
	TP_PROTO(struct kgsl_drawobj_cmd *cmdobj, unsigned int fault),
	TP_ARGS(cmdobj, fault),