From nobody Tue Apr 30 05:04:59 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 1487938674709841.6621006908339; Fri, 24 Feb 2017 04:17:54 -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 v1OCDJ9T005467; Fri, 24 Feb 2017 07:13:19 -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 v1OCDHFs025461 for ; Fri, 24 Feb 2017 07:13:17 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1OCDHsr021214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 24 Feb 2017 07:13:17 -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 EFD2FC04B927 for ; Fri, 24 Feb 2017 12:13:15 +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 v1OC4gKO089612 for ; Fri, 24 Feb 2017 07:13:14 -0500 Received: from e28smtp09.in.ibm.com (e28smtp09.in.ibm.com [125.16.236.9]) by mx0b-001b2d01.pphosted.com with ESMTP id 28tm8310wp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Feb 2017 07:13:14 -0500 Received: from localhost by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 17:43:09 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 17:43:07 +0530 Received: from d28relay09.in.ibm.com (d28relay09.in.ibm.com [9.184.220.160]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 7CC65E005A for ; Fri, 24 Feb 2017 17:44:47 +0530 (IST) Received: from d28av07.in.ibm.com (d28av07.in.ibm.com [9.184.220.146]) by d28relay09.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1OCD6fL9699528 for ; Fri, 24 Feb 2017 17:43:06 +0530 Received: from d28av07.in.ibm.com (localhost [127.0.0.1]) by d28av07.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1OCD6WI000664 for ; Fri, 24 Feb 2017 17:43:06 +0530 Received: from localhost.in.ibm.com ([9.124.35.101]) by d28av07.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1OCD6NB000661; Fri, 24 Feb 2017 17:43:06 +0530 From: Nitesh Konkar To: libvir-list@redhat.com Date: Fri, 24 Feb 2017 17:42:53 +0530 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022412-0032-0000-0000-000001ED39DE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022412-0033-0000-0000-0000121E431B Message-Id: <1487938373-26349-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-1702240121 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.31]); Fri, 24 Feb 2017 12:13:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 24 Feb 2017 12:13:16 +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.24 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 go v3] 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..a4dd21b 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..9f3ecc3 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: typedParamsFieldInfo{ + 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