[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] [PATCH] Oprofile patch for 2.6.27 tree. Fix collisionbetween Xen and Cell processor escape codes



 

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxxxx] 
> Sent: Wednesday, June 24, 2009 1:15 AM
> To: Steven Smith; Santos, Jose Renato G
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-devel] [PATCH] Oprofile patch for 2.6.27 
> tree. Fix collisionbetween Xen and Cell processor escape codes
> 
> I'm a little confused by this: Upstream oprofile 0.9.4 has 
> the same workaround implemented on the user mode side of 
> things, so adjusting this in the kernel now would make the 
> kernel incompatible with that and future versions. Jan
> 

  The fact that oprofile user level code has the same workaround
  is exactly the reason for this patch.
  We need the same code values in the kernel and in the user level tools.
  Right now the kernel generates code 13 for DOMAIN_SWITCH_CODE
  in x86 and Oprofile daemon complains that there is no such code.
  (it expects code 11 for that).
  
  However, your question made me look at Oprofile 0.9.4 and I noticed
  this workaround changed slightly from 0.9.3 to 0.9.4.
  The new code checks for powerpc while 0.9.3 checked for
  x96 and ia64. So we need a slightly different patch.

  Please use the new attached patch instead of the original one. 

  Thanks 

Renato

===============================================

    Fix OProfile escape code collision between Xenoprof's
    DOMAIN_SWITCH_CODE (in use on x86 and ia64) and Cell's
    SPU_PROFILING_CODE(in use with Power).
    
    Signed-off-by: Jose Renato Santos <jsantos@xxxxxxxxxx>

diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index bb8a349..8863734 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -37,9 +37,18 @@
 #define TRACE_BEGIN_CODE               8
 #define TRACE_END_CODE                 9
 #define XEN_ENTER_SWITCH_CODE          10
+/*
+ * Ugly work-around for the unfortunate collision between Xenoprof's
+ * DOMAIN_SWITCH_CODE (in use on x86 and ia64) and Cell's SPU_PROFILING_CODE
+ * (in use with Power):
+ */
+#ifdef CONFIG_PPC
 #define SPU_PROFILING_CODE             11
 #define SPU_CTX_SWITCH_CODE            12
 #define DOMAIN_SWITCH_CODE             13
+#else
+#define DOMAIN_SWITCH_CODE             11
+#endif
 
 struct super_block;
 struct dentry;


> >>> "Santos, Jose Renato G" <joserenato.santos@xxxxxx> 23.06.09 20:13 
> >>> >>>
> 
> Steven
> 
> This is a fix to enable Oprofile to work on the netchannel2 
> 2.6.27 tree.
> 
> This is to address a collision for escape codes used to 
> represent domain switches in Xen and CPU switches in cell 
> processors which were developed in parallel and used the same code.
> 
> There was a discussion on the Oprofile mailing list a while 
> ago and it was decided that we would use different Oprofile 
> codes for x86 and ia64 archs (which are the only ones that 
> support Oprofile in Xen) in order to preserve backward 
> compatibility for users.
> 
> The Oprofile user level tools expect different escape codes 
> depending on the architecture. We need to make sure the 
> kernel generates compatible escape codes.
> 
> I think this should be also pushed to the 2.6.27 XenClient tree.
> 
> Thanks
> 
> Renato
> 
> 

Attachment: fix_domain_switch_code.diff
Description: fix_domain_switch_code.diff

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.