VirtualBox

Changeset 61634 in vbox for trunk/include


Ignore:
Timestamp:
Jun 9, 2016 6:23:17 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107982
Message:

Fixed DBGFR3_INFO_LOG to only run on the current EMT as we'll easily deadlock if we involv other EMT like for cpumguest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r61628 r61634  
    967967 * Display a piece of info writing to the log if enabled.
    968968 *
     969 * This is for execution on EMTs and will only show the items on the calling
     970 * EMT.  This is to avoid deadlocking against other CPUs if a rendezvous is
     971 * initiated in parallel to this call.  (Besides, nobody really wants or need
     972 * info for the other EMTs when using this macro.)
     973 *
     974 * @param   a_pVM       The shared VM handle.
     975 * @param   a_pVCpu     The cross context per CPU structure of the calling EMT.
     976 * @param   a_pszName   The identifier of the info to display.
     977 * @param   a_pszArgs   Arguments to the info handler.
     978 */
     979#ifdef LOG_ENABLED
     980# define DBGFR3_INFO_LOG(a_pVM, a_pVCpu, a_pszName, a_pszArgs) \
     981    do { \
     982        if (LogIsEnabled()) \
     983            DBGFR3InfoEx((a_pVM)->pUVM, (a_pVCpu)->idCpu, a_pszName, a_pszArgs, NULL); \
     984    } while (0)
     985#else
     986# define DBGFR3_INFO_LOG(a_pVM, a_pVCpu, a_pszName, a_pszArgs) do { } while (0)
     987#endif
     988
     989/** @def DBGFR3_INFO_LOG_SAFE
     990 * Display a piece of info (rendezvous safe) writing to the log if enabled.
     991 *
    969992 * @param   a_pVM       The shared VM handle.
    970993 * @param   a_pszName   The identifier of the info to display.
    971994 * @param   a_pszArgs   Arguments to the info handler.
     995 *
     996 * @remarks Use DBGFR3_INFO_LOG where ever possible!
    972997 */
    973998#ifdef LOG_ENABLED
    974 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) \
     999# define DBGFR3_INFO_LOG_SAFE(a_pVM, a_pszName, a_pszArgs) \
    9751000    do { \
    9761001        if (LogIsEnabled()) \
     
    9781003    } while (0)
    9791004#else
    980 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) do { } while (0)
     1005# define DBGFR3_INFO_LOG_SAFE(a_pVM, a_pszName, a_pszArgs) do { } while (0)
    9811006#endif
    9821007
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette