VMMTracing.h revision 2b01734ae56c7cdf9be61267c3cdb46344637bfa
/* $Id$ */
/** @file
* VBoxVMM - Trace point macros for the VMM.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___VMMTracing_h___
#define ___VMMTracing_h___
/*******************************************************************************
* Header Files *
*******************************************************************************/
#ifdef DOXYGEN_RUNNING
# define DBGFTRACE_ENABLED
#endif
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** Gets the trace buffer handle from a VMCPU pointer. */
/** Gets the trace buffer handle from a VMCPU pointer. */
/** Macro wrapper for trace points that are disabled by default. */
do { \
{ \
a_TraceStmt; \
} \
} while (0)
/** @name Ring-3 trace points.
* @{
*/
#ifdef IN_RING3
# ifdef VBOX_WITH_DTRACE_R3
# include "VBoxVMM-dtrace.h"
# elif defined(DBGFTRACE_ENABLED)
TP_COND_VMCPU(a_pVCpu, RTTraceBufAddMsgF(hTB, "em-state-changed %d -> %d (rc=%d)", a_enmOldState, a_enmNewState, a_rc))
TP_COND_VMCPU(a_pVCpu, RTTraceBufAddMsgF(hTB, "em-raw-pre %04x:%08llx", (a_pCtx)->cs, (a_pCtx)->rip))
TP_COND_VMCPU(a_pVCpu, RTTraceBufAddMsgF(hTB, "em-raw-ret %04x:%08llx rc=%d", (a_pCtx)->cs, (a_pCtx)->rip, (a_rc)))
TP_COND_VMCPU(a_pVCpu, RTTraceBufAddMsgF(hTB, "em-ff-high vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc)))
TP_COND_VMCPU(a_pVCpu, RTTraceBufAddMsgF(hTB, "em-ff-all vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc)))
# else
# endif
#endif /* IN_RING3 */
/** @} */
/** @name Ring-0 trace points.
* @{
*/
#ifdef IN_RING0
# ifdef VBOX_WITH_DTRACE_R0
# include "VBoxVMMR0-dtrace.h"
# elif defined(DBGFTRACE_ENABLED)
# else
# endif
#endif /* IN_RING0*/
/** @} */
/** @} */
#endif