WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] xenoprof/ia64 support

To: oprofile-list@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] xenoprof/ia64 support
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 17 Dec 2007 16:38:59 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 16 Dec 2007 23:39:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
Hello.

Here is the patch for xenoprof/ia64 support.
In fact xenoprof/ia64 has been supported for long time, but I hesitated
to post this patch because sometimes the result was wrong.
But now it was fixed and I'm expecting that the patches will be
merged soon.
BTW the patch to opd_interface.h for DOMAIN_SWTICH_CODE
is posted. Is it possible to add defined(__ia64__) check?


Design note on xenoprof/ia64:
The perfmon model is that performance monitoring is per-thread, and 
Linux kernel owns PMU and manages PMU context switch.
For system wide profiling, a thread is created on each physical CPUs
and the thread manages physical PMU.
On the other hand, on Xen/IA64 the hypervisor owns PMU so that
perfmon driver in the Linux kernel was patched such that
it calls the PERFMON hypercall to request Xen/IA64 to manipulate PMU.
Thus creating a thread on each virtual CPUs doesn't make sense for
xenoprof. Instead allocate a single context and calls perfmon driver
only once for xenoprof system wide profiling.

thanks,

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r a5ef8c5f641e -r 394a663e3f71 daemon/opd_perfmon.c
--- a/daemon/opd_perfmon.c      Mon Dec 17 17:50:15 2007 +0900
+++ b/daemon/opd_perfmon.c      Mon Dec 17 18:15:40 2007 +0900
@@ -380,6 +380,7 @@ static void wait_for_child(struct child 
        close(child->up_pipe[1]);
 }
 
+static struct child* xen_ctx;
 
 void perfmon_init(void)
 {
@@ -388,6 +389,24 @@ void perfmon_init(void)
 
        if (cpu_type == CPU_TIMER_INT)
                return;
+
+       if (!no_xen) {
+               xen_ctx = xmalloc(sizeof(struct child));
+               xen_ctx->pid = getpid();
+               xen_ctx->up_pipe[0] = -1;
+               xen_ctx->up_pipe[1] = -1;
+               xen_ctx->sigusr1 = 0;
+               xen_ctx->sigusr2 = 0;
+               xen_ctx->sigterm = 0;
+
+               create_context(xen_ctx);
+
+               write_pmu(xen_ctx);
+               
+               load_context(xen_ctx);
+               return;
+       }
+       
 
        nr = sysconf(_SC_NPROCESSORS_ONLN);
        if (nr == -1) {
@@ -431,6 +450,9 @@ void perfmon_exit(void)
        if (cpu_type == CPU_TIMER_INT)
                return;
 
+       if (!no_xen)
+               return;
+
        for (i = 0; i < nr_cpus; ++i) {
                kill(children[i].pid, SIGKILL);
                waitpid(children[i].pid, NULL, 0);
@@ -445,6 +467,11 @@ void perfmon_start(void)
        if (cpu_type == CPU_TIMER_INT)
                return;
 
+       if (!no_xen) {
+               perfmon_start_child(xen_ctx->ctx_fd);
+               return;
+       }
+
        for (i = 0; i < nr_cpus; ++i)
                kill(children[i].pid, SIGUSR1);
 }
@@ -457,6 +484,11 @@ void perfmon_stop(void)
        if (cpu_type == CPU_TIMER_INT)
                return;
 
+       if (!no_xen) {
+               perfmon_stop_child(xen_ctx->ctx_fd);
+               return;
+       }
+       
        for (i = 0; i < nr_cpus; ++i)
                kill(children[i].pid, SIGUSR2);
 }



-- 
yamahata

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] xenoprof/ia64 support, Isaku Yamahata <=