perf: add alignment_faults software perf event support
This patch adds support and documentation for the alignment_faults perf event. Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
This commit is contained in:
parent
43a54cedf6
commit
6780791f18
@ -1954,6 +1954,7 @@
|
|||||||
<event name='cpu_migrations' enabled='no'/>
|
<event name='cpu_migrations' enabled='no'/>
|
||||||
<event name='page_faults_min' enabled='no'/>
|
<event name='page_faults_min' enabled='no'/>
|
||||||
<event name='page_faults_maj' enabled='no'/>
|
<event name='page_faults_maj' enabled='no'/>
|
||||||
|
<event name='alignment_faults' enabled='no'/>
|
||||||
</perf>
|
</perf>
|
||||||
...
|
...
|
||||||
</pre>
|
</pre>
|
||||||
@ -2082,6 +2083,13 @@
|
|||||||
applications running on the platform</td>
|
applications running on the platform</td>
|
||||||
<td><code>perf.page_faults_maj</code></td>
|
<td><code>perf.page_faults_maj</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>alignment_faults</code></td>
|
||||||
|
<td>the count of alignment faults, that is when
|
||||||
|
the load or store is not aligned properly, by
|
||||||
|
applications running on the platform</td>
|
||||||
|
<td><code>perf.alignment_faults</code></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3><a name="elementsDevices">Devices</a></h3>
|
<h3><a name="elementsDevices">Devices</a></h3>
|
||||||
|
@ -440,6 +440,7 @@
|
|||||||
<value>cpu_migrations</value>
|
<value>cpu_migrations</value>
|
||||||
<value>page_faults_min</value>
|
<value>page_faults_min</value>
|
||||||
<value>page_faults_maj</value>
|
<value>page_faults_maj</value>
|
||||||
|
<value>alignment_faults</value>
|
||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="enabled">
|
<attribute name="enabled">
|
||||||
|
@ -2260,6 +2260,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats);
|
|||||||
*/
|
*/
|
||||||
# define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj"
|
# define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VIR_PERF_PARAM_ALIGNMENT_FAULTS:
|
||||||
|
*
|
||||||
|
* Macro for typed parameter name that represents alignment_faults
|
||||||
|
* perf event which can be used to measure the count of alignment
|
||||||
|
* faults by applications running on the platform. It corresponds
|
||||||
|
* to the "perf.alignment_faults" field in the *Stats APIs.
|
||||||
|
*/
|
||||||
|
# define VIR_PERF_PARAM_ALIGNMENT_FAULTS "alignment_faults"
|
||||||
|
|
||||||
int virDomainGetPerfEvents(virDomainPtr dom,
|
int virDomainGetPerfEvents(virDomainPtr dom,
|
||||||
virTypedParameterPtr *params,
|
virTypedParameterPtr *params,
|
||||||
int *nparams,
|
int *nparams,
|
||||||
|
@ -11269,6 +11269,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
|
|||||||
* "perf.page_faults_maj" - The count of major page faults as unsigned
|
* "perf.page_faults_maj" - The count of major page faults as unsigned
|
||||||
* long long. It is produced by the
|
* long long. It is produced by the
|
||||||
* page_faults_maj perf event.
|
* page_faults_maj perf event.
|
||||||
|
* "perf.alignment_faults" - The count of alignment faults as unsigned
|
||||||
|
* long long. It is produced by the
|
||||||
|
* alignment_faults perf event
|
||||||
*
|
*
|
||||||
* Note that entire stats groups or individual stat fields may be missing from
|
* Note that entire stats groups or individual stat fields may be missing from
|
||||||
* the output in case they are not supported by the given hypervisor, are not
|
* the output in case they are not supported by the given hypervisor, are not
|
||||||
|
@ -9574,6 +9574,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
|
|||||||
VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PARAM_BOOLEAN,
|
VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PARAM_BOOLEAN,
|
||||||
VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_PARAM_BOOLEAN,
|
VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_PARAM_BOOLEAN,
|
||||||
VIR_PERF_PARAM_PAGE_FAULTS_MAJ, VIR_TYPED_PARAM_BOOLEAN,
|
VIR_PERF_PARAM_PAGE_FAULTS_MAJ, VIR_TYPED_PARAM_BOOLEAN,
|
||||||
|
VIR_PERF_PARAM_ALIGNMENT_FAULTS, VIR_TYPED_PARAM_BOOLEAN,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST,
|
|||||||
"stalled_cycles_backend", "ref_cpu_cycles",
|
"stalled_cycles_backend", "ref_cpu_cycles",
|
||||||
"cpu_clock", "task_clock", "page_faults",
|
"cpu_clock", "task_clock", "page_faults",
|
||||||
"context_switches", "cpu_migrations",
|
"context_switches", "cpu_migrations",
|
||||||
"page_faults_min", "page_faults_maj");
|
"page_faults_min", "page_faults_maj",
|
||||||
|
"alignment_faults");
|
||||||
|
|
||||||
struct virPerfEvent {
|
struct virPerfEvent {
|
||||||
int type;
|
int type;
|
||||||
@ -136,6 +137,9 @@ static struct virPerfEventAttr attrs[] = {
|
|||||||
{.type = VIR_PERF_EVENT_PAGE_FAULTS_MAJ,
|
{.type = VIR_PERF_EVENT_PAGE_FAULTS_MAJ,
|
||||||
.attrType = PERF_TYPE_SOFTWARE,
|
.attrType = PERF_TYPE_SOFTWARE,
|
||||||
.attrConfig = PERF_COUNT_SW_PAGE_FAULTS_MAJ},
|
.attrConfig = PERF_COUNT_SW_PAGE_FAULTS_MAJ},
|
||||||
|
{.type = VIR_PERF_EVENT_ALIGNMENT_FAULTS,
|
||||||
|
.attrType = PERF_TYPE_SOFTWARE,
|
||||||
|
.attrConfig = PERF_COUNT_SW_ALIGNMENT_FAULTS},
|
||||||
};
|
};
|
||||||
typedef struct virPerfEventAttr *virPerfEventAttrPtr;
|
typedef struct virPerfEventAttr *virPerfEventAttrPtr;
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ typedef enum {
|
|||||||
VIR_PERF_EVENT_CPU_MIGRATIONS, /* Count of cpu migrations */
|
VIR_PERF_EVENT_CPU_MIGRATIONS, /* Count of cpu migrations */
|
||||||
VIR_PERF_EVENT_PAGE_FAULTS_MIN, /* Count of minor page faults */
|
VIR_PERF_EVENT_PAGE_FAULTS_MIN, /* Count of minor page faults */
|
||||||
VIR_PERF_EVENT_PAGE_FAULTS_MAJ, /* Count of major page faults */
|
VIR_PERF_EVENT_PAGE_FAULTS_MAJ, /* Count of major page faults */
|
||||||
|
VIR_PERF_EVENT_ALIGNMENT_FAULTS, /* Count of alignment faults */
|
||||||
|
|
||||||
VIR_PERF_EVENT_LAST
|
VIR_PERF_EVENT_LAST
|
||||||
} virPerfEventType;
|
} virPerfEventType;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
<event name='cpu_migrations' enabled='yes'/>
|
<event name='cpu_migrations' enabled='yes'/>
|
||||||
<event name='page_faults_min' enabled='yes'/>
|
<event name='page_faults_min' enabled='yes'/>
|
||||||
<event name='page_faults_maj' enabled='yes'/>
|
<event name='page_faults_maj' enabled='yes'/>
|
||||||
|
<event name='alignment_faults' enabled='yes'/>
|
||||||
</perf>
|
</perf>
|
||||||
<devices>
|
<devices>
|
||||||
</devices>
|
</devices>
|
||||||
|
@ -971,6 +971,7 @@ I<--perf> returns the statistics of all enabled perf events:
|
|||||||
"perf.cpu_migrations" - the count of cpu migrations
|
"perf.cpu_migrations" - the count of cpu migrations
|
||||||
"perf.page_faults_min" - the count of minor page faults
|
"perf.page_faults_min" - the count of minor page faults
|
||||||
"perf.page_faults_maj" - the count of major page faults
|
"perf.page_faults_maj" - the count of major page faults
|
||||||
|
"perf.alignment_faults" - the count of alignment faults
|
||||||
|
|
||||||
See the B<perf> command for more details about each event.
|
See the B<perf> command for more details about each event.
|
||||||
|
|
||||||
@ -2354,6 +2355,8 @@ B<Valid perf event names>
|
|||||||
by applications running on the platform.
|
by applications running on the platform.
|
||||||
page_faults_maj - Provides the count major page faults
|
page_faults_maj - Provides the count major page faults
|
||||||
by applications running on the platform.
|
by applications running on the platform.
|
||||||
|
alignment_faults - Provides the count alignment faults
|
||||||
|
by applications running on the platform.
|
||||||
|
|
||||||
B<Note>: The statistics can be retrieved using the B<domstats> command using
|
B<Note>: The statistics can be retrieved using the B<domstats> command using
|
||||||
the I<--perf> flag.
|
the I<--perf> flag.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user