1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (c) 2023 MediaTek Inc. 4 */ 5 6 #undef TRACE_SYSTEM 7 #define TRACE_SYSTEM geniezone 8 9 #define _TRACE_GENIEZONE_H 10 11 #include <linux/gzvm.h> 12 #include <linux/tracepoint.h> 13 14 #define GZVM_EXIT_REASONS \ 15 EM(UNKNOWN)\ 16 EM(MMIO)\ 17 EM(HYPERCALL)\ 18 EM(IRQ)\ 19 EM(EXCEPTION)\ 20 EM(DEBUG)\ 21 EM(FAIL_ENTRY)\ 22 EM(INTERNAL_ERROR)\ 23 EM(SYSTEM_EVENT)\ 24 EM(SHUTDOWN)\ 25 EMe(GZ) 26 27 #undef EM 28 #undef EMe 29 #define EM(a) TRACE_DEFINE_ENUM(GZVM_EXIT_##a); 30 #define EMe(a) TRACE_DEFINE_ENUM(GZVM_EXIT_##a); 31 32 GZVM_EXIT_REASONS 33 34 #undef EM 35 #undef EMe 36 37 #define EM(a) { GZVM_EXIT_##a, #a }, 38 #define EMe(a) { GZVM_EXIT_##a, #a } 39 40 TRACE_EVENT(mtk_hypcall_enter, 41 TP_PROTO(unsigned long id), 42 43 TP_ARGS(id), 44 45 TP_STRUCT__entry(__field(unsigned long, id)), 46 47 TP_fast_assign(__entry->id = id;), 48 49 TP_printk("id=0x%lx", __entry->id) 50 ); 51 52 TRACE_EVENT(mtk_hypcall_leave, 53 TP_PROTO(unsigned long id, unsigned long invalid), 54 55 TP_ARGS(id, invalid), 56 57 TP_STRUCT__entry(__field(unsigned long, id) 58 __field(unsigned long, invalid) 59 ), 60 61 TP_fast_assign(__entry->id = id; 62 __entry->invalid = invalid; 63 ), 64 65 TP_printk("id=0x%lx invalid=%lu", __entry->id, __entry->invalid) 66 ); 67 68 TRACE_EVENT(mtk_vcpu_exit, 69 TP_PROTO(unsigned long exit_reason), 70 71 TP_ARGS(exit_reason), 72 73 TP_STRUCT__entry(__field(unsigned long, exit_reason)), 74 75 TP_fast_assign(__entry->exit_reason = exit_reason;), 76 77 TP_printk("vcpu exit_reason=%s(0x%lx)", 78 __print_symbolic(__entry->exit_reason, GZVM_EXIT_REASONS), 79 __entry->exit_reason) 80 81 ); 82 83 /* This part must be outside protection */ 84 #include <trace/define_trace.h> 85