From nobody Wed May 1 00:21:57 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 1487930216863711.935054040481; Fri, 24 Feb 2017 01:56:56 -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 v1O9rBmP046960; Fri, 24 Feb 2017 04:53:11 -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 v1O9rAgD008182 for ; Fri, 24 Feb 2017 04:53:10 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1O9rAYo027989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 24 Feb 2017 04:53:10 -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 AFEF3D59BB for ; Fri, 24 Feb 2017 09:53:09 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1O9mpVZ002490 for ; Fri, 24 Feb 2017 04:53:08 -0500 Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0b-001b2d01.pphosted.com with ESMTP id 28teq1gv9x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Feb 2017 04:53:08 -0500 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 15:23:04 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 15:23:03 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 9E1E3394005E for ; Fri, 24 Feb 2017 15:23:02 +0530 (IST) Received: from d28av06.in.ibm.com (d28av06.in.ibm.com [9.184.220.48]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1O9qx7b10551408 for ; Fri, 24 Feb 2017 15:22:59 +0530 Received: from d28av06.in.ibm.com (localhost [127.0.0.1]) by d28av06.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1O9r1qO014659 for ; Fri, 24 Feb 2017 15:23:02 +0530 Received: from localhost.in.ibm.com ([9.124.35.101]) by d28av06.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1O9r1qj014656; Fri, 24 Feb 2017 15:23:01 +0530 From: Nitesh Konkar To: libvir-list@redhat.com Date: Fri, 24 Feb 2017 15:22:51 +0530 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022409-0020-0000-0000-000000C2170D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022409-0021-0000-0000-0000027E1F98 Message-Id: <1487929971-31216-1-git-send-email-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-24_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=5 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702240098 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 202 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Feb 2017 09:53:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Feb 2017 09:53:09 +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.059 * (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.23 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 go v2] Add support for perf events 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 --- connect.go | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ domain.go | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ domain_compat.h | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) diff --git a/connect.go b/connect.go index 3c53485..e24cf66 100644 --- a/connect.go +++ b/connect.go @@ -2264,6 +2264,24 @@ type DomainStatsPerf struct { StalledCyclesBackend uint64 RefCpuCyclesSet bool RefCpuCycles uint64 + CpuClockSet bool + CpuClock uint64 + TaskClockSet bool + TaskClock uint64 + PageFaultsSet bool + PageFaults uint64 + ContextSwitchesSet bool + ContextSwitches uint64 + CpuMigrationsSet bool + CpuMigrations uint64 + PageFaultsMinSet bool + PageFaultsMin uint64 + PageFaultsMajSet bool + PageFaultsMaj uint64 + AlignmentFaultsSet bool + AlignmentFaults uint64 + EmulationFaultsSet bool + EmulationFaults uint64 } =20 func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typed= ParamsFieldInfo { @@ -2320,6 +2338,42 @@ func getDomainStatsPerfFieldInfo(params *DomainStats= Perf) map[string]typedParams set: ¶ms.RefCpuCyclesSet, ul: ¶ms.RefCpuCycles, }, + "perf.cpu_clock": typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + ul: ¶ms.CpuClock, + }, + "perf.task_clock": typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + ul: ¶ms.TaskClock, + }, + "perf.page_faults": typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + ul: ¶ms.PageFaults, + }, + "perf.context_switches": typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + ul: ¶ms.ContextSwitches, + }, + "perf.cpu_migrations": typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + ul: ¶ms.CpuMigrations, + }, + "perf.page_faults_min": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + ul: ¶ms.PageFaultsMin, + }, + "perf.page_faults_maj": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + ul: ¶ms.PageFaultsMaj, + }, + "perf.alignment_faults": typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + ul: ¶ms.AlignmentFaults, + }, + "perf.emulation_faults": typedParamsFieldInfo{ + set: ¶ms.EmulationFaultsSet, + ul: ¶ms.EmulationFaults, + }, } } =20 diff --git a/domain.go b/domain.go index 2bd9852..1cb0b95 100644 --- a/domain.go +++ b/domain.go @@ -3195,6 +3195,24 @@ type DomainPerfEvents struct { StalledCyclesBackend bool RefCpuCyclesSet bool RefCpuCycles bool + CpuClockSet bool + CpuClock bool + TaskClockSet bool + TaskClock bool + PageFaultsSet bool + PageFaults bool + ContextSwitchesSet bool + ContextSwitches bool + CpuMigrationsSet bool + CpuMigrations bool + PageFaultsMinSet bool + PageFaultsMin bool + PageFaultsMajSet bool + PageFaultsMaj bool + AlignmentFaultsSet bool + AlignmentFaults bool + EmulationFaultsSet bool + EmulationFaults bool } =20 /* Remember to also update DomainStatsPerf in connect.go when adding to th= e stuct above */ @@ -3253,6 +3271,42 @@ func getDomainPerfEventsFieldInfo(params *DomainPerf= Events) map[string]typedPara set: ¶ms.RefCpuCyclesSet, b: ¶ms.RefCpuCycles, }, + C.VIR_PERF_PARAM_CPU_CLOCK: typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + b: ¶ms.CpuClock, + }, + C.VIR_PERF_PARAM_TASK_CLOCK: typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + b: ¶ms.TaskClock, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS: typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + b: ¶ms.PageFaults, + }, + C.VIR_PERF_PARAM_CONTEXT_SWITCHES: typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + b: ¶ms.ContextSwitches, + }, + C.VIR_PERF_PARAM_CPU_MIGRATIONS: typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + b: ¶ms.CpuMigrations, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MIN: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + b: ¶ms.PageFaultsMin, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MAJ: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + b: ¶ms.PageFaultsMaj, + }, + C.VIR_PERF_PARAM_ALIGNMENT_FAULTS: typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + b: ¶ms.AlignmentFaults, + }, + C.VIR_PERF_PARAM_REF_EMULATION_FAULTS: typedParamsFieldInf= o{ + set: ¶ms.EmulationFaultsSet, + b: ¶ms.EmulationFaults, + }, } } =20 diff --git a/domain_compat.h b/domain_compat.h index 9540435..a114173 100644 --- a/domain_compat.h +++ b/domain_compat.h @@ -45,6 +45,42 @@ #define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" #endif =20 +#ifndef VIR_PERF_PARAM_CPU_CLOCK +#define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock" +#endif + +#ifndef VIR_PERF_PARAM_TASK_CLOCK +#define VIR_PERF_PARAM_TASK_CLOCK "task_clock" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS +#define VIR_PERF_PARAM_PAGE_FAULTS "page_faults" +#endif + +#ifndef VIR_PERF_PARAM_CONTEXT_SWITCHES +#define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches" +#endif + +#ifndef VIR_PERF_PARAM_CPU_MIGRATIONS +#define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MIN +#define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MAJ +#define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj" +#endif + +#ifndef VIR_PERF_PARAM_ALIGNMENT_FAULTS +#define VIR_PERF_PARAM__ALIGNMENT_FAULTS "alignment_faults" +#endif + +#ifndef VIR_PERF_PARAM_EMULATION_FAULTS +#define VIR_PERF_PARAM_EMULATION_FAULTS "emulation_faults" +#endif + #ifndef VIR_DOMAIN_EVENT_ID_METADATA_CHANGE #define VIR_DOMAIN_EVENT_ID_METADATA_CHANGE 23 #endif --=20 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list