From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1487862097752441.09482794133703; Thu, 23 Feb 2017 07:01:37 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEumA3008433; Thu, 23 Feb 2017 09:56:48 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEultl028079 for ; Thu, 23 Feb 2017 09:56:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id AFB3DB7D30; Thu, 23 Feb 2017 14:56:47 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8BDE1CDD8F for ; Thu, 23 Feb 2017 14:56:47 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C00833D962 for ; Thu, 23 Feb 2017 14:56:46 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEskC0038740 for ; Thu, 23 Feb 2017 09:56:45 -0500 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 28t0auvykq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:44 -0500 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:40 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:38 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 2AC1F2CE8054; Fri, 24 Feb 2017 01:56:38 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuU9D47382648; Fri, 24 Feb 2017 01:56:38 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEu5jb027475; Fri, 24 Feb 2017 01:56:06 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu196027181; Fri, 24 Feb 2017 01:56:04 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:30 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0008-0000-0000-0000010E283E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0009-0000-0000-0000091C9396 Message-Id: <1487861739-24929-2-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:46 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 01/10] perf: add cpu_clock software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the cpu_clock perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 8 ++++++++ docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 11 +++++++++++ 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 +++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 02ce792..403932b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1936,6 +1936,7 @@ <event name=3D'stalled_cycles_frontend' enabled=3D'no'/> <event name=3D'stalled_cycles_backend' enabled=3D'no'/> <event name=3D'ref_cpu_cycles' enabled=3D'no'/> + <event name=3D'cpu_clock' enabled=3D'no'/> </perf> ... @@ -2014,6 +2015,13 @@ by applications running on the platform perf.ref_cpu_cycles + + cpu_clock + the count of cpu clock time, as measured by a monotonic + high-resolution per-CPU timer, by applications running on + the platform + perf.cpu_clock + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index c64544a..8f52830 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -433,6 +433,7 @@ stalled_cycles_frontend stalled_cycles_backend ref_cpu_cycles + cpu_clock diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index c0f715d..d594121 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2188,6 +2188,17 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" =20 +/** + * VIR_PERF_PARAM_CPU_CLOCK: + * + * Macro for typed parameter name that represents cpu_clock + * perf event which can be used to measure the count of cpu + * clock time by applications running on the platform. It + * corresponds to the "perf.cpu_clock" field in the *Stats + * APIs. + */ +# define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 619a9fc..427101f 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11250,6 +11250,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * CPU frequency scaling by applications runni= ng * as unsigned long long. It is produced by the * ref_cpu_cycles perf event. + * "perf.cpu_clock" - The count of cpu clock time as unsigned long lon= g. + * It is produced by the cpu_clock 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 6e1e3d4..d64db3f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9569,6 +9569,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, 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_PA= RAM_BOOLEAN, + VIR_PERF_PARAM_CPU_CLOCK, VIR_TYPED_PARAM_B= OOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 4493608..2d6cbbb 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -43,7 +43,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cache_references", "cache_misses", "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", - "stalled_cycles_backend", "ref_cpu_cycles"); + "stalled_cycles_backend", "ref_cpu_cycles", + "cpu_clock"); =20 struct virPerfEvent { int type; @@ -112,6 +113,9 @@ static struct virPerfEventAttr attrs[] =3D { .attrConfig =3D 0, # endif }, + {.type =3D VIR_PERF_EVENT_CPU_CLOCK, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_CPU_CLOCK}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 1f43c92..8a7270c 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -47,6 +47,7 @@ typedef enum { the backend of the instructi= on processor pipeline */ VIR_PERF_EVENT_REF_CPU_CYCLES, /* Count of ref cpu cycles */ + VIR_PERF_EVENT_CPU_CLOCK, /* Count of cpu clock time*/ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 437cd65..3e7834e 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -26,6 +26,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 6c06ee0..b672679 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -964,6 +964,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.stalled_cycles_backend" - the count of stalled backend cpu cycles "perf.ref_cpu_cycles" - the count of ref cpu cycles + "perf.cpu_clock" - the count of cpu clock time =20 See the B command for more details about each event. =20 @@ -2333,6 +2334,8 @@ B ref_cpu_cycles - Provides the count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform. + cpu_clock - Provides the cpu clock time consumed by + applications running on the platform. =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1487862021836513.6413343217364; Thu, 23 Feb 2017 07:00:21 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEupGd004088; Thu, 23 Feb 2017 09:56:51 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEunCm028087 for ; Thu, 23 Feb 2017 09:56:49 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEunm5020272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:49 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91E46C05678E for ; Thu, 23 Feb 2017 14:56:48 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEskJA036459 for ; Thu, 23 Feb 2017 09:56:47 -0500 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0b-001b2d01.pphosted.com with ESMTP id 28sw9b4ynx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:46 -0500 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:44 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:41 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id CD05B2CE8046; Fri, 24 Feb 2017 01:56:40 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuWB248431216; Fri, 24 Feb 2017 01:56:40 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEu8TL027507; Fri, 24 Feb 2017 01:56:08 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu197027181; Fri, 24 Feb 2017 01:56:07 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:31 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0008-0000-0000-0000010E283F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0009-0000-0000-0000091C9399 Message-Id: <1487861739-24929-3-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 23 Feb 2017 14:56:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 23 Feb 2017 14:56:48 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 02/10] perf: add task_clock software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the task_clock perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 8 ++++++++ docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 11 +++++++++++ src/libvirt-domain.c | 2 ++ 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 | 3 +++ 9 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 403932b..2840e3c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1937,6 +1937,7 @@ <event name=3D'stalled_cycles_backend' enabled=3D'no'/> <event name=3D'ref_cpu_cycles' enabled=3D'no'/> <event name=3D'cpu_clock' enabled=3D'no'/> + <event name=3D'task_clock' enabled=3D'no'/> </perf> ... @@ -2022,6 +2023,13 @@ the platform perf.cpu_clock + + task_clock + the count of task clock time, as measured by a monotonic + high-resolution CPU timer, specific to the task that + is run by applications running on the platform + perf.task_clock + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8f52830..64b5bfc 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -434,6 +434,7 @@ stalled_cycles_backend ref_cpu_cycles cpu_clock + task_clock
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index d594121..2495c90 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2199,6 +2199,17 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock" =20 +/** + * VIR_PERF_PARAM_TASK_CLOCK: + * + * Macro for typed parameter name that represents task_clock + * perf event which can be used to measure the count of task + * clock time by applications running on the platform. It + * corresponds to the "perf.task_clock" field in the *Stats + * APIs. + */ +# define VIR_PERF_PARAM_TASK_CLOCK "task_clock" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 427101f..c3db338 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11252,6 +11252,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * ref_cpu_cycles perf event. * "perf.cpu_clock" - The count of cpu clock time as unsigned long lon= g. * It is produced by the cpu_clock perf event. + * "perf.task_clock" - The count of task clock time as unsigned long l= ong. + * It is produced by the task_clock 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 d64db3f..fdbb84b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9570,6 +9570,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, VIR_= TYPED_PARAM_BOOLEAN, VIR_PERF_PARAM_REF_CPU_CYCLES, VIR_TYPED_PA= RAM_BOOLEAN, VIR_PERF_PARAM_CPU_CLOCK, VIR_TYPED_PARAM_B= OOLEAN, + VIR_PERF_PARAM_TASK_CLOCK, VIR_TYPED_PARAM_= BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 2d6cbbb..16301fd 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -44,7 +44,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", "stalled_cycles_backend", "ref_cpu_cycles", - "cpu_clock"); + "cpu_clock", "task_clock"); =20 struct virPerfEvent { int type; @@ -116,6 +116,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_CPU_CLOCK, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_CPU_CLOCK}, + {.type =3D VIR_PERF_EVENT_TASK_CLOCK, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_TASK_CLOCK}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 8a7270c..bfff8fc 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -48,6 +48,7 @@ typedef enum { processor pipeline */ VIR_PERF_EVENT_REF_CPU_CYCLES, /* Count of ref cpu cycles */ VIR_PERF_EVENT_CPU_CLOCK, /* Count of cpu clock time*/ + VIR_PERF_EVENT_TASK_CLOCK, /* Count of task clock time*/ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 3e7834e..5ebc0a2 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -27,6 +27,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index b672679..b91b9a4 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -965,6 +965,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: cpu cycles "perf.ref_cpu_cycles" - the count of ref cpu cycles "perf.cpu_clock" - the count of cpu clock time + "perf.task_clock" - the count of task clock time =20 See the B command for more details about each event. =20 @@ -2336,6 +2337,8 @@ B applications running on the platform. cpu_clock - Provides the cpu clock time consumed by applications running on the platform. + task_clock - Provides the task clock time consumed by + applications running on the platform. =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487862161523405.6106158018953; Thu, 23 Feb 2017 07:02:41 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEvh2r015217; Thu, 23 Feb 2017 09:57:43 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEupgZ028103 for ; Thu, 23 Feb 2017 09:56:51 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEupwP027140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:51 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF3803D962 for ; Thu, 23 Feb 2017 14:56:50 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEt7fF046609 for ; Thu, 23 Feb 2017 09:56:49 -0500 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 28swwxbebh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:48 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:45 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:43 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id B6CB33578052; Fri, 24 Feb 2017 01:56:42 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuYf814352522; Fri, 24 Feb 2017 01:56:42 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuAtu027531; Fri, 24 Feb 2017 01:56:10 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu198027181; Fri, 24 Feb 2017 01:56:09 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:32 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0040-0000-0000-000002F327BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0041-0000-0000-00000C4C79C4 Message-Id: <1487861739-24929-4-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:51 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 03/10] perf: add page_faults software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the page_faults perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 8 ++++++++ docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 11 +++++++++++ src/libvirt-domain.c | 2 ++ 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 | 3 +++ 9 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2840e3c..72d33fa 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1938,6 +1938,7 @@ <event name=3D'ref_cpu_cycles' enabled=3D'no'/> <event name=3D'cpu_clock' enabled=3D'no'/> <event name=3D'task_clock' enabled=3D'no'/> + <event name=3D'page_faults' enabled=3D'no'/> </perf> ... @@ -2030,6 +2031,13 @@ is run by applications running on the platform perf.task_clock + + page_faults + the count of page faults by applications running on the + platform. This includes minor, major, invalid and other + types of page faults + perf.page_faults + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 64b5bfc..856a2f7 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -435,6 +435,7 @@ ref_cpu_cycles cpu_clock task_clock + page_faults
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 2495c90..1a6cb19 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2210,6 +2210,17 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_TASK_CLOCK "task_clock" =20 +/** +* VIR_PERF_PARAM_PAGE_FAULTS: +* +* Macro for typed parameter name that represents page_faults +* perf event which can be used to measure the count of page +* faults by applications running on the platform. It corresponds +* to the "perf.page_faults" field in the *Stats APIs. +*/ +# define VIR_PERF_PARAM_PAGE_FAULTS "page_faults" + + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index c3db338..77c6e8a 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11254,6 +11254,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * It is produced by the cpu_clock perf event. * "perf.task_clock" - The count of task clock time as unsigned long l= ong. * It is produced by the task_clock perf event. + * "perf.page_faults" - The count of page faults as unsigned long long. + * It is produced by the page_faults 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 fdbb84b..10d4e59 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9571,6 +9571,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_REF_CPU_CYCLES, VIR_TYPED_PA= RAM_BOOLEAN, VIR_PERF_PARAM_CPU_CLOCK, VIR_TYPED_PARAM_B= OOLEAN, VIR_PERF_PARAM_TASK_CLOCK, VIR_TYPED_PARAM_= BOOLEAN, + VIR_PERF_PARAM_PAGE_FAULTS, VIR_TYPED_PARAM= _BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 16301fd..4ae13af 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -44,7 +44,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", "stalled_cycles_backend", "ref_cpu_cycles", - "cpu_clock", "task_clock"); + "cpu_clock", "task_clock", "page_faults"); =20 struct virPerfEvent { int type; @@ -119,6 +119,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_TASK_CLOCK, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_TASK_CLOCK}, + {.type =3D VIR_PERF_EVENT_PAGE_FAULTS, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index bfff8fc..182a9ec 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -49,6 +49,7 @@ typedef enum { VIR_PERF_EVENT_REF_CPU_CYCLES, /* Count of ref cpu cycles */ VIR_PERF_EVENT_CPU_CLOCK, /* Count of cpu clock time*/ VIR_PERF_EVENT_TASK_CLOCK, /* Count of task clock time*/ + VIR_PERF_EVENT_PAGE_FAULTS, /* Count of total page faults */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 5ebc0a2..3f27887 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -28,6 +28,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index b91b9a4..81fd0fb 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -966,6 +966,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.ref_cpu_cycles" - the count of ref cpu cycles "perf.cpu_clock" - the count of cpu clock time "perf.task_clock" - the count of task clock time + "perf.page_faults" - the count of page faults =20 See the B command for more details about each event. =20 @@ -2339,6 +2340,8 @@ B applications running on the platform. task_clock - Provides the task clock time consumed by applications running on the platform. + page_faults - Provides the count of page faults by + applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1487862166272290.23154909823495; Thu, 23 Feb 2017 07:02:46 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEvhwJ004145; Thu, 23 Feb 2017 09:57:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEupl5028098 for ; Thu, 23 Feb 2017 09:56:51 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEupMJ005965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:51 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EBB1C04BD28 for ; Thu, 23 Feb 2017 14:56:50 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEspqg093143 for ; Thu, 23 Feb 2017 09:56:49 -0500 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 28sku98sdf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:48 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:46 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:44 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 5DD1E2CE8054; Fri, 24 Feb 2017 01:56:44 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuaKd9633792; Fri, 24 Feb 2017 01:56:44 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuBdl027591; Fri, 24 Feb 2017 01:56:12 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu199027181; Fri, 24 Feb 2017 01:56:11 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:33 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0040-0000-0000-000002F327BE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0041-0000-0000-00000C4C79C6 Message-Id: <1487861739-24929-5-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:56:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:56:50 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 04/10] perf: add context_switches software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the context_switches perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 7 +++++++ 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 | 3 +++ 9 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 72d33fa..bff699f 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1939,6 +1939,7 @@ <event name=3D'cpu_clock' enabled=3D'no'/> <event name=3D'task_clock' enabled=3D'no'/> <event name=3D'page_faults' enabled=3D'no'/> + <event name=3D'context_switches' enabled=3D'no'/> </perf> ... @@ -2038,6 +2039,12 @@ types of page faults perf.page_faults + + context_switches + the count of context switches by applications running on + the platform + perf.context_switches + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 856a2f7..1a4b6cb 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -436,6 +436,7 @@ cpu_clock task_clock page_faults + context_switches
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 1a6cb19..f7e4cd2 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2220,6 +2220,16 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_PAGE_FAULTS "page_faults" =20 +/** + * 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" + =20 int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 77c6e8a..6b29d14 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11256,6 +11256,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * It is produced by the task_clock perf event. * "perf.page_faults" - The count of page faults as unsigned long long. * It is produced by the page_faults perf event + * "perf.context_switches" - The count of context switches as unsigned= long + * long. It is produced by the context_switc= hes + * 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 10d4e59..8d6df1a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9572,6 +9572,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_CPU_CLOCK, VIR_TYPED_PARAM_B= OOLEAN, VIR_PERF_PARAM_TASK_CLOCK, VIR_TYPED_PARAM_= BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS, VIR_TYPED_PARAM= _BOOLEAN, + VIR_PERF_PARAM_CONTEXT_SWITCHES, VIR_TYPED_= PARAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 4ae13af..ba81e08 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -44,7 +44,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "branch_instructions", "branch_misses", "bus_cycles", "stalled_cycles_frontend", "stalled_cycles_backend", "ref_cpu_cycles", - "cpu_clock", "task_clock", "page_faults"); + "cpu_clock", "task_clock", "page_faults", + "context_switches"); =20 struct virPerfEvent { int type; @@ -122,6 +123,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_PAGE_FAULTS, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS}, + {.type =3D VIR_PERF_EVENT_CONTEXT_SWITCHES, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_CONTEXT_SWITCHES}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 182a9ec..2adc549 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -50,6 +50,7 @@ typedef enum { VIR_PERF_EVENT_CPU_CLOCK, /* Count of cpu clock time*/ VIR_PERF_EVENT_TASK_CLOCK, /* Count of task clock time*/ VIR_PERF_EVENT_PAGE_FAULTS, /* Count of total page faults */ + VIR_PERF_EVENT_CONTEXT_SWITCHES, /* Count of context switches */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 3f27887..29a2273 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -29,6 +29,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 81fd0fb..eb7c255 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -967,6 +967,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.cpu_clock" - the count of cpu clock time "perf.task_clock" - the count of task clock time "perf.page_faults" - the count of page faults + "perf.context_switches" - the count of context switches. =20 See the B command for more details about each event. =20 @@ -2342,6 +2343,8 @@ B applications running on the platform. page_faults - Provides the count of page faults by applications running on the platform + context_switches - Provides the count of context switches + by applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1487862170319545.317425081529; Thu, 23 Feb 2017 07:02:50 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEvluD008531; Thu, 23 Feb 2017 09:57:47 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEuuAJ028125 for ; Thu, 23 Feb 2017 09:56:56 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEuufB015601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:56 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4A584DD4B for ; Thu, 23 Feb 2017 14:56:54 +0000 (UTC) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEsmtU051646 for ; Thu, 23 Feb 2017 09:56:53 -0500 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0a-001b2d01.pphosted.com with ESMTP id 28swyp3e6w-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:52 -0500 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:50 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:47 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 79E0B2CE8056; Fri, 24 Feb 2017 01:56:46 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuclN41091146; Fri, 24 Feb 2017 01:56:46 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuEMl027647; Fri, 24 Feb 2017 01:56:14 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19A027181; Fri, 24 Feb 2017 01:56:12 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:34 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0052-0000-0000-0000021A2B51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0053-0000-0000-000007D58ED1 Message-Id: <1487861739-24929-6-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Feb 2017 14:56:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Feb 2017 14:56:55 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 05/10] perf: add cpu_migrations software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the cpu_migrations perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 8 ++++++++ docs/schemas/domaincommon.rng | 1 + include/libvirt/libvirt-domain.h | 9 +++++++++ src/libvirt-domain.c | 4 ++++ 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 | 3 +++ 9 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index bff699f..49f1e5e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1940,6 +1940,7 @@ <event name=3D'task_clock' enabled=3D'no'/> <event name=3D'page_faults' enabled=3D'no'/> <event name=3D'context_switches' enabled=3D'no'/> + <event name=3D'cpu_migrations' enabled=3D'no'/> </perf> ... @@ -2045,6 +2046,13 @@ the platform perf.context_switches + + cpu_migrations + the count of cpu migrations, that is, where the process + moved from one logical processor to another, by + applications running on the platform + perf.cpu_migrations + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1a4b6cb..a14b18a 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -437,6 +437,7 @@ task_clock page_faults context_switches + cpu_migrations
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index f7e4cd2..7e24f50 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2230,6 +2230,15 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches" =20 +/** + * VIR_PERF_PARAM_CPU_MIGRATIONS: + * + * Macro for typed parameter name that represents cpu_migrations + * perf event which can be used to measure the count of cpu + * migrations by applications running on the platform. It corresponds + * to the "perf.cpu_migrations" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations" =20 int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 6b29d14..27be5cd 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11259,6 +11259,10 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.context_switches" - The count of context switches as unsigned= long * long. It is produced by the context_switc= hes * perf event. + * "perf.cpu_migrations" - The count of cpu migrations, from one logic= al + * processor to another, as unsigned long + * long. It is produced by the cpu_migrations + * 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 8d6df1a..640d06b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9573,6 +9573,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_TASK_CLOCK, VIR_TYPED_PARAM_= BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS, VIR_TYPED_PARAM= _BOOLEAN, VIR_PERF_PARAM_CONTEXT_SWITCHES, VIR_TYPED_= PARAM_BOOLEAN, + VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PA= RAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index ba81e08..0127c82 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -45,7 +45,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "bus_cycles", "stalled_cycles_frontend", "stalled_cycles_backend", "ref_cpu_cycles", "cpu_clock", "task_clock", "page_faults", - "context_switches"); + "context_switches", "cpu_migrations"); =20 struct virPerfEvent { int type; @@ -126,6 +126,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_CONTEXT_SWITCHES, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_CONTEXT_SWITCHES}, + {.type =3D VIR_PERF_EVENT_CPU_MIGRATIONS, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_CPU_MIGRATIONS}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 2adc549..90ae007 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -51,6 +51,7 @@ typedef enum { VIR_PERF_EVENT_TASK_CLOCK, /* Count of task clock time*/ VIR_PERF_EVENT_PAGE_FAULTS, /* Count of total page faults */ VIR_PERF_EVENT_CONTEXT_SWITCHES, /* Count of context switches */ + VIR_PERF_EVENT_CPU_MIGRATIONS, /* Count of cpu migrations */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 29a2273..f856318 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -30,6 +30,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index eb7c255..65532b9 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -968,6 +968,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.task_clock" - the count of task clock time "perf.page_faults" - the count of page faults "perf.context_switches" - the count of context switches. + "perf.cpu_migrations" - the count of cpu migrations =20 See the B command for more details about each event. =20 @@ -2345,6 +2346,8 @@ B applications running on the platform context_switches - Provides the count of context switches by applications running on the platform + cpu_migrations - Provides the count cpu migrations by + applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487862100888510.8493686061705; Thu, 23 Feb 2017 07:01:40 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEwLsp015585; Thu, 23 Feb 2017 09:58:21 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEuu7G028130 for ; Thu, 23 Feb 2017 09:56:56 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEuuTA027183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:56 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD1963D959 for ; Thu, 23 Feb 2017 14:56:55 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEslpd114309 for ; Thu, 23 Feb 2017 09:56:54 -0500 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 28svjuxy53-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:54 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:51 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:48 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 2AE062CE8059; Fri, 24 Feb 2017 01:56:48 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuege49741962; Fri, 24 Feb 2017 01:56:48 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuFUF027716; Fri, 24 Feb 2017 01:56:16 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19B027181; Fri, 24 Feb 2017 01:56:14 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:35 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0040-0000-0000-000002F327C0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0041-0000-0000-00000C4C79CC Message-Id: <1487861739-24929-7-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 14:56:55 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 06/10] perf: add page_faults_min software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the page_faults_min perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 9 +++++++++ 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 | 3 +++ 9 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 49f1e5e..0d2834b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1941,6 +1941,7 @@ <event name=3D'page_faults' enabled=3D'no'/> <event name=3D'context_switches' enabled=3D'no'/> <event name=3D'cpu_migrations' enabled=3D'no'/> + <event name=3D'page_faults_min' enabled=3D'no'/> </perf> ... @@ -2053,6 +2054,14 @@ applications running on the platform perf.cpu_migrations + + page_faults_min + the count of minor page faults, that is, where the + page was present in the page cache, and therefore + the fault avoided loading it from storage, by + applications running on the platform + perf.page_faults_min + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a14b18a..b8914d5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -438,6 +438,7 @@ page_faults context_switches cpu_migrations + page_faults_min
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 7e24f50..b7e6c71 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2240,6 +2240,16 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations" =20 +/** + * VIR_PERF_PARAM_PAGE_FAULTS_MIN: + * + * Macro for typed parameter name that represents page_faults_min + * perf event which can be used to measure the count of minor page + * faults by applications running on the platform. It corresponds + * to the "perf.page_faults_min" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 27be5cd..2e95532 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11263,6 +11263,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * processor to another, as unsigned long * long. It is produced by the cpu_migrations * perf event. + * "perf.page_faults_min" - The count of minor page faults as unsigned + * long long. It is produced by the + * page_faults_min 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 640d06b..8523e1f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9574,6 +9574,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_PAGE_FAULTS, VIR_TYPED_PARAM= _BOOLEAN, VIR_PERF_PARAM_CONTEXT_SWITCHES, VIR_TYPED_= PARAM_BOOLEAN, VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PA= RAM_BOOLEAN, + VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_P= ARAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 0127c82..9e41df9 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -45,7 +45,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "bus_cycles", "stalled_cycles_frontend", "stalled_cycles_backend", "ref_cpu_cycles", "cpu_clock", "task_clock", "page_faults", - "context_switches", "cpu_migrations"); + "context_switches", "cpu_migrations", + "page_faults_min"); =20 struct virPerfEvent { int type; @@ -129,6 +130,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_CPU_MIGRATIONS, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_CPU_MIGRATIONS}, + {.type =3D VIR_PERF_EVENT_PAGE_FAULTS_MIN, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS_MIN}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 90ae007..aa90273 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -52,6 +52,7 @@ typedef enum { VIR_PERF_EVENT_PAGE_FAULTS, /* Count of total page faults */ VIR_PERF_EVENT_CONTEXT_SWITCHES, /* Count of context switches */ VIR_PERF_EVENT_CPU_MIGRATIONS, /* Count of cpu migrations */ + VIR_PERF_EVENT_PAGE_FAULTS_MIN, /* Count of minor page faults */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index f856318..62ad973 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -31,6 +31,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 65532b9..6194aaf 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -969,6 +969,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.page_faults" - the count of page faults "perf.context_switches" - the count of context switches. "perf.cpu_migrations" - the count of cpu migrations + "perf.page_faults_min" - the count of minor page faults =20 See the B command for more details about each event. =20 @@ -2348,6 +2349,8 @@ B by applications running on the platform cpu_migrations - Provides the count cpu migrations by applications running on the platform + page_faults_min - Provides the count minor page faults + by applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487862168280280.26156532114453; Thu, 23 Feb 2017 07:02:48 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEx0rQ015651; Thu, 23 Feb 2017 09:59:00 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEuwB6028138 for ; Thu, 23 Feb 2017 09:56:58 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEuwkg005344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:56:58 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CC45C04BD4F for ; Thu, 23 Feb 2017 14:56:57 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEskBE036468 for ; Thu, 23 Feb 2017 09:56:55 -0500 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 28sw9b4yua-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:55 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:52 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:50 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id F11DA2BB0057; Fri, 24 Feb 2017 01:56:49 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEufLI35979506; Fri, 24 Feb 2017 01:56:49 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuHUH027760; Fri, 24 Feb 2017 01:56:17 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19C027181; Fri, 24 Feb 2017 01:56:16 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:36 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0040-0000-0000-000002F327C1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0041-0000-0000-00000C4C79CF Message-Id: <1487861739-24929-8-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:56:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:56:57 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 07/10] perf: add page_faults_maj software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the page_faults_maj perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 9 +++++++++ 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 | 3 +++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0d2834b..3d94441 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1942,6 +1942,7 @@ <event name=3D'context_switches' enabled=3D'no'/> <event name=3D'cpu_migrations' enabled=3D'no'/> <event name=3D'page_faults_min' enabled=3D'no'/> + <event name=3D'page_faults_maj' enabled=3D'no'/> </perf> ... @@ -2062,6 +2063,14 @@ applications running on the platform perf.page_faults_min + + page_faults_maj + the count of major page faults, that is, where the + page was not present in the page cache, and + therefore had to be fetched from storage, by + applications running on the platform + perf.page_faults_maj + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index b8914d5..82327c6 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -439,6 +439,7 @@ context_switches cpu_migrations page_faults_min + page_faults_maj
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index b7e6c71..f6e5c5a 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2250,6 +2250,16 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min" =20 +/** + * VIR_PERF_PARAM_PAGE_FAULTS_MAJ: + * + * Macro for typed parameter name that represents page_faults_maj + * perf event which can be used to measure the count of major page + * faults by applications running on the platform. It corresponds + * to the "perf.page_faults_maj" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 2e95532..21f91de 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11266,6 +11266,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.page_faults_min" - The count of minor page faults as unsigned * long long. It is produced by the * page_faults_min perf event. + * "perf.page_faults_maj" - The count of major page faults as unsigned + * long long. It is produced by the + * page_faults_maj 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 8523e1f..5448119 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9575,6 +9575,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_CONTEXT_SWITCHES, VIR_TYPED_= PARAM_BOOLEAN, VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PA= RAM_BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_P= ARAM_BOOLEAN, + VIR_PERF_PARAM_PAGE_FAULTS_MAJ, VIR_TYPED_P= ARAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 9e41df9..b3dd5c7 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -46,7 +46,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "stalled_cycles_backend", "ref_cpu_cycles", "cpu_clock", "task_clock", "page_faults", "context_switches", "cpu_migrations", - "page_faults_min"); + "page_faults_min", "page_faults_maj"); =20 struct virPerfEvent { int type; @@ -133,6 +133,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_PAGE_FAULTS_MIN, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS_MIN}, + {.type =3D VIR_PERF_EVENT_PAGE_FAULTS_MAJ, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS_MAJ}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index aa90273..49d4ba7 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -53,6 +53,7 @@ typedef enum { VIR_PERF_EVENT_CONTEXT_SWITCHES, /* Count of context switches */ 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_MAJ, /* Count of major page faults */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index 62ad973..a5b6dfb 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -32,6 +32,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 6194aaf..18282f8 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -970,6 +970,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.context_switches" - the count of context switches. "perf.cpu_migrations" - the count of cpu migrations "perf.page_faults_min" - the count of minor page faults + "perf.page_faults_maj" - the count of major page faults =20 See the B command for more details about each event. =20 @@ -2351,6 +2352,8 @@ B applications running on the platform page_faults_min - Provides the count minor page faults by applications running on the platform + page_faults_maj - Provides the count major page faults + by applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1487862196751378.2680123971901; Thu, 23 Feb 2017 07:03:16 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NExcrp002369; Thu, 23 Feb 2017 09:59:38 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEv0HB028149 for ; Thu, 23 Feb 2017 09:57:00 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEv0Od020443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:57:00 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B47854E4D9 for ; Thu, 23 Feb 2017 14:56:59 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEt9oY044129 for ; Thu, 23 Feb 2017 09:56:58 -0500 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0b-001b2d01.pphosted.com with ESMTP id 28t1a1j0wu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:57 -0500 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:53 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:52 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 926D33578052; Fri, 24 Feb 2017 01:56:51 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEuhHU13697078; Fri, 24 Feb 2017 01:56:51 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuJEB027780; Fri, 24 Feb 2017 01:56:19 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19D027181; Fri, 24 Feb 2017 01:56:18 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:37 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0004-0000-0000-000001E45478 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0005-0000-0000-000009B8FAD1 Message-Id: <1487861739-24929-9-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Feb 2017 14:56:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Feb 2017 14:56:59 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 08/10] perf: add alignment_faults software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the alignment_faults perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 8 ++++++++ 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 | 3 +++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3d94441..3761a5d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1943,6 +1943,7 @@ <event name=3D'cpu_migrations' enabled=3D'no'/> <event name=3D'page_faults_min' enabled=3D'no'/> <event name=3D'page_faults_maj' enabled=3D'no'/> + <event name=3D'alignment_faults' enabled=3D'no'/> </perf> ... @@ -2071,6 +2072,13 @@ applications running on the platform perf.page_faults_maj + + alignment_faults + the count of alignment faults, that is when + the load or store is not aligned properly, by + applications running on the platform + perf.alignment_faults + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 82327c6..1f0c729 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -440,6 +440,7 @@ cpu_migrations page_faults_min page_faults_maj + alignment_faults
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index f6e5c5a..0c0fb18 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2260,6 +2260,16 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj" =20 +/** + * 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, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 21f91de..336e172 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11269,6 +11269,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.page_faults_maj" - The count of major page faults as unsigned * long long. It is produced by the * 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 * 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 5448119..c58c7b0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9576,6 +9576,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_CPU_MIGRATIONS, VIR_TYPED_PA= RAM_BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_P= ARAM_BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS_MAJ, VIR_TYPED_P= ARAM_BOOLEAN, + VIR_PERF_PARAM_ALIGNMENT_FAULTS, VIR_TYPED_= PARAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index b3dd5c7..3f01596 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -46,7 +46,8 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "stalled_cycles_backend", "ref_cpu_cycles", "cpu_clock", "task_clock", "page_faults", "context_switches", "cpu_migrations", - "page_faults_min", "page_faults_maj"); + "page_faults_min", "page_faults_maj", + "alignment_faults"); =20 struct virPerfEvent { int type; @@ -136,6 +137,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_PAGE_FAULTS_MAJ, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_PAGE_FAULTS_MAJ}, + {.type =3D VIR_PERF_EVENT_ALIGNMENT_FAULTS, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_ALIGNMENT_FAULTS}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 49d4ba7..4e46460 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -54,6 +54,7 @@ typedef enum { 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_MAJ, /* Count of major page faults */ + VIR_PERF_EVENT_ALIGNMENT_FAULTS, /* Count of alignment faults */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index a5b6dfb..b48f96c 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -33,6 +33,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 18282f8..123b701 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -971,6 +971,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.cpu_migrations" - the count of cpu migrations "perf.page_faults_min" - the count of minor page faults "perf.page_faults_maj" - the count of major page faults + "perf.alignment_faults" - the count of alignment faults =20 See the B command for more details about each event. =20 @@ -2354,6 +2355,8 @@ B by applications running on the platform page_faults_maj - Provides the count major page faults by applications running on the platform + alignment_faults - Provides the count alignment faults + by applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487862103731337.71434458557974; Thu, 23 Feb 2017 07:01:43 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEwLtH015584; Thu, 23 Feb 2017 09:58:21 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEv1K8028159 for ; Thu, 23 Feb 2017 09:57:01 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEv1pq027299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:57:01 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB588C04BD28 for ; Thu, 23 Feb 2017 14:57:00 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEslhc114351 for ; Thu, 23 Feb 2017 09:56:59 -0500 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0a-001b2d01.pphosted.com with ESMTP id 28svjuxy94-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:56:59 -0500 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:56 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:54 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 9361C2BB0055; Fri, 24 Feb 2017 01:56:53 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEujNh55050428; Fri, 24 Feb 2017 01:56:53 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuKj3027817; Fri, 24 Feb 2017 01:56:21 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19E027181; Fri, 24 Feb 2017 01:56:20 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:38 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0016-0000-0000-0000021D32A0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0017-0000-0000-00000678CA3C Message-Id: <1487861739-24929-10-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:57:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Feb 2017 14:57:00 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH v2 09/10] perf: add emulation_faults software perf event support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support and documentation for the emulation_faults perf event. Signed-off-by: Nitesh Konkar --- docs/formatdomain.html.in | 9 +++++++++ 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 | 3 +++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3761a5d..8891ed9 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1944,6 +1944,7 @@ <event name=3D'page_faults_min' enabled=3D'no'/> <event name=3D'page_faults_maj' enabled=3D'no'/> <event name=3D'alignment_faults' enabled=3D'no'/> + <event name=3D'emulation_faults' enabled=3D'no'/> </perf> ... @@ -2079,6 +2080,14 @@ applications running on the platform perf.alignment_faults + + emulation_faults + the count of emulation faults, that is when + the kernel traps on unimplemented instrucions + and emulates them for user space, by + applications running on the platform + perf.emulation_faults + =20

Devices

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1f0c729..1860f90 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -441,6 +441,7 @@ page_faults_min page_faults_maj alignment_faults + emulation_faults
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 0c0fb18..c490d71 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2270,6 +2270,16 @@ void virDomainStatsRecordListFree(virDomainStatsReco= rdPtr *stats); */ # define VIR_PERF_PARAM_ALIGNMENT_FAULTS "alignment_faults" =20 +/** + * VIR_PERF_PARAM_EMULATION_FAULTS: + * + * Macro for typed parameter name that represents emulation_faults + * perf event which can be used to measure the count of emulation + * faults by applications running on the platform. It corresponds + * to the "perf.emulation_faults" field in the *Stats APIs. + */ +# define VIR_PERF_PARAM_EMULATION_FAULTS "emulation_faults" + int virDomainGetPerfEvents(virDomainPtr dom, virTypedParameterPtr *params, int *nparams, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 336e172..5088f47 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11272,6 +11272,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * "perf.alignment_faults" - The count of alignment faults as unsigned * long long. It is produced by the * alignment_faults perf event + * "perf.emulation_faults" - The count of emulation faults as unsigned + * long long. It is produced by the + * emulation_faults 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 c58c7b0..51d0b5f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9577,6 +9577,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, VIR_PERF_PARAM_PAGE_FAULTS_MIN, VIR_TYPED_P= ARAM_BOOLEAN, VIR_PERF_PARAM_PAGE_FAULTS_MAJ, VIR_TYPED_P= ARAM_BOOLEAN, VIR_PERF_PARAM_ALIGNMENT_FAULTS, VIR_TYPED_= PARAM_BOOLEAN, + VIR_PERF_PARAM_EMULATION_FAULTS, VIR_TYPED_= PARAM_BOOLEAN, NULL) < 0) return -1; =20 diff --git a/src/util/virperf.c b/src/util/virperf.c index 3f01596..e39cebb 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -47,7 +47,7 @@ VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST, "cpu_clock", "task_clock", "page_faults", "context_switches", "cpu_migrations", "page_faults_min", "page_faults_maj", - "alignment_faults"); + "alignment_faults", "emulation_faults"); =20 struct virPerfEvent { int type; @@ -140,6 +140,9 @@ static struct virPerfEventAttr attrs[] =3D { {.type =3D VIR_PERF_EVENT_ALIGNMENT_FAULTS, .attrType =3D PERF_TYPE_SOFTWARE, .attrConfig =3D PERF_COUNT_SW_ALIGNMENT_FAULTS}, + {.type =3D VIR_PERF_EVENT_EMULATION_FAULTS, + .attrType =3D PERF_TYPE_SOFTWARE, + .attrConfig =3D PERF_COUNT_SW_EMULATION_FAULTS}, }; typedef struct virPerfEventAttr *virPerfEventAttrPtr; =20 diff --git a/src/util/virperf.h b/src/util/virperf.h index 4e46460..eee7a03 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -55,6 +55,7 @@ typedef enum { 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_ALIGNMENT_FAULTS, /* Count of alignment faults */ + VIR_PERF_EVENT_EMULATION_FAULTS, /* Count of emulation faults */ =20 VIR_PERF_EVENT_LAST } virPerfEventType; diff --git a/tests/genericxml2xmlindata/generic-perf.xml b/tests/genericxml= 2xmlindata/generic-perf.xml index b48f96c..457aea0 100644 --- a/tests/genericxml2xmlindata/generic-perf.xml +++ b/tests/genericxml2xmlindata/generic-perf.xml @@ -34,6 +34,7 @@ + diff --git a/tools/virsh.pod b/tools/virsh.pod index 123b701..270b983 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -972,6 +972,7 @@ I<--perf> returns the statistics of all enabled perf ev= ents: "perf.page_faults_min" - the count of minor page faults "perf.page_faults_maj" - the count of major page faults "perf.alignment_faults" - the count of alignment faults + "perf.emulation_faults" - the count of emulation faults =20 See the B command for more details about each event. =20 @@ -2357,6 +2358,8 @@ B by applications running on the platform alignment_faults - Provides the count alignment faults by applications running on the platform + emulation_faults - Provides the count emulation faults + by applications running on the platform =20 B: The statistics can be retrieved using the B command usi= ng the I<--perf> flag. --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:29:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1487862193368512.1105110429598; Thu, 23 Feb 2017 07:03:13 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NF0HL5002417; Thu, 23 Feb 2017 10:00:17 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NEv2UU028166 for ; Thu, 23 Feb 2017 09:57:02 -0500 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NEv2j6006096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 09:57:02 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B762A8046A for ; Thu, 23 Feb 2017 14:57:01 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1NEslKL019619 for ; Thu, 23 Feb 2017 09:57:00 -0500 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0a-001b2d01.pphosted.com with ESMTP id 28syu26dj4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Feb 2017 09:57:00 -0500 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 00:56:57 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 00:56:55 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 226EF2CE8054; Fri, 24 Feb 2017 01:56:55 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1NEul8s53739688; Fri, 24 Feb 2017 01:56:55 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1NEuM04027842; Fri, 24 Feb 2017 01:56:22 +1100 Received: from localhost.in.ibm.com ([9.124.35.101]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1NEu19F027181; Fri, 24 Feb 2017 01:56:21 +1100 From: Nitesh Konkar To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:25:39 +0530 In-Reply-To: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> References: <1487861739-24929-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022314-0016-0000-0000-0000021D32A1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022314-0017-0000-0000-00000678CA3D Message-Id: <1487861739-24929-11-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702230140 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 23 Feb 2017 14:57:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 23 Feb 2017 14:57:01 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.06 * (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH 10/10] news: Update the news.xml about perf events added X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nitesh Konkar --- docs/news.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 74dfe9a..9a5f4c5 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -130,6 +130,17 @@ driver with all backends which may pull in too many dependencies. + + + perf: Add more perf statistics + + + Add support to get the count of cpu clock time, task clock time, + page faults, context switches, cpu migrations, minor page faults, + major page faults, alignment faults, emulation faults by + applications running on the platform. + +
--=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list