UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant softwd
Participant
446 Views
Registered: ‎09-18-2018

How to get Xen Aware Debug working?

Jump to solution

Hi all,

I am trying to get Xen Aware Debug working for a few days now following Enabling Xen Awareness. I used "vmlinux" as my symbol file as shown below:

vmlinux_capture.JPG

and I could see the Linux Kernel Info as shown below:

Capture.JPG

But according to the tutorial,  I should be able to see this:

enable_linux_os_awareness_xen.png

I must be missing some files or some steps, could someone suggest how to get it working as the tutorial?

Thanks a lot for your time.

0 Kudos
1 Solution

Accepted Solutions
Visitor jeffkubascik
Visitor
326 Views
Registered: ‎05-30-2018

Re: How to get Xen Aware Debug working?

Jump to solution

One workaround you can use here is to pin each virtual machine to a different CPU in the guest config file.  Using the XSDK debugger, you can assign a different debug symbol file to each CPU.  Whenever you pause the CPU, it will be in either the virtual machine or the Xen kernel.  This allows you to step through the virtual machine code fairly easily.

My team works with Xen on the MPSoC frequently.  We use the Power Debug Pro from Lauterbach for debugging the Xen kernel as well as virtual machine guests.  Their software tool, TRACE32, has both Xen and Linux awareness built in and works great once configured correctly.

Sincerely,

Jeff

Jeff Kubascik
Embedded Systems Engineer

DornerWorks
3445 Lake Eastbrook Blvd. SE
Grand Rapids, MI 49546
6 Replies
Moderator
Moderator
407 Views
Registered: ‎04-24-2017

Re: How to get Xen Aware Debug working?

Jump to solution

Hi @softwd,

In order to use a debugger with Xen, the hypervisor needs to be able to virtualize debug registers properly, which is missing today. 

Our Xen maintainer is working on this radar.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Participant softwd
Participant
395 Views
Registered: ‎09-18-2018

Re: How to get Xen Aware Debug working?

Jump to solution

Hi Sandeep,

Thank you so much for the info! Glad I got a proper update on the status of Xen Aware Debug. 

Before Xen Aware Debug is ready for the mass market, assuming more than a year down the road, what do you recommend me to use as a debug tool in the mean time?

Right now I am inserting ridiculous amount of "xil_printf" in my DomU Baremetal program to debug.

Thanks again! 

 

0 Kudos
Visitor jeffkubascik
Visitor
327 Views
Registered: ‎05-30-2018

Re: How to get Xen Aware Debug working?

Jump to solution

One workaround you can use here is to pin each virtual machine to a different CPU in the guest config file.  Using the XSDK debugger, you can assign a different debug symbol file to each CPU.  Whenever you pause the CPU, it will be in either the virtual machine or the Xen kernel.  This allows you to step through the virtual machine code fairly easily.

My team works with Xen on the MPSoC frequently.  We use the Power Debug Pro from Lauterbach for debugging the Xen kernel as well as virtual machine guests.  Their software tool, TRACE32, has both Xen and Linux awareness built in and works great once configured correctly.

Sincerely,

Jeff

Jeff Kubascik
Embedded Systems Engineer

DornerWorks
3445 Lake Eastbrook Blvd. SE
Grand Rapids, MI 49546
Participant softwd
Participant
312 Views
Registered: ‎09-18-2018

Re: How to get Xen Aware Debug working?

Jump to solution

Thanks Jeff!

This is amazing, the work around you mentioned totally worked! Much appreciated!

Still having trouble debugging Linux Kernel using this Attach and Debug Linux Kernel Using Xilinx System Debugger though. This might be an extremely outdated tutorial; I could see all the processes running in Linux after inserting the "vmlinux" symbol file, just not being able to put break points for any of them. The XSDK and Linux will just hang after step 14.

Also thanks for the suggestions on debugging tools! Does it offer more feature or better support than XSDK? So far XSDK is good enough for for what I need, but I run into road blocks often since not many people discuss Xen on ZynqMP on this forum.

0 Kudos
Visitor jeffkubascik
Visitor
294 Views
Registered: ‎05-30-2018

Re: How to get Xen Aware Debug working?

Jump to solution
It really depends on what you are trying to debug. For Linux userspace applications, I tend to use gdb as it is well supported and simple to use. For low level Xen/ kernel/ virtual machine debugging, the Lauterbach TRACE32 software provides additional tools not found in XSDK that can be very helpful, such as device register decoding, dumping the MMU page tables (both stages), debugging/ switching into suspended VCPUs, stack tracing across system calls, and tracing. However, the TRACE32 tool has a bit of a learning curve and takes some work to set up correctly, whereas I find XSDK quick and easy to get started.
Jeff Kubascik
Embedded Systems Engineer

DornerWorks
3445 Lake Eastbrook Blvd. SE
Grand Rapids, MI 49546
0 Kudos
Participant softwd
Participant
280 Views
Registered: ‎09-18-2018

Re: How to get Xen Aware Debug working?

Jump to solution

Thanks for your explanation; I will look into the solution when XSDK is not cutting it for me.

0 Kudos