Mailing List Archive

[XENOPROLIFE] New oprofile patch for XenOProfile
Tom,

Thanks for the HVM patches.
This is good news

We are now able to profile HVM guests (both SVM and VT)(in passive mode)
using Tom's patches combined with the attached new version of oprofile.
The attached patch (r3) combines the old oprofile patch (r2) with the
patch "oprofile-0.9.1-fix-hvm-addr-overlap.patch" that Tom mentioned and
included in his post.
After Tom's fixes are merged, this is the only patch that will be
needed.

The patch is for oprofile 0.9.1. Oprofile 0.9.2, which will be release
soon, will include XenOprofile support for active domains but it will
not support passive domains. I will generate a patch with passive domain
support for oprofile 0.9.2 when it is released.

I hope Tom patches are accepted and make into Xen 3.0.3

Thanks

Renato

> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of
> Woller, Thomas
> Sent: Friday, September 15, 2006 9:19 AM
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] [HVM][XENOPROFILE][RFC][0/3] xenoprofile
> HVM patches
>
> Keir,
> The following 3 patches allow HVM (SVM and VT) guests to be
> passively profiled using the very latest patches from Renato.
> These patches apply to 11470.
> Renato's patches:
> http://xenoprof/sourceforge.net oprofile-0.9.1-xen-r2.patch
> And also a patch not posted FAIK
> (oprofile-0.9.1-fix-hvm-addr-overlap.patch) which is in the attached
> tar.bz2 file.
>
> hvm_xenoprofile_1.patch -
> The first patch is merely the same patch that I posted a few
> weeks ago.
> The STGI code is moved from the exits.S files, and into the
> vmexit handler. The extra do_nmi() is removed allowing the
> host to handle the NMI when the stgi instruction is executed.
> This patch allows the second patch to properly set "guest
> NMI" flag for the oprofile code to determine proper rip/eip and mode.
>
> hvm_xenoprofile_2.patch -
> The second patch adds the actual xenoprofile fixes for SVM:
>
> 1) hvm function (svm_oprofile_get_eip()) This new hvm table
> function is called from the op_module_athlon.c code, and
> returns the proper eip and "mode" for use in the
> xenoprof_log_event() function.
>
> 2) The vmexit handler code now checks the exitcode and if an
> NMI was intercepted, then prior to the stgi(), a flag
> (VGCF_hvm_guest_nmi) is
> set in the v->arch.guest_context.flags field. The VGCF_hvm_guest_nmi
> bit is checked during NMI processing via the hvm function callback.
>
> hvm_xenoprofile_3.patch -
> The third patch adds the actual xenoprofile fixes for VT:
> I checked (verified by Renato), that the VT traces look ok
> also. There is some code that I am unsure about in the
> vmx_oprofile_get_eip(): i.e using the __vmread() to get eip
> might not be in the proper context, and then secondly I am
> not sure how to determine the guest CPL level.
>
> Overall, these patches seem to work fine for 32bit
> hypervisor, as well as 64bit hypervisor with 32bit and 64bit
> HVM guests. You do need to use both of Renato's oprofile
> patches on top of 0.9.1. With another oprofile release soon
> (this week?), I believe that some of the "r2"
> patch will be incorporated into 0.9.2, but not sure which parts.
>
> There certainly might be a better way to obtain the eip/mode,
> but since the SVM code is not calling do_nmi() then the host
> context will handle the NMI, and there must be some mechanism
> to properly setup the eip/mode in the op_model code
> indirectly. I am not sure if the VT code requires the same
> approach since do_nmi() is called directly, and the eip/mode
> could be passed directly to this function.
>
> The attached tar.bz2 file contains some example logs, and
> some scripts from Ray Bryant (AMD) for extracting and
> normalizing each of the profiling buckets. There is a brief
> README for using the scripts.
>
> We'd like to see this get into 3.0.3 if possible. Renato has
> reviewed the patches, but not actually tested these patches
> on his platforms.
> Feedback appreciated,
> Tom Woller
>
>
>
Re: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
Santos, Jose Renato G wrote:
> Tom,
>
> Thanks for the HVM patches.
> This is good news
>
> We are now able to profile HVM guests (both SVM and VT)(in passive mode)
> using Tom's patches combined with the attached new version of oprofile.
> The attached patch (r3) combines the old oprofile patch (r2) with the
> patch "oprofile-0.9.1-fix-hvm-addr-overlap.patch" that Tom mentioned and
> included in his post.
> After Tom's fixes are merged, this is the only patch that will be
> needed.
>
> The patch is for oprofile 0.9.1. Oprofile 0.9.2, which will be release
> soon, will include XenOprofile support for active domains but it will
> not support passive domains. I will generate a patch with passive domain
> support for oprofile 0.9.2 when it is released.
>
> I hope Tom patches are accepted and make into Xen 3.0.3
>
> Thanks
>
> Renato

