Skip to contentSkip to conversation

performance tools on xen

DISCUSSION Dante Cinco 5 participants 8 messages Nov 2, 2009 – Nov 5, 2009 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): EF547E542C520A4D858CFEF5B404D05360804E5ACF@GVW0673EXC.americas.hpqcorp.net

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

Dante

Quoted 16 lines · Jeremy Fitzhardinge
Quoted 10 lines · Jose Renato G

Dante,

To run OProfile in Xen you need support in the kernel and in the OProfile user level tools.
The user level patches were never merged on mainline OProfile. You need to apply a patch to the OProfile sources before compiling them. I did not have time to port the patch to OProfile 0.9.5 yet, so the latest available patch is for Oprofile 0.9.3. You can download that from http://xenoprof.sourceforge.net/.

Quoted 4 lines

Regarding the kernel I am not sure if the OProfile extensions for Xen were already merged in the pvops kernel. You will need to ask that to Jeremy. I know that OProfile works with the 2.6.18-xen and the XCI 2.6.27-xen versions. I have never tried running the pvops kernel yet.

Quoted 6 lines

I have not looked at Xen+Oprofile, so there's no support in the pvops kernel as yet. If someone who's familiar with that stuff could generate a patch, I'd be happy to include it.

J

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw
Quoted 8 lines · Dante Cinco

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
J

#5 lore raw

Jeremy, I thought you were able to access my git repo (per your last mail). I should be having the patches somewhere around. Will send them over soon.

-dulloor

Quoted 18 lines · Jeremy Fitzhardinge
Quoted 8 lines · Dante Cinco

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
   J

#6 lore raw

I have attached the patch that will apply to the current pvops tree. Tested both on 32-bit and 64-bit platforms.

I lost some of the cleanups that I had done to get rid of some (CONFIG_XEN)ifdefs in a couple of files in oprofile directory. But, I will work on them incrementally, if this is checked in.

-dulloor

Quoted 4 lines · Dulloor

Jeremy, I thought you were able to access my git repo (per your last mail). I should be having the patches somewhere around. Will send them over soon.

Quoted 22 lines

-dulloor

Quoted 18 lines · Jeremy Fitzhardinge
Quoted 8 lines · Dante Cinco

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
   J

arch/x86/include/asm/xen/hypercall.h +6 -0
index 7de93f3..04d8f38 100644
@@ -450,6 +450,12 @@ HYPERVISOR_nmi_op(unsigned long op, unsigned long arg)
 	return _hypercall2(int, nmi_op, op, arg);
 }
 
+static inline int
+HYPERVISOR_xenoprof_op(unsigned int op, void *arg)
+{
+	return _hypercall2(int, xenoprof_op, op, arg);
+}
+
 static inline void
 MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
 {
arch/x86/oprofile/Makefile +6 -0
index 446902b..6a976e6 100644
@@ -6,6 +6,12 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		oprofilefs.o oprofile_stats.o  \
 		timer_int.o )
 
+ifdef CONFIG_XEN
+XENOPROF_COMMON_OBJS = $(addprefix ../../../drivers/xen/xenoprof/, \
+			 xenoprofile.o)
+DRIVER_OBJS				:= $(DRIVER_OBJS) \
+					   $(XENOPROF_COMMON_OBJS) xenoprof.o
+endif 
 oprofile-y				:= $(DRIVER_OBJS) init.o backtrace.o
 oprofile-$(CONFIG_X86_LOCAL_APIC) 	+= nmi_int.o op_model_amd.o \
 					   op_model_ppro.o op_model_p4.o
arch/x86/oprofile/xenoprof.c new file +172 -0

172 lines not on this page · raw message

arch/x86/xen/mmu.c +35 -13

92 lines not on this page · raw message

drivers/oprofile/buffer_sync.c +69 -12

150 lines not on this page · raw message

drivers/oprofile/cpu_buffer.c +59 -14

135 lines not on this page · raw message

drivers/oprofile/cpu_buffer.h +16 -4
index 272995d..95be4c7 100644
@@ -40,7 +40,7 @@ struct op_entry;
 struct oprofile_cpu_buffer {
 	unsigned long buffer_size;
 	struct task_struct *last_task;
-	int last_is_kernel;
+	int last_cpu_mode;
 	int tracing;
 	unsigned long sample_received;
 	unsigned long sample_lost_overflow;
@@ -62,7 +62,7 @@ static inline void op_cpu_buffer_reset(int cpu)
 {
 	struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu);
 
-	cpu_buf->last_is_kernel = -1;
+	cpu_buf->last_cpu_mode = -1;
 	cpu_buf->last_task = NULL;
 }
 
