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

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

Merge "trace, scm: trace scm calls"

parents 1b85bcf0 b6b3a597
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@

#include <soc/qcom/scm.h>

#define CREATE_TRACE_POINTS
#include <trace/events/scm.h>

#define SCM_ENOMEM		-5
#define SCM_EOPNOTSUPP		-4
#define SCM_EINVAL_ADDR		-3
@@ -661,6 +664,8 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)
			x0, desc->arginfo, desc->args[0], desc->args[1],
			desc->args[2], desc->x5);

		trace_scm_call_start(x0, desc);

		if (scm_version == SCM_ARMV8_64)
			ret = __scm_call_armv8_64(x0, desc->arginfo,
						  desc->args[0], desc->args[1],
@@ -674,6 +679,8 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)
						  &desc->ret[0], &desc->ret[1],
						  &desc->ret[2]);

		trace_scm_call_end(desc);

		if (SCM_SVC_ID(fn_id) == SCM_SVC_LMH)
			mutex_unlock(&scm_lmh_lock);

+68 −0
Original line number Diff line number Diff line
/* Copyright (c) 2016, 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.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM scm

#if !defined(_TRACE_SCM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SCM_H
#include <linux/types.h>
#include <linux/tracepoint.h>
#include <soc/qcom/scm.h>

TRACE_EVENT(scm_call_start,

	TP_PROTO(u64 x0, struct scm_desc *p),

	TP_ARGS(x0, p),

	TP_STRUCT__entry(
		__field(u64, x0)
		__field(u32, arginfo)
		__array(u64, args, MAX_SCM_ARGS)
		__field(u64, x5)
	),

	TP_fast_assign(
		__entry->x0		= x0;
		__entry->arginfo	= p->arginfo;
		memcpy(__entry->args, p->args, MAX_SCM_ARGS);
		__entry->x5		= p->x5;
	),

	TP_printk("func id=%#llx (args: %#x, %#llx, %#llx, %#llx, %#llx)",
		__entry->x0, __entry->arginfo, __entry->args[0],
		__entry->args[1], __entry->args[2], __entry->x5)
);


TRACE_EVENT(scm_call_end,

	TP_PROTO(struct scm_desc *p),

	TP_ARGS(p),

	TP_STRUCT__entry(
		__array(u64, ret, MAX_SCM_RETS)
	),

	TP_fast_assign(
		memcpy(__entry->ret, p->ret, MAX_SCM_RETS);
	),

	TP_printk("ret: %#llx, %#llx, %#llx",
		__entry->ret[0], __entry->ret[1], __entry->ret[2])
);
#endif /* _TRACE_SCM_H */

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