1 /* SPDX-License-Identifier: GPL-2.0 */ 2 3 #ifndef __ARM64_KVM_HYPEVENTS_DEFS_H 4 #define __ARM64_KVM_HYPEVENTS_DEFS_H 5 6 struct hyp_event_id { 7 unsigned short id; 8 void *data; 9 }; 10 11 #define HYP_EVENT_NAME_MAX 32 12 13 struct hyp_event { 14 char name[HYP_EVENT_NAME_MAX]; 15 bool *enabled; 16 char *print_fmt; 17 struct trace_event_fields *fields; 18 void (*trace_func)(struct ht_iterator *iter); 19 int id; 20 }; 21 22 struct hyp_entry_hdr { 23 unsigned short id; 24 }; 25 26 struct hyp_printk_fmt { 27 /* __MUST__ be the first element */ 28 const char fmt[127]; 29 const char null; 30 }; 31 32 /* 33 * Hyp events definitions common to the hyp and the host 34 */ 35 #define HYP_EVENT_FORMAT(__name, __struct) \ 36 struct __packed trace_hyp_format_##__name { \ 37 struct hyp_entry_hdr hdr; \ 38 __struct \ 39 } 40 41 #define HE_PROTO(args...) args 42 #define HE_STRUCT(args...) args 43 #define HE_ASSIGN(args...) args 44 #define HE_PRINTK(args...) args 45 #define HE_PRINTK_UNKNOWN_FMT(args...) args 46 47 #define he_field(type, item) type item; 48 #endif 49