Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/core/vmkapi_accounting.h
d0a14f973771
4.7 KiB
text/x-chdr
ESXi-5.0-U1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | /* **********************************************************
* Copyright 2008 - 2009 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* Accounting */ /**
* \defgroup Accounting System Time Accounting
*
* System time accounting allows work for a particular service to be
* charged to a world. This allows work to be offloaded to several worlds
* or other contexts but charged to the appropriate world on whose behalf
* the work is being done.
*
* @{
***********************************************************************
*/
#ifndef _VMKAPI_ACCOUNTING_H_
#define _VMKAPI_ACCOUNTING_H_
/** \cond never */
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
#error This vmkapi file should never be included directly but only via vmkapi.h
#endif
/** \endcond never */
/*
* Well-known accounting service names
*/
#define VMK_SERVICE_ACCT_NAME_KERNEL "kernel"
#define VMK_SERVICE_ACCT_NAME_SCSI "scsi"
/**
* \ingroup Accounting
* \brief Opaque handle representing a service to charge to.
*/
typedef vmk_uint64 vmk_ServiceAcctID;
/**
* \ingroup Accounting
* \brief Opaque handle to a world-related accounting context.
*/
typedef struct Sched_SysAcctContext *vmk_ServiceTimeContext;
/**
* \ingroup Accounting
* \brief A service time context that isn't associated with any service.
*/
#define VMK_SERVICE_TIME_CONTEXT_NONE ((vmk_ServiceTimeContext) 0)
/*
***********************************************************************
* vmk_ServiceGetID -- */ /**
*
* \ingroup Accounting
* \brief Lookup a service accounting ID handle by name
*
* \param[in] name Well-known accounting service name to lookup.
* \param[out] serviceID Service identifier handle corresponding to
* the name.
*
* \note This function will not block.
*
* \retval VMK_INVALID_NAME The specified service name is invalid.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_ServiceGetID(
const char *name,
vmk_ServiceAcctID *serviceID);
/*
***********************************************************************
* vmk_ServiceTimeChargeBeginWorld -- */ /**
*
* \ingroup Accounting
* \brief Begin charging work for a serivce to a world ID
*
* \param[in] serviceID Type of service for the work.
* \param[in] worldID World on whose behalf the work is being done.
* May be VMK_INVALID_WORLD_ID if the caller is
* charging to a particular service category
* not on behalf of any particular world.
*
* \note A world should not deschedule between the invocation of
* vmk_ServiceTimeChargeBeginWorld() and its corresponding
* vmk_ServiceTimeChargeEndWorld().
* \note This function will not block.
*
* \return A handle to an accounting context.
*
***********************************************************************
*/
vmk_ServiceTimeContext vmk_ServiceTimeChargeBeginWorld(
vmk_ServiceAcctID serviceID,
vmk_WorldID worldID);
/*
***********************************************************************
* vmk_ServiceTimeChargeEndWorld -- */ /**
*
* \ingroup Accounting
* \brief Stop charging work against a world.
*
* \param[in] context Accounting context to cease charging against.
* May be VMK_SERVICE_TIME_CONTEXT_NONE in which
* case no action is taken.
*
* \note This function will not block.
*
***********************************************************************
*/
void vmk_ServiceTimeChargeEndWorld(
vmk_ServiceTimeContext context);
/*
***********************************************************************
* vmk_ServiceTimeChargeSetWorld -- */ /**
*
* \ingroup Accounting
* \brief Set the worldID for charging the work.
*
* \param[in] context Accounting context used to charge.
* "context" can be VMK_SERVICE_TIME_CONTEXT_NONE in
* which case, the currently established context
* will be used to charge for given worldID
*
* \note This function will not block.
*
* \param[in] worldID World on whose behalf the work is being done.
*
***********************************************************************
*/
void
vmk_ServiceTimeChargeSetWorld(vmk_ServiceTimeContext context,
vmk_WorldID worldID);
#endif /* _VMKAPI_ACCOUNTING_H_ */
/** @} */
|