@@ -111,10 +111,22 @@ int op_cpu_buffer_get_data(struct op_entry *entry, unsigned long *val)
 	return size;
 }
 
+/* data flags */
+/* cpu modes */
+/* */
+#define CPU_MODE_BEGIN		(0UL)
+#define CPU_MODE_USER		(CPU_MODE_BEGIN + 0x0)
+#define CPU_MODE_KERNEL		(CPU_MODE_BEGIN + 0x1)
+#ifdef CONFIG_XEN
+#define CPU_MODE_XEN		(CPU_MODE_BEGIN + 0x2)
+#endif
+#define CPU_MODE_END		(CPU_MODE_BEGIN + 0x3)
+#define CPU_MODE_MASK		0x3
+
 /* extra data flags */
-#define KERNEL_CTX_SWITCH	(1UL << 0)
-#define IS_KERNEL		(1UL << 1)
 #define TRACE_BEGIN		(1UL << 2)
 #define USER_CTX_SWITCH		(1UL << 3)
+#define KERNEL_CTX_SWITCH	(1UL << 4)
+#define XEN_DOMAIN_SWITCH	(1UL << 5)
 
 #endif /* OPROFILE_CPU_BUFFER_H */
drivers/oprofile/event_buffer.h +5 -0
index 4e70749..9f19d42 100644
@@ -30,6 +30,11 @@ void wake_up_buffer_waiter(void);
 #define INVALID_COOKIE ~0UL
 #define NO_COOKIE 0UL
 
+#ifdef CONFIG_XEN
+#define XEN_COORDINATOR_DOMAIN -1
+#endif
+
+
 extern const struct file_operations event_buffer_fops;
 
 /* mutex between sync_cpu_buffers() and the
drivers/oprofile/oprof.c +50 -3

77 lines not on this page · raw message

drivers/oprofile/oprof.h +5 -0
index c288d3c..e659728 100644
@@ -36,4 +36,9 @@ void oprofile_timer_init(struct oprofile_operations *ops);
 
 int oprofile_set_backtrace(unsigned long depth);
 
+#ifdef CONFIG_XEN
+int oprofile_xen_set_active(int active_domains[], unsigned int adomains);
+int oprofile_xen_set_passive(int passive_domains[], unsigned int pdomains);
+#endif
+
 #endif /* OPROF_H */
drivers/oprofile/oprofile_files.c +210 -0

228 lines not on this page · raw message

drivers/xen/xenoprof/xenoprofile.c new file +547 -0

547 lines not on this page · raw message

include/linux/oprofile.h +21 -1
index 1d9518b..bd55065 100644
@@ -16,6 +16,9 @@
 #include <linux/types.h>
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
+#ifdef CONFIG_XEN
+#include <xen/interface/xenoprof.h>
+#endif
  
 /* Each escaped entry is prefixed by ESCAPE_CODE
  * then one of the following codes, then the
@@ -28,14 +31,18 @@
 #define CPU_SWITCH_CODE			2
 #define COOKIE_SWITCH_CODE		3
 #define KERNEL_ENTER_SWITCH_CODE	4
-#define KERNEL_EXIT_SWITCH_CODE		5
+#define USER_ENTER_SWITCH_CODE		5
 #define MODULE_LOADED_CODE		6
 #define CTX_TGID_CODE			7
 #define TRACE_BEGIN_CODE		8
 #define TRACE_END_CODE			9
 #define XEN_ENTER_SWITCH_CODE		10
+#ifndef CONFIG_XEN
 #define SPU_PROFILING_CODE		11
 #define SPU_CTX_SWITCH_CODE		12
+#else
+#define XEN_DOMAIN_SWITCH_CODE		11
+#endif
 #define IBS_FETCH_CODE			13
 #define IBS_OP_CODE			14
 
@@ -49,6 +56,12 @@ struct oprofile_operations {
 	/* create any necessary configuration files in the oprofile fs.
 	 * Optional. */
 	int (*create_files)(struct super_block * sb, struct dentry * root);
+#ifdef CONFIG_XEN
+	/* setup active domains with Xen */
+	int (*xen_set_active)(int *active_domains, unsigned int adomains);
+	/* setup passive domains with Xen */
+	int (*xen_set_passive)(int *passive_domains, unsigned int pdomains);
+#endif
 	/* Do any necessary interrupt setup. Optional. */
 	int (*setup)(void);
 	/* Do any necessary interrupt shutdown. Optional. */
@@ -104,9 +117,16 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
  * backtrace. */
 void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event);
 
+/* Record when the cpu mode switches between user/kernel/xen(hypervisor) */
+void oprofile_add_mode(int cpu_mode);
+
 /* add a backtrace entry, to be called from the ->backtrace callback */
 void oprofile_add_trace(unsigned long eip);
 
