VirtualBox

Changeset 75495 in vbox for trunk/include


Ignore:
Timestamp:
Nov 15, 2018 8:53:00 PM (6 years ago)
Author:
vboxsync
Message:

HGCM,Main,SharedFolder,SharedClipboard,GuestProperties: Added HGCM service helpers for statistics and dbg info registration/deregistration. A PUVM is passed to HGCMService (where the helpers are implemented) when the service is loaded. Since this drags in both dbg.h and stam.h, LOG_GROUP defines now have to be at the top of the include list as everywhere else (i.e. hgcmsvc.h will define LOG_GROUP default by dragging in log.h). Added generic statistics of HGCM message processing and function level statistics to the shared folder service.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestPropertySvc.h

    r71010 r75495  
    243243 * parameter for the flags. */
    244244#define GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS 7
    245 /** Return the pointer to a debug info function enumerating all guest
    246  * properties. */
    247 #define GUEST_PROP_FN_HOST_GET_DBGF_INFO    8
    248245/** @} */
    249246
  • trunk/include/VBox/hgcmsvc.h

    r75406 r75495  
    2828
    2929#include <iprt/assert.h>
     30#include <iprt/stdarg.h>
    3031#include <iprt/string.h>
    3132#include <VBox/cdefs.h>
    3233#include <VBox/types.h>
    3334#include <VBox/err.h>
     35#include <VBox/vmm/stam.h>
     36#include <VBox/vmm/dbgf.h>
    3437#ifdef VBOX_TEST_HGCM_PARMS
    3538# include <iprt/test.h>
     
    9194    DECLR3CALLBACKMEMBER(bool, pfnIsCallRestored, (VBOXHGCMCALLHANDLE callHandle));
    9295
     96    /** Access to STAMR3RegisterV. */
     97    DECLR3CALLBACKMEMBER(int, pfnStamRegisterV,(void *pvInstance, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
     98                                                STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list va)
     99                                                RT_IPRT_FORMAT_ATTR(7, 0));
     100    /** Access to STAMR3DeregisterV. */
     101    DECLR3CALLBACKMEMBER(int, pfnStamDeregisterV,(void *pvInstance, const char *pszPatFmt, va_list va) RT_IPRT_FORMAT_ATTR(2, 0));
     102
     103    /** Access to DBGFR3InfoRegisterExternal. */
     104    DECLR3CALLBACKMEMBER(int, pfnInfoRegister,(void *pvInstance, const char *pszName, const char *pszDesc,
     105                                               PFNDBGFHANDLEREXT pfnHandler, void *pvUser));
     106    /** Access to DBGFR3InfoDeregisterExternal. */
     107    DECLR3CALLBACKMEMBER(int, pfnInfoDeregister,(void *pvInstance, const char *pszName));
     108
    93109} VBOXHGCMSVCHELPERS;
    94110
    95111typedef VBOXHGCMSVCHELPERS *PVBOXHGCMSVCHELPERS;
     112
     113#if defined(IN_RING3) || defined(IN_SLICKEDIT)
     114
     115/** Wrapper around STAMR3RegisterF. */
     116DECLINLINE(int) RT_IPRT_FORMAT_ATTR(7, 8)
     117HGCMSvcHlpStamRegister(PVBOXHGCMSVCHELPERS pHlp, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
     118                       STAMUNIT enmUnit, const char *pszDesc, const char *pszName, ...)
     119{
     120    int rc;
     121    va_list va;
     122    va_start(va, pszName);
     123    rc = pHlp->pfnStamRegisterV(pHlp->pvInstance, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
     124    va_end(va);
     125    return rc;
     126}
     127
     128/** Wrapper around STAMR3RegisterV. */
     129DECLINLINE(int) RT_IPRT_FORMAT_ATTR(7, 0)
     130HGCMSvcHlpStamRegisterV(PVBOXHGCMSVCHELPERS pHlp, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
     131                        STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list va)
     132{
     133    return pHlp->pfnStamRegisterV(pHlp->pvInstance, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
     134}
     135
     136/** Wrapper around STAMR3DeregisterF. */
     137DECLINLINE(int) RT_IPRT_FORMAT_ATTR(2, 3) HGCMSvcHlpStamDeregister(PVBOXHGCMSVCHELPERS pHlp, const char *pszPatFmt, ...)
     138{
     139    int rc;
     140    va_list va;
     141    va_start(va, pszPatFmt);
     142    rc = pHlp->pfnStamDeregisterV(pHlp->pvInstance, pszPatFmt, va);
     143    va_end(va);
     144    return rc;
     145}
     146
     147/** Wrapper around STAMR3DeregisterV. */
     148DECLINLINE(int) RT_IPRT_FORMAT_ATTR(2, 0) HGCMSvcHlpStamDeregisterV(PVBOXHGCMSVCHELPERS pHlp, const char *pszPatFmt, va_list va)
     149{
     150    return pHlp->pfnStamDeregisterV(pHlp->pvInstance, pszPatFmt, va);
     151}
     152
     153/** Wrapper around DBGFR3InfoRegisterExternal. */
     154DECLINLINE(int) HGCMSvcHlpInfoRegister(PVBOXHGCMSVCHELPERS pHlp, const char *pszName, const char *pszDesc,
     155                                       PFNDBGFHANDLEREXT pfnHandler, void *pvUser)
     156{
     157    return pHlp->pfnInfoRegister(pHlp->pvInstance, pszName, pszDesc, pfnHandler, pvUser);
     158}
     159
     160/** Wrapper around DBGFR3InfoDeregisterExternal. */
     161DECLINLINE(int) HGCMSvcHlpInfoDeregister(PVBOXHGCMSVCHELPERS pHlp, const char *pszName)
     162{
     163    return pHlp->pfnInfoDeregister(pHlp->pvInstance, pszName);
     164}
     165
     166#endif /* IN_RING3 */
    96167
    97168
Note: See TracChangeset for help on using the changeset viewer.

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