Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * optee trace points
0004  *
0005  * Copyright (C) 2021 Synaptics Incorporated
0006  * Author: Jisheng Zhang <jszhang@kernel.org>
0007  */
0008 
0009 #undef TRACE_SYSTEM
0010 #define TRACE_SYSTEM optee
0011 
0012 #if !defined(_TRACE_OPTEE_H) || defined(TRACE_HEADER_MULTI_READ)
0013 #define _TRACE_OPTEE_H
0014 
0015 #include <linux/arm-smccc.h>
0016 #include <linux/tracepoint.h>
0017 #include "optee_private.h"
0018 
0019 TRACE_EVENT(optee_invoke_fn_begin,
0020     TP_PROTO(struct optee_rpc_param *param),
0021     TP_ARGS(param),
0022 
0023     TP_STRUCT__entry(
0024         __field(void *, param)
0025         __array(u32, args, 8)
0026     ),
0027 
0028     TP_fast_assign(
0029         __entry->param = param;
0030         BUILD_BUG_ON(sizeof(*param) < sizeof(__entry->args));
0031         memcpy(__entry->args, param, sizeof(__entry->args));
0032     ),
0033 
0034     TP_printk("param=%p (%x, %x, %x, %x, %x, %x, %x, %x)", __entry->param,
0035           __entry->args[0], __entry->args[1], __entry->args[2],
0036           __entry->args[3], __entry->args[4], __entry->args[5],
0037           __entry->args[6], __entry->args[7])
0038 );
0039 
0040 TRACE_EVENT(optee_invoke_fn_end,
0041     TP_PROTO(struct optee_rpc_param *param, struct arm_smccc_res *res),
0042     TP_ARGS(param, res),
0043 
0044     TP_STRUCT__entry(
0045         __field(void *, param)
0046         __array(unsigned long, rets, 4)
0047     ),
0048 
0049     TP_fast_assign(
0050         __entry->param = param;
0051         BUILD_BUG_ON(sizeof(*res) < sizeof(__entry->rets));
0052         memcpy(__entry->rets, res, sizeof(__entry->rets));
0053     ),
0054 
0055     TP_printk("param=%p ret (%lx, %lx, %lx, %lx)", __entry->param,
0056           __entry->rets[0], __entry->rets[1], __entry->rets[2],
0057           __entry->rets[3])
0058 );
0059 #endif /* _TRACE_OPTEE_H */
0060 
0061 #undef TRACE_INCLUDE_PATH
0062 #define TRACE_INCLUDE_PATH .
0063 #undef TRACE_INCLUDE_FILE
0064 #define TRACE_INCLUDE_FILE optee_trace
0065 
0066 /* This part must be outside protection */
0067 #include <trace/define_trace.h>