[libvirt] [PATCH 0/4] Add generic perf event support

Add support and documentation for generic perf events like bus_cycles, stalled_cycles_frontend, stalled_cycles_backend and ref_cpu_cycles. Nitesh Konkar (4): perf: add bus_cycles perf event support perf: add stalled_cycles_frontend perf event support perf: add stalled_cycles_backend perf event support perf: add ref_cpu_cycles perf event support docs/formatdomain.html.in | 24 +++++++++++++++++ docs/news.html.in | 6 +++-- docs/schemas/domaincommon.rng | 4 +++ include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ src/libvirt-domain.c | 11 ++++++++ src/qemu/qemu_driver.c | 4 +++ src/util/virperf.c | 16 +++++++++++- src/util/virperf.h | 4 +++ tests/genericxml2xmlindata/generic-perf.xml | 4 +++ tools/virsh.pod | 16 +++++++++++- 10 files changed, 125 insertions(+), 4 deletions(-) -- 1.9.3

This patch adds support and documentation for the bus_cycles perf event. Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 2 ++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 6 +++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 3 +++ 10 files changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 086af55..cd3182b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1929,6 +1929,7 @@ <event name='cache_misses' enabled='no'/> <event name='branch_instructions' enabled='no'/> <event name='branch_misses' enabled='no'/> + <event name='bus_cycles' enabled='no'/> </perf> ... </pre> @@ -1984,6 +1985,11 @@ <td>the count of branch misses by applications running on the platform</td> <td><code>perf.branch_misses</code></td> </tr> + <tr> + <td><code>bus_cycles</code></td> + <td>the count of bus cycles by applications running on the platform</td> + <td><code>perf.bus_cycles</code></td> + </tr> </table> <h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index c160411..f246b2a 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -31,7 +31,8 @@ <ul> <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed - and branch misses by applications running on the platform + and branch misses and bus cycles by applications running on + the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index bf8818d..21a7afa 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -429,6 +429,7 @@ <value>cache_misses</value> <value>branch_instructions</value> <value>branch_misses</value> + <value>bus_cycles</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 3290b10..6d74238 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2145,6 +2145,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_BRANCH_MISSES "branch_misses" +/** + * VIR_PERF_PARAM_BUS_CYCLES: + * + * Macro for typed parameter name that represents bus_cycles + * perf event which can be used to measure the count of bus cycles + * by applications running on the platform. It corresponds to the + * "perf.bus_cycles" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index b287a39..19e323d 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11234,6 +11234,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * branch_instructions perf event. * "perf.branch_misses" - The count of branch misses as unsigned long * long. It is produced by branch_misses perf event. + * "perf.bus_cycles" - The count of bus cycles as unsigned long + * long. It is produced by bus_cycles perf event. * * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 88778d4..cf0f5e0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9854,6 +9854,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_CACHE_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_INSTRUCTIONS, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1; diff --git a/src/util/virperf.c b/src/util/virperf.c index 7f630da..31a5585 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -41,7 +41,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cmt", "mbmt", "mbml", "cpu_cycles", "instructions", "cache_references", "cache_misses", - "branch_instructions", "branch_misses"); + "branch_instructions", "branch_misses", + "bus_cycles"); struct virPerfEvent { int type; @@ -92,6 +93,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_BRANCH_MISSES, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_BRANCH_MISSES}, + {.type = VIR_PERF_EVENT_BUS_CYCLES, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_BUS_CYCLES}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; diff --git a/src/util/virperf.h b/src/util/virperf.h index 7049a5b..ac6d789 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -39,6 +39,7 @@ typedef enum { VIR_PERF_EVENT_BRANCH_INSTRUCTIONS, /* Count of branch instructions for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ + VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index a1e4e1c..56a6173 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -22,6 +22,7 @@ <event name='cache_misses' enabled='no'/> <event name='branch_instructions' enabled='yes'/> <event name='branch_misses' enabled='yes'/> + <event name='bus_cycles' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index 74c05c9..d844dc8 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -948,6 +948,7 @@ I<--perf> returns the statistics of all enabled perf events: "perf.cache_misses" - the count of caches misses, "perf.branch_instructions" - the count of branch instructions, "perf.branch_misses" - the count of branch misses +"perf.bus_cycles" - the count of bus cycles See the B<perf> command for more details about each event. @@ -2299,6 +2300,8 @@ B<Valid perf event names> platform. branch_misses - Provides the count of branch misses executed by applications running on the platform. + bus_cycles - Provides the count of bus cycles executed + by applications running on the platform. B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag. -- 1.9.3

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
This patch adds support and documentation for the bus_cycles perf event.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 2 ++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 6 +++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 3 +++ 10 files changed, 32 insertions(+), 2 deletions(-)
I fixed some nits... see below John
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 086af55..cd3182b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1929,6 +1929,7 @@ <event name='cache_misses' enabled='no'/> <event name='branch_instructions' enabled='no'/> <event name='branch_misses' enabled='no'/> + <event name='bus_cycles' enabled='no'/> </perf> ... </pre> @@ -1984,6 +1985,11 @@ <td>the count of branch misses by applications running on the platform</td> <td><code>perf.branch_misses</code></td> </tr> + <tr> + <td><code>bus_cycles</code></td> + <td>the count of bus cycles by applications running on the platform</td> + <td><code>perf.bus_cycles</code></td> + </tr> </table>
<h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index c160411..f246b2a 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -31,7 +31,8 @@ <ul> <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed - and branch misses by applications running on the platform + and branch misses and bus cycles by applications running on + the platform
Now you have a list, so I adjusted to branch instructions executed, branch misses, and bus cycles... Although the next patch does this already having two 'ands' is on the fringes of correct grammar.
</li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index bf8818d..21a7afa 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -429,6 +429,7 @@ <value>cache_misses</value> <value>branch_instructions</value> <value>branch_misses</value> + <value>bus_cycles</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 3290b10..6d74238 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2145,6 +2145,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_BRANCH_MISSES "branch_misses"
+/** + * VIR_PERF_PARAM_BUS_CYCLES: + * + * Macro for typed parameter name that represents bus_cycles + * perf event which can be used to measure the count of bus cycles + * by applications running on the platform. It corresponds to the + * "perf.bus_cycles" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index b287a39..19e323d 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11234,6 +11234,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * branch_instructions perf event. * "perf.branch_misses" - The count of branch misses as unsigned long * long. It is produced by branch_misses perf event. + * "perf.bus_cycles" - The count of bus cycles as unsigned long + * long. It is produced by bus_cycles perf event.
Again no need to have the extra indention.
* * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 88778d4..cf0f5e0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9854,6 +9854,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_CACHE_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_INSTRUCTIONS, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1;
diff --git a/src/util/virperf.c b/src/util/virperf.c index 7f630da..31a5585 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -41,7 +41,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cmt", "mbmt", "mbml", "cpu_cycles", "instructions", "cache_references", "cache_misses", - "branch_instructions", "branch_misses"); + "branch_instructions", "branch_misses", + "bus_cycles");
struct virPerfEvent { int type; @@ -92,6 +93,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_BRANCH_MISSES, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_BRANCH_MISSES}, + {.type = VIR_PERF_EVENT_BUS_CYCLES, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_BUS_CYCLES}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr;
diff --git a/src/util/virperf.h b/src/util/virperf.h index 7049a5b..ac6d789 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -39,6 +39,7 @@ typedef enum { VIR_PERF_EVENT_BRANCH_INSTRUCTIONS, /* Count of branch instructions for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ + VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/
VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index a1e4e1c..56a6173 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -22,6 +22,7 @@ <event name='cache_misses' enabled='no'/> <event name='branch_instructions' enabled='yes'/> <event name='branch_misses' enabled='yes'/> + <event name='bus_cycles' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index 74c05c9..d844dc8 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -948,6 +948,7 @@ I<--perf> returns the statistics of all enabled perf events: "perf.cache_misses" - the count of caches misses, "perf.branch_instructions" - the count of branch instructions, "perf.branch_misses" - the count of branch misses
Since the following line will be a continuation of the list, the above line needs a comma at the end... I see this was fixed in the next patch, but needed to be done here.
+"perf.bus_cycles" - the count of bus cycles
See the B<perf> command for more details about each event.
@@ -2299,6 +2300,8 @@ B<Valid perf event names> platform. branch_misses - Provides the count of branch misses executed by applications running on the platform. + bus_cycles - Provides the count of bus cycles executed + by applications running on the platform.
B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag.

This patch adds support and documentation for the stalled_cycles_frontend perf event. Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 6 +++--- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 5 ++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 8 ++++++-- 10 files changed, 36 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index cd3182b..424b4de 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1930,6 +1930,7 @@ <event name='branch_instructions' enabled='no'/> <event name='branch_misses' enabled='no'/> <event name='bus_cycles' enabled='no'/> + <event name='stalled_cycles_frontend' enabled='no'/> </perf> ... </pre> @@ -1990,6 +1991,11 @@ <td>the count of bus cycles by applications running on the platform</td> <td><code>perf.bus_cycles</code></td> </tr> + <tr> + <td><code>stalled_cycles_frontend</code></td> + <td>the count of stalled cycles frontend by applications running on the platform</td> + <td><code>perf.stalled_cycles_frontend</code></td> + </tr> </table> <h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index f246b2a..ea91d99 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -30,9 +30,9 @@ <li><strong>Improvements</strong> <ul> <li>perf: Add more perf statistics<br/> - Add support to get the count of branch instructions executed - and branch misses and bus cycles by applications running on - the platform + Add support to get the count of branch instructions + executed, branch misses, bus cycles, stalled cycles + frontend by applications running on the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 21a7afa..9ce7cc9 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -430,6 +430,7 @@ <value>branch_instructions</value> <value>branch_misses</value> <value>bus_cycles</value> + <value>stalled_cycles_frontend</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 6d74238..0741d14 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2155,6 +2155,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles" +/** + * VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND: + * + * Macro for typed parameter name that represents stalled_cycles_frontend + * perf event which can be used to measure the count of stalled cycles frontend + * by applications running on the platform. It corresponds to the + * "perf.stalled_cycles_frontend" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 19e323d..0d23d31 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11236,6 +11236,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * long. It is produced by branch_misses perf event. * "perf.bus_cycles" - The count of bus cycles as unsigned long * long. It is produced by bus_cycles perf event. + * "perf.stalled_cycles_frontend" - The count of stalled cycles frontend + * as unsigned long long. It is produced + * by stalled_cycles_frontend perf event. * * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cf0f5e0..273dbeb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9855,6 +9855,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BRANCH_INSTRUCTIONS, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1; diff --git a/src/util/virperf.c b/src/util/virperf.c index 31a5585..c21147a 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -42,7 +42,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cpu_cycles", "instructions", "cache_references", "cache_misses", "branch_instructions", "branch_misses", - "bus_cycles"); + "bus_cycles", "stalled_cycles_frontend"); struct virPerfEvent { int type; @@ -96,6 +96,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_BUS_CYCLES, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_BUS_CYCLES}, + {.type = VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_FRONTEND}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; diff --git a/src/util/virperf.h b/src/util/virperf.h index ac6d789..0aee1ba 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -40,6 +40,7 @@ typedef enum { for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ + VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/ VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index 56a6173..db76843 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -23,6 +23,7 @@ <event name='branch_instructions' enabled='yes'/> <event name='branch_misses' enabled='yes'/> <event name='bus_cycles' enabled='yes'/> + <event name='stalled_cycles_frontend' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index d844dc8..f9a6a19 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -947,8 +947,9 @@ I<--perf> returns the statistics of all enabled perf events: "perf.cache_references" - the count of cache hits, "perf.cache_misses" - the count of caches misses, "perf.branch_instructions" - the count of branch instructions, -"perf.branch_misses" - the count of branch misses -"perf.bus_cycles" - the count of bus cycles +"perf.branch_misses" - the count of branch misses, +"perf.bus_cycles" - the count of bus cycles, +"perf.stalled_cycles_frontend" - the count of stalled cycles frontend See the B<perf> command for more details about each event. @@ -2302,6 +2303,9 @@ B<Valid perf event names> by applications running on the platform. bus_cycles - Provides the count of bus cycles executed by applications running on the platform. + stalled_cycles_frontend - Provides the count of stalled cycles + frontend by applications running on + the platform. B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag. -- 1.9.3

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
This patch adds support and documentation for the stalled_cycles_frontend perf event.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 6 +++--- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 5 ++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 8 ++++++-- 10 files changed, 36 insertions(+), 6 deletions(-)
Similarly a few nits which I fixed - see below. John
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index cd3182b..424b4de 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1930,6 +1930,7 @@ <event name='branch_instructions' enabled='no'/> <event name='branch_misses' enabled='no'/> <event name='bus_cycles' enabled='no'/> + <event name='stalled_cycles_frontend' enabled='no'/> </perf> ... </pre> @@ -1990,6 +1991,11 @@ <td>the count of bus cycles by applications running on the platform</td> <td><code>perf.bus_cycles</code></td> </tr> + <tr> + <td><code>stalled_cycles_frontend</code></td> + <td>the count of stalled cycles frontend by applications running on the platform</td>
Change to: the count of stalled cpu cycles in the frontend of the instruction processor pipeline by applications running on the platform IMO: It's an awful name to try and describe in a few sentences! Essentially from my quick read an instruction pipeline can either be stalled in the front or backend depending on what's causing the stall. So this just counts those stall "in the" front end.
+ <td><code>perf.stalled_cycles_frontend</code></td> + </tr> </table>
<h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index f246b2a..ea91d99 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -30,9 +30,9 @@ <li><strong>Improvements</strong> <ul> <li>perf: Add more perf statistics<br/> - Add support to get the count of branch instructions executed - and branch misses and bus cycles by applications running on - the platform + Add support to get the count of branch instructions + executed, branch misses, bus cycles, stalled cycles
bus cycles, and stalled frontend cpu cycles
+ frontend by applications running on the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 21a7afa..9ce7cc9 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -430,6 +430,7 @@ <value>branch_instructions</value> <value>branch_misses</value> <value>bus_cycles</value> + <value>stalled_cycles_frontend</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 6d74238..0741d14 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2155,6 +2155,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles"
+/** + * VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND: + * + * Macro for typed parameter name that represents stalled_cycles_frontend + * perf event which can be used to measure the count of stalled cycles frontend + * by applications running on the platform. It corresponds to the + * "perf.stalled_cycles_frontend" field in the *Stats APIs.
A similar update here (sorry - line wrap makes it look ugly): * Macro for typed parameter name that represents stalled_cycles_frontend * perf event which can be used to measure the count of stalled cpu cycles * in the frontend of the instruction processor pipeline by applications * running on the platform. It corresponds to the * "perf.stalled_cycles_frontend" field in the *Stats APIs.
+ */ +# define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 19e323d..0d23d31 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11236,6 +11236,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * long. It is produced by branch_misses perf event. * "perf.bus_cycles" - The count of bus cycles as unsigned long * long. It is produced by bus_cycles perf event. + * "perf.stalled_cycles_frontend" - The count of stalled cycles frontend + * as unsigned long long. It is produced + * by stalled_cycles_frontend perf event.
Same here: The count of stalled cpu cycles in the frontend of the instruction processor pipeline as unsigned long long.
* * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cf0f5e0..273dbeb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9855,6 +9855,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BRANCH_INSTRUCTIONS, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1;
diff --git a/src/util/virperf.c b/src/util/virperf.c index 31a5585..c21147a 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -42,7 +42,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cpu_cycles", "instructions", "cache_references", "cache_misses", "branch_instructions", "branch_misses", - "bus_cycles"); + "bus_cycles", "stalled_cycles_frontend");
struct virPerfEvent { int type; @@ -96,6 +96,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_BUS_CYCLES, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_BUS_CYCLES}, + {.type = VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_FRONTEND}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr;
diff --git a/src/util/virperf.h b/src/util/virperf.h index ac6d789..0aee1ba 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -40,6 +40,7 @@ typedef enum { for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ + VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/
Comment spacing adjustment /* Count ... frontend */ I also added the longer description to the comment.
VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index 56a6173..db76843 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -23,6 +23,7 @@ <event name='branch_instructions' enabled='yes'/> <event name='branch_misses' enabled='yes'/> <event name='bus_cycles' enabled='yes'/> + <event name='stalled_cycles_frontend' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index d844dc8..f9a6a19 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -947,8 +947,9 @@ I<--perf> returns the statistics of all enabled perf events: "perf.cache_references" - the count of cache hits, "perf.cache_misses" - the count of caches misses, "perf.branch_instructions" - the count of branch instructions, -"perf.branch_misses" - the count of branch misses -"perf.bus_cycles" - the count of bus cycles +"perf.branch_misses" - the count of branch misses,
This I moved to the previous patch...
+"perf.bus_cycles" - the count of bus cycles, +"perf.stalled_cycles_frontend" - the count of stalled cycles frontend
changed to "the count of stalled frontend cpu cycles"
See the B<perf> command for more details about each event.
@@ -2302,6 +2303,9 @@ B<Valid perf event names> by applications running on the platform. bus_cycles - Provides the count of bus cycles executed by applications running on the platform. + stalled_cycles_frontend - Provides the count of stalled cycles + frontend by applications running on + the platform.
Longer description here too
B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag.

This patch adds support and documentation for the stalled_cycles_backend perf event. Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 6 +++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 6 +++++- 10 files changed, 35 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 424b4de..6cff639 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1931,6 +1931,7 @@ <event name='branch_misses' enabled='no'/> <event name='bus_cycles' enabled='no'/> <event name='stalled_cycles_frontend' enabled='no'/> + <event name='stalled_cycles_backend' enabled='no'/> </perf> ... </pre> @@ -1996,6 +1997,11 @@ <td>the count of stalled cycles frontend by applications running on the platform</td> <td><code>perf.stalled_cycles_frontend</code></td> </tr> + <tr> + <td><code>stalled_cycles_backend</code></td> + <td>the count of stalled cycles backend by applications running on the platform</td> + <td><code>perf.stalled_cycles_backend</code></td> + </tr> </table> <h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index ea91d99..4e0a4da 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -32,7 +32,8 @@ <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed, branch misses, bus cycles, stalled cycles - frontend by applications running on the platform + frontend, stalled cycles backend by applications + running on the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 9ce7cc9..e5b5fb5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -431,6 +431,7 @@ <value>branch_misses</value> <value>bus_cycles</value> <value>stalled_cycles_frontend</value> + <value>stalled_cycles_backend</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 0741d14..86db4ae 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2165,6 +2165,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend" +/** + * VIR_PERF_PARAM_STALLED_CYCLES_BACKEND: + * + * Macro for typed parameter name that represents stalled_cycles_backend + * perf event which can be used to measure the count of stalled cycles backend + * by applications running on the platform. It corresponds to the + * "perf.stalled_cycles_backend" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 0d23d31..de865b0 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11239,6 +11239,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.stalled_cycles_frontend" - The count of stalled cycles frontend * as unsigned long long. It is produced * by stalled_cycles_frontend perf event. + * "perf.stalled_cycles_backend" - The count of stalled cycles backend + * as unsigned long long. It is produced + * by stalled_cycles_backend perf event. * * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 273dbeb..cf92e43 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9856,6 +9856,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1; diff --git a/src/util/virperf.c b/src/util/virperf.c index c21147a..c9a0e39 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -42,7 +42,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cpu_cycles", "instructions", "cache_references", "cache_misses", "branch_instructions", "branch_misses", - "bus_cycles", "stalled_cycles_frontend"); + "bus_cycles", "stalled_cycles_frontend", + "stalled_cycles_backend"); struct virPerfEvent { int type; @@ -99,6 +100,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_FRONTEND}, + {.type = VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_BACKEND}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; diff --git a/src/util/virperf.h b/src/util/virperf.h index 0aee1ba..6dfad34 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -41,6 +41,7 @@ typedef enum { VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/ + VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /*Count of stalled cycles backend*/ VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index db76843..f01d574 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -24,6 +24,7 @@ <event name='branch_misses' enabled='yes'/> <event name='bus_cycles' enabled='yes'/> <event name='stalled_cycles_frontend' enabled='yes'/> + <event name='stalled_cycles_backend' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index f9a6a19..ada1dce 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -949,7 +949,8 @@ I<--perf> returns the statistics of all enabled perf events: "perf.branch_instructions" - the count of branch instructions, "perf.branch_misses" - the count of branch misses, "perf.bus_cycles" - the count of bus cycles, -"perf.stalled_cycles_frontend" - the count of stalled cycles frontend +"perf.stalled_cycles_frontend" - the count of stalled cycles frontend, +"perf.stalled_cycles_backend" - the count of stalled cycles backend See the B<perf> command for more details about each event. @@ -2306,6 +2307,9 @@ B<Valid perf event names> stalled_cycles_frontend - Provides the count of stalled cycles frontend by applications running on the platform. + stalled_cycles_backend - Provides the count of stalled cycles + backend by applications running on + the platform. B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag. -- 1.9.3

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
This patch adds support and documentation for the stalled_cycles_backend perf event.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 6 +++++- src/util/virperf.h | 1 + tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 6 +++++- 10 files changed, 35 insertions(+), 3 deletions(-)
Similar adjustments here regarding short/longer explanations for what the field is - just used 'backend' instead of 'frontend' John
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 424b4de..6cff639 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1931,6 +1931,7 @@ <event name='branch_misses' enabled='no'/> <event name='bus_cycles' enabled='no'/> <event name='stalled_cycles_frontend' enabled='no'/> + <event name='stalled_cycles_backend' enabled='no'/> </perf> ... </pre> @@ -1996,6 +1997,11 @@ <td>the count of stalled cycles frontend by applications running on the platform</td> <td><code>perf.stalled_cycles_frontend</code></td> </tr> + <tr> + <td><code>stalled_cycles_backend</code></td> + <td>the count of stalled cycles backend by applications running on the platform</td> + <td><code>perf.stalled_cycles_backend</code></td> + </tr> </table>
<h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index ea91d99..4e0a4da 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -32,7 +32,8 @@ <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed, branch misses, bus cycles, stalled cycles - frontend by applications running on the platform + frontend, stalled cycles backend by applications + running on the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 9ce7cc9..e5b5fb5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -431,6 +431,7 @@ <value>branch_misses</value> <value>bus_cycles</value> <value>stalled_cycles_frontend</value> + <value>stalled_cycles_backend</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 0741d14..86db4ae 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2165,6 +2165,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend"
+/** + * VIR_PERF_PARAM_STALLED_CYCLES_BACKEND: + * + * Macro for typed parameter name that represents stalled_cycles_backend + * perf event which can be used to measure the count of stalled cycles backend + * by applications running on the platform. It corresponds to the + * "perf.stalled_cycles_backend" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 0d23d31..de865b0 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11239,6 +11239,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.stalled_cycles_frontend" - The count of stalled cycles frontend * as unsigned long long. It is produced * by stalled_cycles_frontend perf event. + * "perf.stalled_cycles_backend" - The count of stalled cycles backend + * as unsigned long long. It is produced + * by stalled_cycles_backend perf event. * * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 273dbeb..cf92e43 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9856,6 +9856,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BRANCH_MISSES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1;
diff --git a/src/util/virperf.c b/src/util/virperf.c index c21147a..c9a0e39 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -42,7 +42,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cpu_cycles", "instructions", "cache_references", "cache_misses", "branch_instructions", "branch_misses", - "bus_cycles", "stalled_cycles_frontend"); + "bus_cycles", "stalled_cycles_frontend", + "stalled_cycles_backend");
struct virPerfEvent { int type; @@ -99,6 +100,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_FRONTEND}, + {.type = VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_BACKEND}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr;
diff --git a/src/util/virperf.h b/src/util/virperf.h index 0aee1ba..6dfad34 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -41,6 +41,7 @@ typedef enum { VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/ + VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /*Count of stalled cycles backend*/
VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index db76843..f01d574 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -24,6 +24,7 @@ <event name='branch_misses' enabled='yes'/> <event name='bus_cycles' enabled='yes'/> <event name='stalled_cycles_frontend' enabled='yes'/> + <event name='stalled_cycles_backend' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index f9a6a19..ada1dce 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -949,7 +949,8 @@ I<--perf> returns the statistics of all enabled perf events: "perf.branch_instructions" - the count of branch instructions, "perf.branch_misses" - the count of branch misses, "perf.bus_cycles" - the count of bus cycles, -"perf.stalled_cycles_frontend" - the count of stalled cycles frontend +"perf.stalled_cycles_frontend" - the count of stalled cycles frontend, +"perf.stalled_cycles_backend" - the count of stalled cycles backend
See the B<perf> command for more details about each event.
@@ -2306,6 +2307,9 @@ B<Valid perf event names> stalled_cycles_frontend - Provides the count of stalled cycles frontend by applications running on the platform. + stalled_cycles_backend - Provides the count of stalled cycles + backend by applications running on + the platform.
B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag.

This patch adds support and documentation for the ref_cpu_cycles perf event. Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 4 ++-- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 5 ++++- src/util/virperf.h | 5 +++-- tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 5 ++++- 10 files changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6cff639..3dbd449 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1932,6 +1932,7 @@ <event name='bus_cycles' enabled='no'/> <event name='stalled_cycles_frontend' enabled='no'/> <event name='stalled_cycles_backend' enabled='no'/> + <event name='ref_cpu_cycles' enabled='no'/> </perf> ... </pre> @@ -2002,6 +2003,11 @@ <td>the count of stalled cycles backend by applications running on the platform</td> <td><code>perf.stalled_cycles_backend</code></td> </tr> + <tr> + <td><code>ref_cpu_cycles</code></td> + <td>the count of ref cpu cycles by applications running on the platform</td> + <td><code>perf.ref_cpu_cycles</code></td> + </tr> </table> <h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index 4e0a4da..21c7de1 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -32,8 +32,8 @@ <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed, branch misses, bus cycles, stalled cycles - frontend, stalled cycles backend by applications - running on the platform + frontend, stalled cycles backend and ref cpu cycles + by applications running on the platform </li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e5b5fb5..4d76315 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -432,6 +432,7 @@ <value>bus_cycles</value> <value>stalled_cycles_frontend</value> <value>stalled_cycles_backend</value> + <value>ref_cpu_cycles</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 86db4ae..1723f83 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2175,6 +2175,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend" +/** + * VIR_PERF_PARAM_REF_CPU_CYCLES: + * + * Macro for typed parameter name that represents ref_cpu_cycles + * perf event which can be used to measure the count of ref cpu cycles + * by applications running on the platform. It corresponds to the + * "perf.ref_cpu_cycles" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index de865b0..09d45c9 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11242,6 +11242,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.stalled_cycles_backend" - The count of stalled cycles backend * as unsigned long long. It is produced * by stalled_cycles_backend perf event. + * "perf.ref_cpu_cycles" - The count of ref cpu cycles as unsigned + * long long. It is produced by + * ref_cpu_cycles perf event. * * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cf92e43..398aefc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9857,6 +9857,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_REF_CPU_CYCLES, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1; diff --git a/src/util/virperf.c b/src/util/virperf.c index c9a0e39..49ec258 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -43,7 +43,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cache_references", "cache_misses", "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", - "stalled_cycles_backend"); + "stalled_cycles_backend", "ref_cpu_cycles"); struct virPerfEvent { int type; @@ -103,6 +103,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_BACKEND}, + {.type = VIR_PERF_EVENT_REF_CPU_CYCLES, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_REF_CPU_CYCLES}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; diff --git a/src/util/virperf.h b/src/util/virperf.h index 6dfad34..c002510 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -40,8 +40,9 @@ typedef enum { for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ - VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/ - VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /*Count of stalled cycles backend*/ + VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /* Count of stalled cycles frontend */ + VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /* Count of stalled cycles backend */ + VIR_PERF_EVENT_REF_CPU_CYCLES, /* Count of ref cpu cycles */ VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index f01d574..437cd65 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -25,6 +25,7 @@ <event name='bus_cycles' enabled='yes'/> <event name='stalled_cycles_frontend' enabled='yes'/> <event name='stalled_cycles_backend' enabled='yes'/> + <event name='ref_cpu_cycles' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index ada1dce..539717c 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -950,7 +950,8 @@ I<--perf> returns the statistics of all enabled perf events: "perf.branch_misses" - the count of branch misses, "perf.bus_cycles" - the count of bus cycles, "perf.stalled_cycles_frontend" - the count of stalled cycles frontend, -"perf.stalled_cycles_backend" - the count of stalled cycles backend +"perf.stalled_cycles_backend" - the count of stalled cycles backend, +"perf.ref_cpu_cycles" - the count of ref cpu cycles See the B<perf> command for more details about each event. @@ -2310,6 +2311,8 @@ B<Valid perf event names> stalled_cycles_backend - Provides the count of stalled cycles backend by applications running on the platform. + ref_cpu_cycles - Provides the count of ref cpu cycles + by applications running on the platform. B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag. -- 1.9.3

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
This patch adds support and documentation for the ref_cpu_cycles perf event.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 6 ++++++ docs/news.html.in | 4 ++-- docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 10 ++++++++++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 1 + src/util/virperf.c | 5 ++++- src/util/virperf.h | 5 +++-- tests/genericxml2xmlindata/generic-perf.xml | 1 + tools/virsh.pod | 5 ++++- 10 files changed, 35 insertions(+), 6 deletions(-)
It there some sort of "better" or "short" explanation for this counter? I looked via google, but it's not 100% clear if I could transcribe what I read. If you have something - just provide it and I can insert appropriately. Otherwise some similar comments here as before... John
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6cff639..3dbd449 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1932,6 +1932,7 @@ <event name='bus_cycles' enabled='no'/> <event name='stalled_cycles_frontend' enabled='no'/> <event name='stalled_cycles_backend' enabled='no'/> + <event name='ref_cpu_cycles' enabled='no'/> </perf> ... </pre> @@ -2002,6 +2003,11 @@ <td>the count of stalled cycles backend by applications running on the platform</td> <td><code>perf.stalled_cycles_backend</code></td> </tr> + <tr> + <td><code>ref_cpu_cycles</code></td> + <td>the count of ref cpu cycles by applications running on the platform</td> + <td><code>perf.ref_cpu_cycles</code></td> + </tr> </table>
<h3><a name="elementsDevices">Devices</a></h3> diff --git a/docs/news.html.in b/docs/news.html.in index 4e0a4da..21c7de1 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -32,8 +32,8 @@ <li>perf: Add more perf statistics<br/> Add support to get the count of branch instructions executed, branch misses, bus cycles, stalled cycles - frontend, stalled cycles backend by applications - running on the platform + frontend, stalled cycles backend and ref cpu cycles + by applications running on the platform
stalled backend cpu cycles, and ref cpu cycles
</li> </ul> </li> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e5b5fb5..4d76315 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -432,6 +432,7 @@ <value>bus_cycles</value> <value>stalled_cycles_frontend</value> <value>stalled_cycles_backend</value> + <value>ref_cpu_cycles</value> </choice> </attribute> <attribute name="enabled"> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 86db4ae..1723f83 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2175,6 +2175,16 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats); */ # define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend"
+/** + * VIR_PERF_PARAM_REF_CPU_CYCLES: + * + * Macro for typed parameter name that represents ref_cpu_cycles + * perf event which can be used to measure the count of ref cpu cycles + * by applications running on the platform. It corresponds to the + * "perf.ref_cpu_cycles" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index de865b0..09d45c9 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11242,6 +11242,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.stalled_cycles_backend" - The count of stalled cycles backend * as unsigned long long. It is produced * by stalled_cycles_backend perf event. + * "perf.ref_cpu_cycles" - The count of ref cpu cycles as unsigned + * long long. It is produced by + * ref_cpu_cycles perf event.
The extra spacing isn't required. As "neat" at it could look with everything justified under the longest "-" - everything needs to be changed and all the descriptions get spread over too many lines. Just go with "perf.value" - Explanation
* * 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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cf92e43..398aefc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9857,6 +9857,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_BUS_CYCLES, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, VIR_TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, VIR_TYPED_PARAM_BOOLEAN, + VIR_PERF_PARAM_REF_CPU_CYCLES, VIR_TYPED_PARAM_BOOLEAN, NULL) < 0) return -1;
diff --git a/src/util/virperf.c b/src/util/virperf.c index c9a0e39..49ec258 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -43,7 +43,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cache_references", "cache_misses", "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", - "stalled_cycles_backend"); + "stalled_cycles_backend", "ref_cpu_cycles");
struct virPerfEvent { int type; @@ -103,6 +103,9 @@ static struct virPerfEventAttr attrs[] = { {.type = VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, .attrType = PERF_TYPE_HARDWARE, .attrConfig = PERF_COUNT_HW_STALLED_CYCLES_BACKEND}, + {.type = VIR_PERF_EVENT_REF_CPU_CYCLES, + .attrType = PERF_TYPE_HARDWARE, + .attrConfig = PERF_COUNT_HW_REF_CPU_CYCLES}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr;
diff --git a/src/util/virperf.h b/src/util/virperf.h index 6dfad34..c002510 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -40,8 +40,9 @@ typedef enum { for applications */ VIR_PERF_EVENT_BRANCH_MISSES, /* Count of branch misses for applications */ VIR_PERF_EVENT_BUS_CYCLES, /* Count of bus cycles for applications*/ - VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /*Count of stalled cycles frontend*/ - VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /*Count of stalled cycles backend*/ + VIR_PERF_EVENT_STALLED_CYCLES_FRONTEND, /* Count of stalled cycles frontend */ + VIR_PERF_EVENT_STALLED_CYCLES_BACKEND, /* Count of stalled cycles backend */ + VIR_PERF_EVENT_REF_CPU_CYCLES, /* Count of ref cpu cycles */
VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml2xmlindata/generic-perf.xml index f01d574..437cd65 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -25,6 +25,7 @@ <event name='bus_cycles' enabled='yes'/> <event name='stalled_cycles_frontend' enabled='yes'/> <event name='stalled_cycles_backend' enabled='yes'/> + <event name='ref_cpu_cycles' enabled='yes'/> </perf> <devices> </devices> diff --git a/tools/virsh.pod b/tools/virsh.pod index ada1dce..539717c 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -950,7 +950,8 @@ I<--perf> returns the statistics of all enabled perf events: "perf.branch_misses" - the count of branch misses, "perf.bus_cycles" - the count of bus cycles, "perf.stalled_cycles_frontend" - the count of stalled cycles frontend, -"perf.stalled_cycles_backend" - the count of stalled cycles backend +"perf.stalled_cycles_backend" - the count of stalled cycles backend, +"perf.ref_cpu_cycles" - the count of ref cpu cycles
See the B<perf> command for more details about each event.
@@ -2310,6 +2311,8 @@ B<Valid perf event names> stalled_cycles_backend - Provides the count of stalled cycles backend by applications running on the platform. + ref_cpu_cycles - Provides the count of ref cpu cycles + by applications running on the platform.
B<Note>: The statistics can be retrieved using the B<domstats> command using the I<--perf> flag.

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
Add support and documentation for generic perf events like bus_cycles, stalled_cycles_frontend, stalled_cycles_backend and ref_cpu_cycles.
Nitesh Konkar (4): perf: add bus_cycles perf event support perf: add stalled_cycles_frontend perf event support perf: add stalled_cycles_backend perf event support perf: add ref_cpu_cycles perf event support
docs/formatdomain.html.in | 24 +++++++++++++++++ docs/news.html.in | 6 +++-- docs/schemas/domaincommon.rng | 4 +++ include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ src/libvirt-domain.c | 11 ++++++++ src/qemu/qemu_driver.c | 4 +++ src/util/virperf.c | 16 +++++++++++- src/util/virperf.h | 4 +++ tests/genericxml2xmlindata/generic-perf.xml | 4 +++ tools/virsh.pod | 16 +++++++++++- 10 files changed, 125 insertions(+), 4 deletions(-)
Please supply a 5/4 that would be the update to docs/news.html.in. I'll review once that's supplied. Tks - John

