perf: add context_switches software perf event support

This patch adds support and documentation
for the context_switches perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
This commit is contained in:
Nitesh Konkar
2017-02-23 20:25:33 +05:30
committed by John Ferlan
parent 6ef2c7e00f
commit 99cc3dc6a2
9 changed files with 32 additions and 1 deletions

View File

@@ -2220,6 +2220,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats);
*/
# define VIR_PERF_PARAM_PAGE_FAULTS "page_faults"
/**
* VIR_PERF_PARAM_CONTEXT_SWITCHES:
*
* Macro for typed parameter name that represents context_switches
* perf event which can be used to measure the count of context
* switches by applications running on the platform. It corresponds
* to the "perf.context_switches" field in the *Stats APIs.
*/
# define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches"
int virDomainGetPerfEvents(virDomainPtr dom,
virTypedParameterPtr *params,