blob: f3ada591ca2538006dfc907bbc6109f0da4cce89 [file] [log] [blame]
Sanjay Lal669e8462012-11-21 18:34:02 -08001/*
Deng-Cheng Zhud116e812014-06-26 12:11:34 -07002 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
7 * Authors: Sanjay Lal <sanjayl@kymasys.com>
8 */
Sanjay Lal669e8462012-11-21 18:34:02 -08009
10#if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
11#define _TRACE_KVM_H
12
13#include <linux/tracepoint.h>
14
15#undef TRACE_SYSTEM
16#define TRACE_SYSTEM kvm
17#define TRACE_INCLUDE_PATH .
18#define TRACE_INCLUDE_FILE trace
19
Deng-Cheng Zhud116e812014-06-26 12:11:34 -070020/* Tracepoints for VM eists */
Sanjay Lal669e8462012-11-21 18:34:02 -080021extern char *kvm_mips_exit_types_str[MAX_KVM_MIPS_EXIT_TYPES];
22
23TRACE_EVENT(kvm_exit,
24 TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
25 TP_ARGS(vcpu, reason),
26 TP_STRUCT__entry(
James Hoganb3cffac2015-02-24 11:46:20 +000027 __field(unsigned long, pc)
Sanjay Lal669e8462012-11-21 18:34:02 -080028 __field(unsigned int, reason)
29 ),
30
31 TP_fast_assign(
James Hoganb3cffac2015-02-24 11:46:20 +000032 __entry->pc = vcpu->arch.pc;
Sanjay Lal669e8462012-11-21 18:34:02 -080033 __entry->reason = reason;
34 ),
35
36 TP_printk("[%s]PC: 0x%08lx",
37 kvm_mips_exit_types_str[__entry->reason],
James Hoganb3cffac2015-02-24 11:46:20 +000038 __entry->pc)
Sanjay Lal669e8462012-11-21 18:34:02 -080039);
40
James Hogan04ebebf2016-06-14 09:40:11 +010041#define KVM_TRACE_AUX_RESTORE 0
42#define KVM_TRACE_AUX_SAVE 1
43#define KVM_TRACE_AUX_ENABLE 2
44#define KVM_TRACE_AUX_DISABLE 3
45#define KVM_TRACE_AUX_DISCARD 4
46
47#define KVM_TRACE_AUX_FPU 1
48#define KVM_TRACE_AUX_MSA 2
49#define KVM_TRACE_AUX_FPU_MSA 3
50
51#define kvm_trace_symbol_aux_op \
52 { KVM_TRACE_AUX_RESTORE, "restore" }, \
53 { KVM_TRACE_AUX_SAVE, "save" }, \
54 { KVM_TRACE_AUX_ENABLE, "enable" }, \
55 { KVM_TRACE_AUX_DISABLE, "disable" }, \
56 { KVM_TRACE_AUX_DISCARD, "discard" }
57
58#define kvm_trace_symbol_aux_state \
59 { KVM_TRACE_AUX_FPU, "FPU" }, \
60 { KVM_TRACE_AUX_MSA, "MSA" }, \
61 { KVM_TRACE_AUX_FPU_MSA, "FPU & MSA" }
62
63TRACE_EVENT(kvm_aux,
64 TP_PROTO(struct kvm_vcpu *vcpu, unsigned int op,
65 unsigned int state),
66 TP_ARGS(vcpu, op, state),
67 TP_STRUCT__entry(
68 __field(unsigned long, pc)
69 __field(u8, op)
70 __field(u8, state)
71 ),
72
73 TP_fast_assign(
74 __entry->pc = vcpu->arch.pc;
75 __entry->op = op;
76 __entry->state = state;
77 ),
78
79 TP_printk("%s %s PC: 0x%08lx",
80 __print_symbolic(__entry->op,
81 kvm_trace_symbol_aux_op),
82 __print_symbolic(__entry->state,
83 kvm_trace_symbol_aux_state),
84 __entry->pc)
85);
86
Sanjay Lal669e8462012-11-21 18:34:02 -080087#endif /* _TRACE_KVM_H */
88
89/* This part must be outside protection */
90#include <trace/define_trace.h>