From: Steven Smith Subject: Re: [PATCH] Oprofile patch for 2.6.27 tree. Fix collisionbetween Xen and Cell processor escape codes Date: Thu, 25 Jun 2009 10:50:55 +0100 Message-ID: <20090625095055.GA19282@weybridge.uk.xensource.com> References: <20090609084651.GA14593@weybridge.uk.xensource.com> <20090616103822.GA32136@weybridge.uk.xensource.com> <20090619173009.GA13896@weybridge.uk.xensource.com> <20090619215857.GA14674@weybridge.uk.xensource.com> <4A41FCB10200007800007522@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1026510140==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: ian.campbell@citrix.com Cc: Steven Smith , "xen-devel@lists.xensource.com" , "Santos, Jose Renato G" , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============1026510140== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline --1LKvkjL3sHcu1TtY Content-Type: multipart/mixed; boundary="gKMricLos+KVdGMg" Content-Disposition: inline --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > I'm a little confused by this: Upstream oprofile 0.9.4 has=20 > > the same workaround implemented on the user mode side of=20 > > things, so adjusting this in the kernel now would make the=20 > > 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). > =20 > 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. >=20 > Please use the new attached patch instead of the original one.=20 Ian: Can you apply this to the 2.6.27 tree, please? I'll pull it through to NC2 from there. Steven. > 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). > =20 > Signed-off-by: Jose Renato Santos >=20 > 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 > =20 > struct super_block; > struct dentry; >=20 >=20 > > >>> "Santos, Jose Renato G" 23.06.09 20:13= =20 > > >>> >>> > >=20 > > Steven > >=20 > > This is a fix to enable Oprofile to work on the netchannel2=20 > > 2.6.27 tree. > >=20 > > This is to address a collision for escape codes used to=20 > > represent domain switches in Xen and CPU switches in cell=20 > > processors which were developed in parallel and used the same code. > >=20 > > There was a discussion on the Oprofile mailing list a while=20 > > ago and it was decided that we would use different Oprofile=20 > > codes for x86 and ia64 archs (which are the only ones that=20 > > support Oprofile in Xen) in order to preserve backward=20 > > compatibility for users. > >=20 > > The Oprofile user level tools expect different escape codes=20 > > depending on the architecture. We need to make sure the=20 > > kernel generates compatible escape codes. > >=20 > > I think this should be also pushed to the 2.6.27 XenClient tree. > >=20 > > Thanks > >=20 > > Renato > >=20 > >=20 --gKMricLos+KVdGMg Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fix_domain_switch_code.diff" Content-Transfer-Encoding: quoted-printable commit 5f83a329fe07bdfcb6ced6de35f6fc68b22b99e0 Author: Jose Renato Santos Date: Wed Jun 24 18:18:41 2009 -0700 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). =20 Signed-off-by: Jose Renato Santos 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_CO= DE + * (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 =20 struct super_block; struct dentry; --gKMricLos+KVdGMg-- --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKQ0h/vAgSWYI3DVMRAvrQAKCfV2YQ85vQYGIUGWPzQHYuIBC6+QCgsgWA qxfSjs0f9H5JTvl+gU1ibHo= =rRNP -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY-- --===============1026510140== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1026510140==--