On 12/13/2016 11:11 AM, John Ferlan wrote:
On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
Add support and documentation for generic perf events like bus_cycles, stalled_cycles_frontend, stalled_cycles_backend and ref_cpu_cycles.
Nitesh Konkar (4): perf: add bus_cycles perf event support perf: add stalled_cycles_frontend perf event support perf: add stalled_cycles_backend perf event support perf: add ref_cpu_cycles perf event support
docs/formatdomain.html.in | 24 +++++++++++++++++ docs/news.html.in | 6 +++--
Whhoops my bad... Not sure why I missed it on my first scan/pass. John
docs/schemas/domaincommon.rng | 4 +++ include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ src/libvirt-domain.c | 11 ++++++++ src/qemu/qemu_driver.c | 4 +++ src/util/virperf.c | 16 +++++++++++- src/util/virperf.h | 4 +++ tests/genericxml2xmlindata/generic-perf.xml | 4 +++ tools/virsh.pod | 16 +++++++++++- 10 files changed, 125 insertions(+), 4 deletions(-)
Please supply a 5/4 that would be the update to docs/news.html.in. I'll review once that's supplied.
Tks -
John
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
Add support and documentation for generic perf events like bus_cycles, stalled_cycles_frontend, stalled_cycles_backend and ref_cpu_cycles.
Nitesh Konkar (4): perf: add bus_cycles perf event support perf: add stalled_cycles_frontend perf event support perf: add stalled_cycles_backend perf event support perf: add ref_cpu_cycles perf event support
docs/formatdomain.html.in | 24 +++++++++++++++++ docs/news.html.in | 6 +++-- docs/schemas/domaincommon.rng | 4 +++ include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ src/libvirt-domain.c | 11 ++++++++ src/qemu/qemu_driver.c | 4 +++ src/util/virperf.c | 16 +++++++++++- src/util/virperf.h | 4 +++ tests/genericxml2xmlindata/generic-perf.xml | 4 +++ tools/virsh.pod | 16 +++++++++++- 10 files changed, 125 insertions(+), 4 deletions(-)
As long as you're OK with my word-smithing in patches 2 & 3 regarding a longer description for those cycles values... Then these are fine and I can push them once I get the OK. If you can provide a better explanation for ref_cpu_cycles that would be fantastic. Tks - John

