-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xen/PMU: Sysfs interface for setting Xen PMU mode
Set Xen's PMU mode via /sys/hypervisor/pmu/pmu_mode. Add XENPMU hypercall. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
- Loading branch information
Boris Ostrovsky
authored and
David Vrabel
committed
Aug 20, 2015
1 parent
a11f4f0
commit 5f14154
Showing
7 changed files
with
228 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
What: /sys/hypervisor/pmu/pmu_mode | ||
Date: August 2015 | ||
KernelVersion: 4.3 | ||
Contact: Boris Ostrovsky <boris.ostrovsky@oracle.com> | ||
Description: | ||
Describes mode that Xen's performance-monitoring unit (PMU) | ||
uses. Accepted values are | ||
"off" -- PMU is disabled | ||
"self" -- The guest can profile itself | ||
"hv" -- The guest can profile itself and, if it is | ||
privileged (e.g. dom0), the hypervisor | ||
"all" -- The guest can profile itself, the hypervisor | ||
and all other guests. Only available to | ||
privileged guests. | ||
|
||
What: /sys/hypervisor/pmu/pmu_features | ||
Date: August 2015 | ||
KernelVersion: 4.3 | ||
Contact: Boris Ostrovsky <boris.ostrovsky@oracle.com> | ||
Description: | ||
Describes Xen PMU features (as an integer). A set bit indicates | ||
that the corresponding feature is enabled. See | ||
include/xen/interface/xenpmu.h for available features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef __XEN_PUBLIC_XENPMU_H__ | ||
#define __XEN_PUBLIC_XENPMU_H__ | ||
|
||
#include "xen.h" | ||
|
||
#define XENPMU_VER_MAJ 0 | ||
#define XENPMU_VER_MIN 1 | ||
|
||
/* | ||
* ` enum neg_errnoval | ||
* ` HYPERVISOR_xenpmu_op(enum xenpmu_op cmd, struct xenpmu_params *args); | ||
* | ||
* @cmd == XENPMU_* (PMU operation) | ||
* @args == struct xenpmu_params | ||
*/ | ||
/* ` enum xenpmu_op { */ | ||
#define XENPMU_mode_get 0 /* Also used for getting PMU version */ | ||
#define XENPMU_mode_set 1 | ||
#define XENPMU_feature_get 2 | ||
#define XENPMU_feature_set 3 | ||
#define XENPMU_init 4 | ||
#define XENPMU_finish 5 | ||
|
||
/* ` } */ | ||
|
||
/* Parameters structure for HYPERVISOR_xenpmu_op call */ | ||
struct xen_pmu_params { | ||
/* IN/OUT parameters */ | ||
struct { | ||
uint32_t maj; | ||
uint32_t min; | ||
} version; | ||
uint64_t val; | ||
|
||
/* IN parameters */ | ||
uint32_t vcpu; | ||
uint32_t pad; | ||
}; | ||
|
||
/* PMU modes: | ||
* - XENPMU_MODE_OFF: No PMU virtualization | ||
* - XENPMU_MODE_SELF: Guests can profile themselves | ||
* - XENPMU_MODE_HV: Guests can profile themselves, dom0 profiles | ||
* itself and Xen | ||
* - XENPMU_MODE_ALL: Only dom0 has access to VPMU and it profiles | ||
* everyone: itself, the hypervisor and the guests. | ||
*/ | ||
#define XENPMU_MODE_OFF 0 | ||
#define XENPMU_MODE_SELF (1<<0) | ||
#define XENPMU_MODE_HV (1<<1) | ||
#define XENPMU_MODE_ALL (1<<2) | ||
|
||
/* | ||
* PMU features: | ||
* - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD) | ||
*/ | ||
#define XENPMU_FEATURE_INTEL_BTS 1 | ||
|
||
#endif /* __XEN_PUBLIC_XENPMU_H__ */ |