a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/* $Id$ */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/** @file
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * DBGF - Debugger Facility, Tracing.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Copyright (C) 2011-2012 Oracle Corporation
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * available from http://www.virtualbox.org. This file is free software;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * General Public License (GPL) as published by the Free Software
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/*******************************************************************************
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync* Header Files *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync*******************************************************************************/
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#define LOG_GROUP LOG_GROUP_DBGF
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/vmm/dbgftrace.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/vmm/cfgm.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/vmm/mm.h>
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync#include <VBox/vmm/pdmapi.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include "DBGFInternal.h"
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/vmm/vm.h>
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync#include "VMMTracing.h"
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/err.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/log.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <VBox/param.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <iprt/assert.h>
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync#include <iprt/ctype.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#include <iprt/trace.h>
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/*******************************************************************************
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync* Internal Functions *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync*******************************************************************************/
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncstatic DECLCALLBACK(void) dbgfR3TraceInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync/*******************************************************************************
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync* Global Variables *
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync*******************************************************************************/
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync/**
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * VMM trace point group translation table.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsyncstatic const struct
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync{
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /** The group name. */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync const char *pszName;
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync /** The name length. */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync uint32_t cchName;
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync /** The mask. */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync uint32_t fMask;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync} g_aVmmTpGroups[] =
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync{
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync { RT_STR_TUPLE("em"), VMMTPGROUP_EM },
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync { RT_STR_TUPLE("hm"), VMMTPGROUP_HM },
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync { RT_STR_TUPLE("tm"), VMMTPGROUP_TM },
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync};
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Initializes the tracing.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * @returns VBox status code
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncstatic int dbgfR3TraceEnable(PVM pVM, uint32_t cbEntry, uint32_t cEntries)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Don't enable it twice.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (pVM->hTraceBufR3 != NIL_RTTRACEBUF)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return VERR_ALREADY_EXISTS;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Resolve default parameter values.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync int rc;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (!cbEntry)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync {
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = CFGMR3QueryU32Def(CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGF"), "TraceBufEntrySize", &cbEntry, 128);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync AssertRCReturn(rc, rc);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync }
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (!cEntries)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync {
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = CFGMR3QueryU32Def(CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGF"), "TraceBufEntries", &cEntries, 4096);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync AssertRCReturn(rc, rc);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync }
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Figure the required size.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync RTTRACEBUF hTraceBuf;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync size_t cbBlock = 0;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = RTTraceBufCarve(&hTraceBuf, cEntries, cbEntry, 0 /*fFlags*/, NULL, &cbBlock);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (rc != VERR_BUFFER_OVERFLOW)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync {
1759f65b60e18f669f6d569aebd4fb7217ab414fvboxsync AssertReturn(!RT_SUCCESS_NP(rc), VERR_IPE_UNEXPECTED_INFO_STATUS);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return rc;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync }
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Allocate a hyper heap block and carve a trace buffer out of it.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Note! We ASSUME that the returned trace buffer handle has the same value
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * as the heap block.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync cbBlock = RT_ALIGN_Z(cbBlock, PAGE_SIZE);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync void *pvBlock;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = MMR3HyperAllocOnceNoRel(pVM, cbBlock, PAGE_SIZE, MM_TAG_DBGF, &pvBlock);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (RT_FAILURE(rc))
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return rc;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = RTTraceBufCarve(&hTraceBuf, cEntries, cbEntry, 0 /*fFlags*/, pvBlock, &cbBlock);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync AssertRCReturn(rc, rc);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync AssertRelease(hTraceBuf == (RTTRACEBUF)pvBlock && (void *)hTraceBuf == pvBlock);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufR3 = hTraceBuf;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufR0 = MMHyperCCToR0(pVM, hTraceBuf);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufRC = MMHyperCCToRC(pVM, hTraceBuf);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return VINF_SUCCESS;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Initializes the tracing.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * @returns VBox status code
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncint dbgfR3TraceInit(PVM pVM)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Initialize the trace buffer handles.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync Assert(NIL_RTTRACEBUF == (RTTRACEBUF)NULL);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufR3 = NIL_RTTRACEBUF;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufRC = NIL_RTRCPTR;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufR0 = NIL_RTR0PTR;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Check the config and enable tracing if requested.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync PCFGMNODE pDbgfNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGF");
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#if defined(DEBUG) || defined(RTTRACE_ENABLED)
78e0dc78ee7736f38ebf165eedb317eb3e4960eavboxsync bool const fDefault = false;
78e0dc78ee7736f38ebf165eedb317eb3e4960eavboxsync const char * const pszConfigDefault = "";
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync bool const fDefault = false;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync const char * const pszConfigDefault = "";
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync#endif
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync bool fTracingEnabled;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync int rc = CFGMR3QueryBoolDef(pDbgfNode, "TracingEnabled", &fTracingEnabled, fDefault);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync AssertRCReturn(rc, rc);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (fTracingEnabled)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = dbgfR3TraceEnable(pVM, 0, 0);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_SUCCESS(rc))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync if (pDbgfNode)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync char *pszTracingConfig;
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync rc = CFGMR3QueryStringAllocDef(pDbgfNode, "TracingConfig", &pszTracingConfig, pszConfigDefault);
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync if (RT_SUCCESS(rc))
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync {
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync rc = DBGFR3TraceConfig(pVM, pszTracingConfig);
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync if (RT_FAILURE(rc))
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync rc = VMSetError(pVM, rc, RT_SRC_POS, "TracingConfig=\"%s\" -> %Rrc", pszTracingConfig, rc);
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync MMR3HeapFree(pszTracingConfig);
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync }
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync }
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync else
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync {
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync rc = DBGFR3TraceConfig(pVM, pszConfigDefault);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_FAILURE(rc))
da16291aeb2bc65f199d6e263b823746da1d19dfvboxsync rc = VMSetError(pVM, rc, RT_SRC_POS, "TracingConfig=\"%s\" (default) -> %Rrc", pszConfigDefault, rc);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /*
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Register a debug info item that will dump the trace buffer content.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (RT_SUCCESS(rc))
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync rc = DBGFR3InfoRegisterInternal(pVM, "tracebuf", "Display the trace buffer content. No arguments.", dbgfR3TraceInfo);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return rc;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Terminates the tracing.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncvoid dbgfR3TraceTerm(PVM pVM)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync /* nothing to do */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync NOREF(pVM);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * Relocates the trace buffer handle in RC.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync *
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncvoid dbgfR3TraceRelocate(PVM pVM)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (pVM->hTraceBufR3 != NIL_RTTRACEBUF)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pVM->hTraceBufRC = MMHyperCCToRC(pVM, pVM->hTraceBufR3);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync/**
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Change the traceing configuration of the VM.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @returns VBox status code.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VINF_SUCCESS
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_NOT_FOUND if any of the trace point groups mentioned in the
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * config string cannot be found. (Or if the string cannot be made
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * sense of.) No change made.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_INVALID_VM_HANDLE
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_INVALID_POINTER
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @param pszConfig The configuration change specification.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Trace point group names, optionally prefixed by a '-' to
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * indicate that the group is being disabled. A special
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * group 'all' can be used to enable or disable all trace
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * points.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Drivers, devices and USB devices each have their own
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * trace point group which can be accessed by prefixing
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * their official PDM name by 'drv', 'dev' or 'usb'
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * respectively.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsyncVMMDECL(int) DBGFR3TraceConfig(PVM pVM, const char *pszConfig)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync{
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync AssertPtrReturn(pszConfig, VERR_INVALID_POINTER);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (pVM->hTraceBufR3 == NIL_RTTRACEBUF)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return VERR_DBGF_NO_TRACE_BUFFER;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * We do this in two passes, the first pass just validates the input string
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * and the second applies the changes.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync for (uint32_t uPass = 0; uPass < 1; uPass++)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync char ch;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while ((ch = *pszConfig) != '\0')
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_C_IS_SPACE(ch))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync continue;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Operation prefix.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync bool fNo = false;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync do
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (ch == 'n' && pszConfig[1] == 'o')
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync fNo = !fNo;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pszConfig++;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else if (ch == '+')
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync fNo = false;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else if (ch == '-' || ch == '!' || ch == '~')
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync fNo = !fNo;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync break;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync } while ((ch = *++pszConfig) != '\0');
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (ch == '\0')
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync break;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Extract the name.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync const char *pszName = pszConfig;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while ( ch != '\0'
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync && !RT_C_IS_SPACE(ch)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync && !RT_C_IS_PUNCT(ch))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync ch = *++pszConfig;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync size_t const cchName = pszConfig - pszName;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * 'all' - special group that enables or disables all trace points.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (cchName == 3 && !strncmp(pszName, "all", 3))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (uPass != 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync uint32_t iCpu = pVM->cCpus;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (!fNo)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (iCpu-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pVM->aCpus[iCpu].fTraceGroups = UINT32_MAX;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (iCpu-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pVM->aCpus[iCpu].fTraceGroups = 0;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync PDMR3TracingConfig(pVM, NULL, 0, !fNo, uPass > 0);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync /*
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * A specific group, try the VMM first then PDM.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync uint32_t i = RT_ELEMENTS(g_aVmmTpGroups);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (i-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if ( g_aVmmTpGroups[i].cchName == cchName
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync && !strncmp(g_aVmmTpGroups[i].pszName, pszName, cchName))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (uPass != 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync uint32_t iCpu = pVM->cCpus;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (!fNo)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (iCpu-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pVM->aCpus[iCpu].fTraceGroups |= g_aVmmTpGroups[i].fMask;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (iCpu-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pVM->aCpus[iCpu].fTraceGroups &= ~g_aVmmTpGroups[i].fMask;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync break;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (i == UINT32_MAX)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync int rc = PDMR3TracingConfig(pVM, pszName, cchName, !fNo, uPass > 0);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_FAILURE(rc))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return rc;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return VINF_SUCCESS;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync}
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync/**
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * Query the trace configuration specification string.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @returns VBox status code.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VINF_SUCCESS
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_INVALID_VM_HANDLE
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_INVALID_POINTER
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @retval VERR_BUFFER_OVERFLOW if the buffer is too small. Buffer will be
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * empty.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
4bfa7b58e362a1bca0628643c352c137900bf01avboxsync * @param pVM Pointer to the VM.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @param pszConfig Pointer to the output buffer.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync * @param cbConfig The size of the output buffer.
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync */
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsyncVMMDECL(int) DBGFR3TraceQueryConfig(PVM pVM, char *pszConfig, size_t cbConfig)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync{
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync AssertPtrReturn(pszConfig, VERR_INVALID_POINTER);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (cbConfig < 1)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return VERR_BUFFER_OVERFLOW;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *pszConfig = '\0';
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (pVM->hTraceBufR3 == NIL_RTTRACEBUF)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return VERR_DBGF_NO_TRACE_BUFFER;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync int rc = VINF_SUCCESS;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync uint32_t const fTraceGroups = pVM->aCpus[0].fTraceGroups;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if ( fTraceGroups == UINT32_MAX
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync && PDMR3TracingAreAll(pVM, true /*fEnabled*/))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync rc = RTStrCopy(pszConfig, cbConfig, "all");
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else if ( fTraceGroups == 0
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync && PDMR3TracingAreAll(pVM, false /*fEnabled*/))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync rc = RTStrCopy(pszConfig, cbConfig, "-all");
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync char *pszDst = pszConfig;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync size_t cbDst = cbConfig;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync uint32_t i = RT_ELEMENTS(g_aVmmTpGroups);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync while (i-- > 0)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (g_aVmmTpGroups[i].fMask & fTraceGroups)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync size_t cchThis = g_aVmmTpGroups[i].cchName + (pszDst != pszConfig);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (cchThis >= cbDst)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync rc = VERR_BUFFER_OVERFLOW;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync break;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (pszDst != pszConfig)
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync {
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *pszDst = ' ';
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync memcpy(pszDst + 1, g_aVmmTpGroups[i].pszName, g_aVmmTpGroups[i].cchName + 1);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync else
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync memcpy(pszDst, g_aVmmTpGroups[i].pszName, g_aVmmTpGroups[i].cchName + 1);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync pszDst += cchThis;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync cbDst -= cchThis;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_SUCCESS(rc))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync rc = PDMR3TracingQueryConfig(pVM, pszDst, cbDst);
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync }
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync if (RT_FAILURE(rc))
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync *pszConfig = '\0';
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync return rc;
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync}
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a8b31f6b3abd04475d4abcb5292aa22131b5130fvboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * @callback_method_impl{FNRTTRACEBUFCALLBACK}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncstatic DECLCALLBACK(int)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncdbgfR3TraceInfoDumpEntry(RTTRACEBUF hTraceBuf, uint32_t iEntry, uint64_t NanoTS, RTCPUID idCpu, const char *pszMsg, void *pvUser)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync PCDBGFINFOHLP pHlp = (PCDBGFINFOHLP)pvUser;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pHlp->pfnPrintf(pHlp, "#%04u/%'llu/%02x: %s\n", iEntry, NanoTS, idCpu, pszMsg);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync NOREF(hTraceBuf);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync return VINF_SUCCESS;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync/**
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync * @callback_method_impl{FNDBGFHANDLERINT, Info handler for displaying the trace buffer content.}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync */
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsyncstatic DECLCALLBACK(void) dbgfR3TraceInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync{
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync RTTRACEBUF hTraceBuf = pVM->hTraceBufR3;
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync if (hTraceBuf == NIL_RTTRACEBUF)
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pHlp->pfnPrintf(pHlp, "Tracing is disable\n");
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync else
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync {
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync pHlp->pfnPrintf(pHlp, "Trace buffer %p - %u entries of %u bytes\n",
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync hTraceBuf, RTTraceBufGetEntryCount(hTraceBuf), RTTraceBufGetEntrySize(hTraceBuf));
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync RTTraceBufEnumEntries(hTraceBuf, dbgfR3TraceInfoDumpEntry, (void *)pHlp);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync }
2afbe132eb7931e0125141eabe3a48e08f1ffab5vboxsync NOREF(pszArgs);
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync}
a1d83f29ade4c8f9fe95fc75d3fb2642f36081c1vboxsync