Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenoprof: Fix more than one events can't

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenoprof: Fix more than one events can't be sampled concurrently for Intel CPU with family equal to 6
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Dec 2007 14:00:07 -0800
Delivery-date: Fri, 14 Dec 2007 14:00:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197628462 0
# Node ID 301507ac350a08335790b99ac845811cfc2b0a55
# Parent  61ff9b393c83d4750acdf2b26dd70fd7981e5145
xenoprof: Fix more than one events can't be sampled concurrently for Intel CPU 
with family equal to 6

The original code only sets EN bit of IA32_PERFEVTSEL0 when profiling
is started.

Signed-off-by: Xiaowei Yang <xiaowei.yang@xxxxxxxxx>
---
 xen/arch/x86/oprofile/op_model_ppro.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff -r 61ff9b393c83 -r 301507ac350a xen/arch/x86/oprofile/op_model_ppro.c
--- a/xen/arch/x86/oprofile/op_model_ppro.c     Fri Dec 14 10:26:11 2007 +0000
+++ b/xen/arch/x86/oprofile/op_model_ppro.c     Fri Dec 14 10:34:22 2007 +0000
@@ -104,6 +104,8 @@ static int ppro_check_ctrs(unsigned int 
        int mode = xenoprofile_get_mode(current, regs);
 
        for (i = 0 ; i < NUM_COUNTERS; ++i) {
+               if (!reset_value[i])
+                       continue;
                CTR_READ(low, high, msrs, i);
                if (CTR_OVERFLOWED(low)) {
                        xenoprof_log_event(current, regs, eip, mode, i);
@@ -123,18 +125,30 @@ static void ppro_start(struct op_msrs co
 static void ppro_start(struct op_msrs const * const msrs)
 {
        unsigned int low,high;
-       CTRL_READ(low, high, msrs, 0);
-       CTRL_SET_ACTIVE(low);
-       CTRL_WRITE(low, high, msrs, 0);
+       int i;
+
+       for (i = 0; i < NUM_COUNTERS; ++i) {
+               if (reset_value[i]) {
+                       CTRL_READ(low, high, msrs, i);
+                       CTRL_SET_ACTIVE(low);
+                       CTRL_WRITE(low, high, msrs, i);
+               }
+       }
 }
 
 
 static void ppro_stop(struct op_msrs const * const msrs)
 {
        unsigned int low,high;
-       CTRL_READ(low, high, msrs, 0);
-       CTRL_SET_INACTIVE(low);
-       CTRL_WRITE(low, high, msrs, 0);
+       int i;
+
+       for (i = 0; i < NUM_COUNTERS; ++i) {
+               if (!reset_value[i])
+                       continue;
+               CTRL_READ(low, high, msrs, i);
+               CTRL_SET_INACTIVE(low);
+               CTRL_WRITE(low, high, msrs, i);
+       }
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenoprof: Fix more than one events can't be sampled concurrently for Intel CPU with family equal to 6, Xen patchbot-unstable <=