On Wed, Dec 14, 2016 at 4:12 AM, John Ferlan <jferlan@redhat.com> wrote:
On 12/13/2016 11:01 AM, Nitesh Konkar wrote:
Add support and documentation for generic perf events like bus_cycles, stalled_cycles_frontend, stalled_cycles_backend and ref_cpu_cycles.
Nitesh Konkar (4): perf: add bus_cycles perf event support perf: add stalled_cycles_frontend perf event support perf: add stalled_cycles_backend perf event support perf: add ref_cpu_cycles perf event support
docs/formatdomain.html.in | 24 +++++++++++++++++ docs/news.html.in | 6 +++-- docs/schemas/domaincommon.rng | 4 +++ include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ src/libvirt-domain.c | 11 ++++++++ src/qemu/qemu_driver.c | 4 +++ src/util/virperf.c | 16 +++++++++++- src/util/virperf.h | 4 +++ tests/genericxml2xmlindata/generic-perf.xml | 4 +++ tools/virsh.pod | 16 +++++++++++- 10 files changed, 125 insertions(+), 4 deletions(-)
As long as you're OK with my word-smithing in patches 2 & 3 regarding a longer description for those cycles values... Then these are fine and I can push them once I get the OK.
Makes sense. I m OK with it. Thanks!
If you can provide a better explanation for ref_cpu_cycles that would be fantastic.
Based on the below two links: http://lkml.iu.edu/hypermail/linux/kernel/1112.1/01029.html http://man7.org/linux/man-pages/man2/perf_event_open.2.html I have come up with the following two explanations. The count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform OR The count of the number of reference core cpu cycles by applications running on the platform
Tks -
John

