1 | /* $Id: VMMTracing.h 40377 2012-03-06 15:00:44Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxVMM - Trace point macros for the VMM.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | #ifndef ___VMMTracing_h___
|
---|
20 | #define ___VMMTracing_h___
|
---|
21 |
|
---|
22 |
|
---|
23 | /*******************************************************************************
|
---|
24 | * Header Files *
|
---|
25 | *******************************************************************************/
|
---|
26 | #ifdef DOXYGEN_RUNNING
|
---|
27 | # undef VBOX_WITH_DTRACE
|
---|
28 | # undef VBOX_WITH_DTRACE_R3
|
---|
29 | # undef VBOX_WITH_DTRACE_R0
|
---|
30 | # undef VBOX_WITH_DTRACE_RC
|
---|
31 | # define DBGFTRACE_ENABLED
|
---|
32 | #endif
|
---|
33 | #include <VBox/vmm/dbgftrace.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | /*******************************************************************************
|
---|
37 | * Defined Constants And Macros *
|
---|
38 | *******************************************************************************/
|
---|
39 | /** Gets the trace buffer handle from a VMCPU pointer. */
|
---|
40 | #define VMCPU_TO_HTB(a_pVCpu) ((a_pVCpu)->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf))
|
---|
41 |
|
---|
42 | /** Gets the trace buffer handle from a VMCPU pointer. */
|
---|
43 | #define VM_TO_HTB(a_pVM) ((a_pVM)->CTX_SUFF(hTraceBuf))
|
---|
44 |
|
---|
45 |
|
---|
46 | /** @name Ring-3 trace points.
|
---|
47 | * @{
|
---|
48 | */
|
---|
49 | #ifdef IN_RING3
|
---|
50 | # ifdef VBOX_WITH_DTRACE_R3
|
---|
51 | # include "VBoxVMM-dtrace.h"
|
---|
52 |
|
---|
53 | # elif defined(DBGFTRACE_ENABLED)
|
---|
54 | # error
|
---|
55 | # define VBOXVMM_EM_STATE_CHANGED(a_pVCpu, a_enmOldState, a_enmNewState, a_rc) \
|
---|
56 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-state-changed %d -> %d (rc=%d)", a_enmOldState, a_enmNewState, a_rc)
|
---|
57 | # define VBOXVMM_EM_STATE_UNCHANGED(a_pVCpu, a_enmState, a_rc) \
|
---|
58 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-state-unchanged %d (rc=%d)", a_enmState, a_rc)
|
---|
59 | # define VBOXVMM_EM_RAW_RUN_PRE(a_pVCpu, a_pCtx) \
|
---|
60 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-raw-pre %04x:%08llx", (a_pCtx)->cs, (a_pCtx)->rip)
|
---|
61 | # define VBOXVMM_EM_RAW_RUN_RET(a_pVCpu, a_pCtx, a_rc) \
|
---|
62 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-raw-ret %04x:%08llx rc=%d", (a_pCtx)->cs, (a_pCtx)->rip, (a_rc))
|
---|
63 | # define VBOXVMM_EM_FF_HIGH(a_pVCpu, a_fGlobal, a_fLocal, a_rc) \
|
---|
64 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-ff-high vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc))
|
---|
65 | # define VBOXVMM_EM_FF_ALL(a_pVCpu, a_fGlobal, a_fLocal, a_rc) \
|
---|
66 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-ff-all vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc))
|
---|
67 | # define VBOXVMM_EM_FF_ALL_RET(a_pVCpu, a_rc) \
|
---|
68 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-ff-all-ret %d", (a_rc))
|
---|
69 | # define VBOXVMM_EM_FF_RAW(a_pVCpu, a_fGlobal, a_fLocal) \
|
---|
70 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-ff-raw vm=%#x cpu=%#x", (a_fGlobal), (a_fLocal))
|
---|
71 | # define VBOXVMM_EM_FF_RAW_RET(a_pVCpu, a_rc) \
|
---|
72 | RTTraceBufAddMsgF(VMCPU_TO_HTB(a_pVCpu), "em-ff-raw-ret %d", (a_rc))
|
---|
73 |
|
---|
74 | # else
|
---|
75 | # define VBOXVMM_EM_STATE_CHANGED(a_pVCpu, a_enmOldState, a_enmNewState, a_rc) do { } while (0)
|
---|
76 | # define VBOXVMM_EM_STATE_UNCHANGED(a_pVCpu, a_enmState, a_rc) do { } while (0)
|
---|
77 | # define VBOXVMM_EM_RAW_RUN_PRE(a_pVCpu, a_pCtx) do { } while (0)
|
---|
78 | # define VBOXVMM_EM_RAW_RUN_RET(a_pVCpu, a_pCtx, a_rc) do { } while (0)
|
---|
79 | # define VBOXVMM_EM_FF_HIGH(a_pVCpu, a_fGlobal, a_fLocal, a_rc) do { } while (0)
|
---|
80 | # define VBOXVMM_EM_FF_ALL(a_pVCpu, a_fGlobal, a_fLocal, a_rc) do { } while (0)
|
---|
81 | # define VBOXVMM_EM_FF_ALL_RET(a_pVCpu, a_rc) do { } while (0)
|
---|
82 | # define VBOXVMM_EM_FF_RAW(a_pVCpu, a_fGlobal, a_fLocal) do { } while (0)
|
---|
83 | # define VBOXVMM_EM_FF_RAW_RET(a_pVCpu, a_rc) do { } while (0)
|
---|
84 |
|
---|
85 | # endif
|
---|
86 | #endif /* IN_RING3 */
|
---|
87 |
|
---|
88 |
|
---|
89 | /** @name Ring-0 trace points.
|
---|
90 | * @{
|
---|
91 | */
|
---|
92 | #ifdef IN_RING0
|
---|
93 | # ifdef VBOX_WITH_DTRACE_R0
|
---|
94 | # include "VBoxVMMR0-dtrace.h"
|
---|
95 |
|
---|
96 | # elif defined(DBGFTRACE_ENABLED)
|
---|
97 |
|
---|
98 | # else
|
---|
99 |
|
---|
100 | # endif
|
---|
101 | #endif /* IN_RING0*/
|
---|
102 | /** @} */
|
---|
103 |
|
---|
104 |
|
---|
105 | /** @} */
|
---|
106 |
|
---|
107 | #endif
|
---|
108 |
|
---|