Hi all,

OProfile 0.9.2 was released this past Friday, Sept 15. It is available on the
OProfile website:

http://oprofile.sourceforge.net/news/

-Will

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
Renato,

Well, I'd postponed any work with xenoprof until we had a working 3.0.3
version plus the local patches that we are using (includes the xenoprof
patches that Tom Woller et al have done).

So, I'm now working with an oprofile 0.9.2 plus your patch
oprofile-0.9.2-xen.patch from the HP open source website. The particular
project we are working on requires us to obtain profiles for the HVM guest
kernel. Unfortunately, my first few tries at this have been unsuccessful (I
get lots of "lost kernel sample" messages in the oprofiled.log and no
reported samples for the guest kernel. :-( ).

So I guess my guestion to you is, do you have access to a VT or AMD V enabled
platform that you can test stuff on? (I'd like to find a collegue to work
with on this problem if at all possible.) I have dedicated VT and AMD
platforms for my use, so if you have a VT platorm, we can get stuff to work
correctly there first and then I can work with Tom et al to get the AMD V
versions to work.

--
Ray Bryant
AMD Performance Labs Austin, Tx
512-602-0038 (o) 512-507-7807 (c)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
Ray,

I have an AMD machine in my Lab which I believe has SVM support.
I can use that if needed, but I will need sometime to get it ready and
running Xen.
I thought Tom has tested oprofile with both AMD and Intel HVM guests and
that things were working fine.
Could you please sync up with Tom and make sure it is not a problem with
your configuration.
Tom can you confirm you were able to successfully run XenOprofile for
HVM guests?
If needed I can try to reproduce your problem here when I have my AMD
machine up.

Regards

Renato

> -----Original Message-----
> From: Ray Bryant [mailto:raybry@mpdtxmail.amd.com]
> Sent: Tuesday, November 07, 2006 9:25 AM
> To: xen-devel@lists.xensource.com
> Cc: Santos, Jose Renato G; Woller, Thomas
> Subject: Re: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> XenOProfile
>
> Renato,
>
> Well, I'd postponed any work with xenoprof until we had a
> working 3.0.3 version plus the local patches that we are
> using (includes the xenoprof patches that Tom Woller et al have done).
>
> So, I'm now working with an oprofile 0.9.2 plus your patch
> oprofile-0.9.2-xen.patch from the HP open source website.
> The particular
> project we are working on requires us to obtain profiles for
> the HVM guest
> kernel. Unfortunately, my first few tries at this have been
> unsuccessful (I
> get lots of "lost kernel sample" messages in the
> oprofiled.log and no reported samples for the guest kernel. :-( ).
>
> So I guess my guestion to you is, do you have access to a VT
> or AMD V enabled
> platform that you can test stuff on? (I'd like to find a
> collegue to work
> with on this problem if at all possible.) I have dedicated
> VT and AMD
> platforms for my use, so if you have a VT platorm, we can get
> stuff to work correctly there first and then I can work with
> Tom et al to get the AMD V versions to work.
>
> --
> Ray Bryant
> AMD Performance Labs Austin, Tx
> 512-602-0038 (o) 512-507-7807 (c)
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
> I have an AMD machine in my Lab which I believe has SVM support.
> I can use that if needed, but I will need sometime to get it
> ready and running Xen.
> I thought Tom has tested oprofile with both AMD and Intel HVM
> guests and that things were working fine.
thanks renato, I believe that the hypervisor portion of xenoprofile is
sending
the correct mode, eip/rip values. I'll get with Ray and see if we can
track
down where the issue might be (oprofile or hv, or configuration issue).

> Could you please sync up with Tom and make sure it is not a
> problem with your configuration.
> Tom can you confirm you were able to successfully run
> XenOprofile for HVM guests?
> If needed I can try to reproduce your problem here when I
> have my AMD machine up.
We'll definitely let you know if we need some assistance in the oprofile
area.
Any idea when will 0.9.3 be out? I know that some of the distros are
trying to add your xenoprofile patch on top of 0.9.2 for their releases,
and having 0.9.3 would be easier that already contained the xen patches.

--Tom

>
> Regards
>
> Renato
>
> > -----Original Message-----
> > From: Ray Bryant [mailto:raybry@mpdtxmail.amd.com]
> > Sent: Tuesday, November 07, 2006 9:25 AM
> > To: xen-devel@lists.xensource.com
> > Cc: Santos, Jose Renato G; Woller, Thomas
> > Subject: Re: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> > XenOProfile
> >
> > Renato,
> >
> > Well, I'd postponed any work with xenoprof until we had a working
> > 3.0.3 version plus the local patches that we are using
> (includes the
> > xenoprof patches that Tom Woller et al have done).
> >
> > So, I'm now working with an oprofile 0.9.2 plus your patch
> > oprofile-0.9.2-xen.patch from the HP open source website.
> > The particular
> > project we are working on requires us to obtain profiles
> for the HVM
> > guest
> > kernel. Unfortunately, my first few tries at this have been
> > unsuccessful (I
> > get lots of "lost kernel sample" messages in the
> oprofiled.log and no
> > reported samples for the guest kernel. :-( ).
> >
> > So I guess my guestion to you is, do you have access to a
> VT or AMD V
> > enabled
> > platform that you can test stuff on? (I'd like to find a
> > collegue to work
> > with on this problem if at all possible.) I have dedicated
> > VT and AMD
> > platforms for my use, so if you have a VT platorm, we can
> get stuff to
> > work correctly there first and then I can work with Tom et
> al to get
> > the AMD V versions to work.
> >
> > --
> > Ray Bryant
> > AMD Performance Labs Austin, Tx
> > 512-602-0038 (o) 512-507-7807 (c)
> >
> >
> >
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
> -----Original Message-----
> From: Woller, Thomas [mailto:thomas.woller@amd.com]
> Sent: Wednesday, November 08, 2006 7:12 AM
> To: Santos, Jose Renato G; Ray Bryant; xen-devel@lists.xensource.com
> Subject: RE: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> XenOProfile
>
> > I have an AMD machine in my Lab which I believe has SVM support.
> > I can use that if needed, but I will need sometime to get
> it ready and
> > running Xen.
> > I thought Tom has tested oprofile with both AMD and Intel
> HVM guests
> > and that things were working fine.
> thanks renato, I believe that the hypervisor portion of
> xenoprofile is sending the correct mode, eip/rip values.
> I'll get with Ray and see if we can track down where the
> issue might be (oprofile or hv, or configuration issue).
>

Ok. That seems a good plan.
I will be glad to help if I can when you have more details.
On a related note, I received a report that XenOprofile is missing some
user level samples. I am preparing a patch with the fix and should post
it to the list later today. This should affect kernel samples though.

> > Could you please sync up with Tom and make sure it is not a problem
> > with your configuration.
> > Tom can you confirm you were able to successfully run
> XenOprofile for
> > HVM guests?
> > If needed I can try to reproduce your problem here when I
> have my AMD
> > machine up.
> We'll definitely let you know if we need some assistance in
> the oprofile area.
> Any idea when will 0.9.3 be out? I know that some of the
> distros are trying to add your xenoprofile patch on top of
> 0.9.2 for their releases, and having 0.9.3 would be easier
> that already contained the xen patches.

No I don't know when 0.9.3 wil be out. I still need to sync up with
William Cohen to get the passive domain patches into the oprofile CVS
tree. I was waiting to finish some cleanups in the patch before sending
it to him, but I did not have had time to work on this yet.

Regards

Renato

>
> --Tom
>
> >
> > Regards
> >
> > Renato
> >
> > > -----Original Message-----
> > > From: Ray Bryant [mailto:raybry@mpdtxmail.amd.com]
> > > Sent: Tuesday, November 07, 2006 9:25 AM
> > > To: xen-devel@lists.xensource.com
> > > Cc: Santos, Jose Renato G; Woller, Thomas
> > > Subject: Re: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> > > XenOProfile
> > >
> > > Renato,
> > >
> > > Well, I'd postponed any work with xenoprof until we had a working
> > > 3.0.3 version plus the local patches that we are using
> > (includes the
> > > xenoprof patches that Tom Woller et al have done).
> > >
> > > So, I'm now working with an oprofile 0.9.2 plus your patch
> > > oprofile-0.9.2-xen.patch from the HP open source website.
> > > The particular
> > > project we are working on requires us to obtain profiles
> > for the HVM
> > > guest
> > > kernel. Unfortunately, my first few tries at this have been
> > > unsuccessful (I
> > > get lots of "lost kernel sample" messages in the
> > oprofiled.log and no
> > > reported samples for the guest kernel. :-( ).
> > >
> > > So I guess my guestion to you is, do you have access to a
> > VT or AMD V
> > > enabled
> > > platform that you can test stuff on? (I'd like to find a
> > > collegue to work
> > > with on this problem if at all possible.) I have dedicated
> > > VT and AMD
> > > platforms for my use, so if you have a VT platorm, we can
> > get stuff to
> > > work correctly there first and then I can work with Tom et
> > al to get
> > > the AMD V versions to work.
> > >
> > > --
> > > Ray Bryant
> > > AMD Performance Labs Austin, Tx
> > > 512-602-0038 (o) 512-507-7807 (c)
> > >
> > >
> > >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> >
> >
> >
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
On Wednesday 08 November 2006 10:54, Santos, Jose Renato G wrote:

>
> Ok. That seems a good plan.
> I will be glad to help if I can when you have more details.
> On a related note, I received a report that XenOprofile is missing some
> user level samples. I am preparing a patch with the fix and should post
> it to the list later today. This should affect kernel samples though.
>

"should" or "should not" affect kernel samples?

I went back through my old tests and the last time I had a good profile output
was with change set 10650 in September.

<snip>

--
Ray Bryant
AMD Performance Labs Austin, Tx
512-602-0038 (o) 512-507-7807 (c)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
> -----Original Message-----
> From: Ray Bryant [mailto:raybry@mpdtxmail.amd.com]
> Sent: Wednesday, November 08, 2006 11:23 AM
> To: Santos, Jose Renato G
> Cc: Woller, Thomas; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> XenOProfile
>
> On Wednesday 08 November 2006 10:54, Santos, Jose Renato G wrote:
>
> >
> > Ok. That seems a good plan.
> > I will be glad to help if I can when you have more details.
> > On a related note, I received a report that XenOprofile is missing
> > some user level samples. I am preparing a patch with the fix and
> > should post it to the list later today. This should affect
> kernel samples though.
> >
>
> "should" or "should not" affect kernel samples?
>

Sorry for the typo. It should NOT affect kernel samples
REnato

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
Santos, Jose Renato G wrote:

<snip>

>>>
>>> Ok. That seems a good plan.
>>> I will be glad to help if I can when you have more details.
>>> On a related note, I received a report that XenOprofile is missing
>>> some user level samples. I am preparing a patch with the fix and
>>> should post it to the list later today. This should affect kernel
>>> samples though.
>>>
>>
>> "should" or "should not" affect kernel samples?
>>
>
> Sorry for the typo. It should NOT affect kernel samples REnato

That's what I figured, but was just checking. :-)

I mispoke before, the last time I have this stuff working was with cs
11408 and what I labeled "old profile" (whatever that was...)

So I went back and resurrected my cs 11408 xen build and ran three
different versions of xenoprof against it:

(1) oprofile 0.9.2 + your patch for 0.9.2
(2) oprofile 0.9.1 + your patch r3 for 0.9.1
(3) oprofile 0.9.1 + Rosimildo's old patch to fix image->start and
image->end for 64 bit hypervisor

(1) and (2) didn't give me any xen or guest kernel samples. (3) worked
the way I was expecting things to work (as it had before).
So I am guessing that (3) is the old profile I used before.

I rebooted to cs 11785 + AMD patches, and retried (3) and it works
basically the same as it did for 11408 (whew). I still haven't
verified that the xen and kernel guest samples are correct, but at least
there are xen, kernel guest, kernel user samples and I'm not getting any
with (1) or (2).

So I am thinking that the problems I am seeing are related to 64-bit
hypervisor and the more recent fixes than Rosimildo's patchset.

--
Best Regards,

Ray

Ray Bryant, Ph. D.
x50038 or 512-602-0038
AMD Performance Labs
Austin, Texas



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
Ray,

Do you get versions 1 and 2 working with 32bit Xen?
Could you please send me Rosimildo patches. I don't think I have it and
I would like to compare with the others.
Thanks

Renato

> -----Original Message-----
> From: Bryant, Ray [mailto:ray.bryant@amd.com]
> Sent: Wednesday, November 08, 2006 1:01 PM
> To: Santos, Jose Renato G; Ray Bryant
> Cc: Woller, Thomas; xen-devel@lists.xensource.com
> Subject: RE: [Xen-devel] [XENOPROLIFE] New oprofile patch for
> XenOProfile
>
> Santos, Jose Renato G wrote:
>
> <snip>
>
> >>>
> >>> Ok. That seems a good plan.
> >>> I will be glad to help if I can when you have more details.
> >>> On a related note, I received a report that XenOprofile
> is missing
> >>> some user level samples. I am preparing a patch with the fix and
> >>> should post it to the list later today. This should affect kernel
> >>> samples though.
> >>>
> >>
> >> "should" or "should not" affect kernel samples?
> >>
> >
> > Sorry for the typo. It should NOT affect kernel samples REnato
>
> That's what I figured, but was just checking. :-)
>
> I mispoke before, the last time I have this stuff working was with cs
> 11408 and what I labeled "old profile" (whatever that was...)
>
> So I went back and resurrected my cs 11408 xen build and ran
> three different versions of xenoprof against it:
>
> (1) oprofile 0.9.2 + your patch for 0.9.2
> (2) oprofile 0.9.1 + your patch r3 for 0.9.1
> (3) oprofile 0.9.1 + Rosimildo's old patch to fix image->start and
> image->end for 64 bit hypervisor
>
> (1) and (2) didn't give me any xen or guest kernel samples.
> (3) worked
> the way I was expecting things to work (as it had before).
> So I am guessing that (3) is the old profile I used before.
>
> I rebooted to cs 11785 + AMD patches, and retried (3) and it
> works basically the same as it did for 11408 (whew). I
> still haven't verified that the xen and kernel guest samples
> are correct, but at least there are xen, kernel guest, kernel
> user samples and I'm not getting any with (1) or (2).
>
> So I am thinking that the problems I am seeing are related to
> 64-bit hypervisor and the more recent fixes than Rosimildo's patchset.
>
> --
> Best Regards,
>
> Ray
>
> Ray Bryant, Ph. D.
> x50038 or 512-602-0038
> AMD Performance Labs
> Austin, Texas
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [XENOPROLIFE] New oprofile patch for XenOProfile [ In reply to ]
On Wednesday 08 November 2006 16:06, Santos, Jose Renato G wrote:
> Ray,
>
> Do you get versions 1 and 2 working with 32bit Xen?
> Could you please send me Rosimildo patches. I don't think I have it and
> I would like to compare with the others.
> Thanks
>
> Renato
>
<snip>

I'm attaching the patches I applied to make what I was referring to as "old
profile".

At the moment, I'm not setup to do a 32-bit hypervisor build or test (I short-
sightedly decided some time ago just to work on 64-bit hypervisors and am
still suffereing the effects of that decision. :-) ).

I'll see if I can get access to a 32-bit built setup from Tom et al and try
xenoprof for that case.

Please note, even Rosamildo would call the 3rd patch of this set a hack. :-)
Obviously, I had to revert this in order to get guest kernel profiling to work
for the 32-bit guest/64-bit hypervisor case.

--
Ray Bryant
AMD Performance Labs Austin, Tx
512-602-0038 (o) 512-507-7807 (c)