On 12/14/2016 08:54 AM, Nitesh Konkar wrote:
On Wed, Dec 14, 2016 at 4:12 AM, John Ferlan <jferlan@redhat.com <mailto:jferlan@redhat.com>> wrote:
On 12/13/2016 11:01 AM, Nitesh Konkar wrote: > Add support and documentation for generic > perf events like bus_cycles, stalled_cycles_frontend, > stalled_cycles_backend and ref_cpu_cycles. > > Nitesh Konkar (4): > perf: add bus_cycles perf event support > perf: add stalled_cycles_frontend perf event support > perf: add stalled_cycles_backend perf event support > perf: add ref_cpu_cycles perf event support > > docs/formatdomain.html.in <http://formatdomain.html.in> | 24 +++++++++++++++++ > docs/news.html.in <http://news.html.in> | 6 +++-- > docs/schemas/domaincommon.rng | 4 +++ > include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++ > src/libvirt-domain.c | 11 ++++++++ > src/qemu/qemu_driver.c | 4 +++ > src/util/virperf.c | 16 +++++++++++- > src/util/virperf.h | 4 +++ > tests/genericxml2xmlindata/generic-perf.xml | 4 +++ > tools/virsh.pod | 16 +++++++++++- > 10 files changed, 125 insertions(+), 4 deletions(-) >
As long as you're OK with my word-smithing in patches 2 & 3 regarding a longer description for those cycles values... Then these are fine and I can push them once I get the OK.
Makes sense. I m OK with it. Thanks!
If you can provide a better explanation for ref_cpu_cycles that would be fantastic.
Based on the below two links: http://lkml.iu.edu/hypermail/linux/kernel/1112.1/01029.html http://man7.org/linux/man-pages/man2/perf_event_open.2.html
I have come up with the following two explanations.
The count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform
OR
The count of the number of reference core cpu cycles by applications running on the platform
OK - I went with the former and pushed the series John

OK - I went with the former and pushed the series
This broke the build on Debian. https://ci.centos.org/job/libvirt-master-build/systems=libvirt-debian/222/co... Erik
John
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (3)
-
Erik Skultety
-
John Ferlan
-
Nitesh Konkar