+#ifdef CONFIG_XEN
+/* add a xen domain switch entry */
+int oprofile_add_domain_switch(int32_t domain_id);
+#endif
 
 /**
  * Create a file of the given name as a child of the given root, with
include/xen/interface/xen.h +2 -0
index 812ffd5..0054a3f 100644
@@ -79,6 +79,8 @@
 #define VIRQ_CONSOLE    2  /* (DOM0) Bytes received on emergency console. */
 #define VIRQ_DOM_EXC    3  /* (DOM0) Exceptional event for some domain.   */
 #define VIRQ_DEBUGGER   6  /* (DOM0) A domain has paused for debugging.   */
+#define VIRQ_XENOPROF   7  /* V. XenOprofile interrupt: new sample available */
+
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16
include/xen/interface/xenoprof.h new file +140 -0

140 lines not on this page · raw message

include/xen/xen-ops.h +3 -0
index 9769738..1922ef3 100644
@@ -24,5 +24,8 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long mfn, int nr,
 			       pgprot_t prot, unsigned domid);
 
+int xen_remap_domain_kernel_mfn_range(unsigned long addr,
+			       unsigned long mfn, int nr,
+			       pgprot_t prot, unsigned domid);
 
 #endif /* INCLUDE_XEN_OPS_H */
include/xen/xenoprof.h new file +69 -0

69 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw
Quoted 7 lines · Dulloor

I have attached the patch that will apply to the current pvops tree. Tested both on 32-bit and 64-bit platforms.

I lost some of the cleanups that I had done to get rid of some (CONFIG_XEN)ifdefs in a couple of files in oprofile directory. But, I will work on them incrementally, if this is checked in.

Thanks, I've committed it to the xen/oprofile branch. I haven't merged it into xen/master yet.

J

#8 lore raw
In reply to Dulloor

Please help me starting profiling my xen3.4.1 with pv kernel 2.6.31.4 on fedora11 platform. I have confusions in installing and using latest version of Oprofile with xenoprof.

Regards,
Fasiha Ashraf

--- On Wed, 4/11/09, Dulloor <[email protected]> wrote:

From: Dulloor <[email protected]>
Subject: Re: [Xen-devel] performance tools on xen
To: "Jeremy Fitzhardinge" <[email protected]>
Cc: "Xen-devel" <[email protected]>, "Santos, Jose Renato G" <[email protected]>, "Dante Cinco" <[email protected]>
Date: Wednesday, 4 November, 2009, 5:18 PM

I have attached the patch that will apply to the current pvops tree. Tested both on 32-bit and 64-bit platforms.

I lost some of the cleanups that I had done to get rid of some (CONFIG_XEN)ifdefs in a couple of files in oprofile directory. But, I will work on them incrementally, if this is checked in.

-dulloor

Quoted 4 lines · Dulloor

Jeremy, I thought you were able to access my git repo (per your last mail). I should be having the patches somewhere around. Will send them over soon.

Quoted 22 lines

-dulloor

Quoted 18 lines · Jeremy Fitzhardinge
Quoted 8 lines · Dante Cinco

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
   J

-----Inline Attachment Follows-----

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#9 lore raw

Even the latest version of oprofile doesn't have the passive-domain profiling option, which I personally prefer. You could get the patches from
http://xenoprof.sourceforge.net
A useful guide for xenoprof is
http://xen.org/files/summit_3/xenoprof_tutorial.pdf

Maybe it's time those changes are checked-in too (into oprofile). But, Jose knows better.

-dulloor

Quoted 68 lines · Fasiha Ashraf

Please help me starting profiling my xen3.4.1 with pv kernel 2.6.31.4 on fedora11 platform. I have confusions in installing and using latest version of Oprofile with xenoprof.

Regards,
Fasiha Ashraf

--- On *Wed, 4/11/09, Dulloor <[email protected]>* wrote:

From: Dulloor <[email protected]>
Subject: Re: [Xen-devel] performance tools on xen
To: "Jeremy Fitzhardinge" <[email protected]>
Cc: "Xen-devel" <[email protected]>, "Santos, Jose Renato G" < [email protected]>, "Dante Cinco" <[email protected]>
Date: Wednesday, 4 November, 2009, 5:18 PM

I have attached the patch that will apply to the current pvops tree. Tested both on 32-bit and 64-bit platforms.

I lost some of the cleanups that I had done to get rid of some (CONFIG_XEN)ifdefs in a couple of files in oprofile directory. But, I will work on them incrementally, if this is checked in.

-dulloor

Quoted 7 lines · On Wed, Nov 4, 2009 at 12:46 AM, Dulloor…

Jeremy, I thought you were able to access my git repo (per your last mail). I should be having the patches somewhere around. Will send them over soon.

-dulloor

On Mon, Nov 2, 2009 at 1:47 PM, Jeremy Fitzhardinge <[email protected]<http://mc/[email protected]>>

Quoted 7 lines · wrote:
Quoted 7 lines · Dante Cinco
Quoted 6 lines

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Do you know if dulloor's patches for xenoprof for linux pvops got

applied?

Quoted 10 lines
Quoted 9 lines

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
J

-----Inline Attachment Follows-----

_______________________________________________
Xen-devel mailing list [email protected]<http://mc/[email protected]>
http://lists.xensource.com/xen-devel

Quoted 4 lines

------------------------------
Try the new Yahoo! India Homepage. Click here<http://in.rd.yahoo.com/tagline_metro_1/*http://in.yahoo.com/trynew> .

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#10 lore raw

Having the Xen passive domain support not integrated into mainline OProfile user level tools is a pain.
The problem is that OProfile mantainers are not not happy with the way passive domain samples are stored today (as fake modules named domainX, domainY, etc...) which I agree is ugly . We need to do this properly and separate passive domains samples using OProfile sample directory hierarchy in the same way different CPUs samples are stored. This requires some reasonable amount of work and I don't have the time to work on this myself. I have been looking for some volunteer to work on that for a while but nobody had taken that task yet.
I would be happy to help anyone who is willing to work on that. Any volunteers?:)

Renato

________________________________
From: Dulloor [mailto:[email protected]]
Sent: Thursday, November 05, 2009 1:21 AM
To: Fasiha Ashraf
Cc: Jeremy Fitzhardinge; Xen-devel; Santos, Jose Renato G; Dante Cinco
Subject: Re: [Xen-devel] performance tools on xen

Even the latest version of oprofile doesn't have the passive-domain profiling option, which I personally prefer. You could get the patches from http://xenoprof.sourceforge.net
A useful guide for xenoprof is http://xen.org/files/summit_3/xenoprof_tutorial.pdf

Maybe it's time those changes are checked-in too (into oprofile). But, Jose knows better.

-dulloor

On Thu, Nov 5, 2009 at 4:12 AM, Fasiha Ashraf <[email protected]<mailto:[email protected]>> wrote:
Please help me starting profiling my xen3.4.1 with pv kernel 2.6.31.4 on fedora11 platform. I have confusions in installing and using latest version of Oprofile with xenoprof.

Regards,
Fasiha Ashraf

--- On Wed, 4/11/09, Dulloor <[email protected]<mailto:[email protected]>> wrote:

From: Dulloor <[email protected]<mailto:[email protected]>>
Subject: Re: [Xen-devel] performance tools on xen
To: "Jeremy Fitzhardinge" <[email protected]<mailto:[email protected]>>
Cc: "Xen-devel" <[email protected]<mailto:[email protected]>>, "Santos, Jose Renato G" <[email protected]<mailto:[email protected]>>, "Dante Cinco" <[email protected]<mailto:[email protected]>>
Date: Wednesday, 4 November, 2009, 5:18 PM

I have attached the patch that will apply to the current pvops tree. Tested both on 32-bit and 64-bit platforms.

I lost some of the cleanups that I had done to get rid of some (CONFIG_XEN)ifdefs in a couple of files in oprofile directory. But, I will work on them incrementally, if this is checked in.

-dulloor

Quoted 4 lines · On Wed, Nov 4, 2009 at 12:46 AM, Dulloor…

Jeremy, I thought you were able to access my git repo (per your last mail). I should be having the patches somewhere around. Will send them over soon.

Quoted 22 lines

-dulloor

Quoted 18 lines · On Mon, Nov 2, 2009 at 1:47 PM, Jeremy Fitzhardinge…
Quoted 8 lines · Dante Cinco

Jeremy,

I searched Mark Mail for "xenoprof pvops" and found this email from dulloor:

http://markmail.org/search/?q=xenoprof+pvops#query:xenoprof%20pvops+page:1+mid:yyzbymymat3rtivo+state:results

Do you know if dulloor's patches for xenoprof for linux pvops got applied?

No, they fell through the cracks; I think there was some problem that I could never connect to his git server.

Dulloor, do you still have a current set of patched we can try?

Thanks,
J

-----Inline Attachment Follows-----

_______________________________________________
Xen-devel mailing list [email protected]<http://mc/[email protected]>
http://lists.xensource.com/xen-devel

________________________________
Try the new Yahoo! India Homepage. Click here<http://in.rd.yahoo.com/tagline_metro_1/*http://in.yahoo.com/trynew>.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel