xm dmesg and performance on serial port
Hello,
I might only have configuration problem, but I couldn't find any docs that could relate to the problem. The command: 'xm dmesg' seems to stop buffering any output after a while. I have to enable serial port to get the output bigger than the buffer. I don't know how big the buffer or if it's circular? Is there anyway to fix this behavior?
The second question I have since I have to enable the serial line. Considering the speed of the serial line is very slow. Would that affect the performance of XEN than just buffering the output (for 'xm dmesg')? I do have to output some messages when a certain event occurs. Will enabling more consoles (serials, vga, tty) slow the performance by default?
Just by reading the XEN papers, XEN has a way to register asynchronous events to the domains. Would it be better in terms of performance to send the event messages to a particular domain (e.g: Domain 0) using the asynchronous mechanism and have the domain kernel to handle the messages as XEN events.
Thanks in advance for any comments.
Kuas.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Quoted 5 lines
I might only have configuration problem, but I couldn't find any docs that could relate to the problem. The command: 'xm dmesg' seems to stop buffering any output after a while. I have to enable serial port to get the output bigger than the buffer. I don't know how big the buffer or if it's circular? Is there anyway to fix this behavior?
It's not currently circular. There used to be a -c flag to xm dmesg (or it's equivalent) that cleared the buffer - does that work? There's code somewhere in Xen which could support a circular buffer with not much effort.
Quoted 3 lines
The second question I have since I have to enable the serial line. Considering the speed of the serial line is very slow. Would that affect the performance of XEN than just buffering the output (for 'xm dmesg')?
Doing *lots* of printfs to the serial line is going to really hurt your performance but maybe that doesn't matter so much for debugging? Occasional printfs probably won't matter very much.
Quoted 5 lines
Just by reading the XEN papers, XEN has a way to register asynchronous events to the domains. Would it be better in terms of performance to send the event messages to a particular domain (e.g: Domain 0) using the asynchronous mechanism and have the domain kernel to handle the messages as XEN events.
We don't use xm dmesg that much for debugging, generally just tracing through the code and using an attached serial line.
You might want to look at the tracebuffer and the xentrace tools. The tracebuffer allows you to log events within Xen itself with low overhead into a circular buffer. The xentrace command in dom0 will read this data out and decode it according to a format file. There's man pages for the xentrace* tools and the docs/interface.tex manual (although mostly out of date) explains how to put trace points into the Xen code.
HTH,
Mark
Quoted 6 lines
Thanks in advance for any comments.
Kuas.
Quoted 9 lines
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Quoted 11 lines
Quoted 8 lines
I might only have configuration problem, but I couldn't find any docs that could relate to the problem. The command: 'xm dmesg' seems to stop buffering any output after a while. I have to enable serial port to get the output bigger than the buffer. I don't know how big the buffer or if it's circular? Is there anyway to fix this behavior?
It's not currently circular. There used to be a -c flag to xm dmesg (or it's equivalent) that cleared the buffer - does that work? There's code somewhere in Xen which could support a circular buffer with not much effort.
It is not circular or the circular mechanism might have been broken. The buffer just stopped after a certain limit. The code in "console.c" does not seems to be circular either. And the command with "xm dmesg -c" doesn't seem to exist either.
Quoted 11 lines
Quoted 7 lines
Just by reading the XEN papers, XEN has a way to register asynchronous events to the domains. Would it be better in terms of performance to send the event messages to a particular domain (e.g: Domain 0) using the asynchronous mechanism and have the domain kernel to handle the messages as XEN events.
We don't use xm dmesg that much for debugging, generally just tracing through the code and using an attached serial line.
You might want to look at the tracebuffer and the xentrace tools. The tracebuffer allows you to log events within Xen itself with low overhead into a circular buffer. The xentrace command in dom0 will read this data out and decode it according to a format file. There's man pages for the xentrace* tools and the docs/interface.tex manual (although mostly out of date) explains how to put trace points into the Xen code.
xentrace seems to be used for debugging purpose. I am actually doing a security project using Xen. On a particular event that happens in the one of the domain, detected by a module in XEN. I'd like to report it or log it. I am trying to find the best way to do this. Let me know if I'm wrong. Isn't the "event_channel" is the communication channel from XEN to a domain. If I want to get XEN buffer messages (I guess it has to be in shared pages with the domain) to privilege domain 0, and flag the domain to check if there's something in the buffer. And get a handler in domain 0 to consume the buffer. I think this would have much less performance effect. Is there any interface existed that I can use for this? Or I'll just have to built it on top of event_channel.
Thanks,
Kuas.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Quoted 1 line
It is not circular or the circular mechanism might have been broken. The
No, it's not circular by design.
Quoted 3 lines
buffer just stopped after a certain limit. The code in "
console.c" does not seems to be circular either. And the command with "xm dmesg -c" doesn't seem to exist either.
xm dmesg [-c|--clear] should now work if you pull the unstable repo (or wait a little for it to arrive in the stable repo).
Quoted 4 lines
xentrace seems to be used for debugging purpose. I am actually doing a security project using Xen. On a particular event that happens in the one of the domain, detected by a module in XEN. I'd like to report it or log it. I am trying to find the best way to do this.
Yes, the trace buffer is aimed at debugging timing-sensitive problems but it may still suit your needs, or at least provide a starting point.
Quoted 3 lines
Let me know if I'm
wrong. Isn't the "event_channel" is the communication channel from XEN to a domain.
Event channels are Xen's equivalent to interrupts in normal hardware. Event channels may be between Xen and a domain or between a pair of domains. Events send on these are basically like interrupts, i.e. they just mean "look at this!", signalling that some event has just occurred. They don't actually transfer data associated with an event.
Quoted 6 lines
If I want to get XEN buffer messages (I guess it has to be in shared pages with the domain) to privilege domain 0, and flag the domain to check if there's something in the buffer. And get a handler in domain 0 to consume the buffer. I think this would have much less performance effect. Is there any interface existed that I can use for this? Or I'll just have to built it on top of
event_channel.
You've got the right idea. This is basically what the xentrace / trace buffer stuff does, so you might want to look at xen/common/trace.c and tools/xentrace/xentrace.c for the details of how this stuff is done. The trace buffer doesn't actually use an event channel, it just polls periodically but this seems to work OK for our applications.
It would be possible to add a pseudo-device in dom0, which you could just read the trace data out of, with the reading process woken up when new data arrives (as signalled to dom0 by a suitable event channel).
HTH,
Mark
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
Quoted 7 lines
Hello,
I might only have configuration problem, but I couldn't find any docs that could relate to the problem. The command: 'xm dmesg' seems to stop buffering any output after a while. I have to enable serial port to get the output bigger than the buffer. I don't know how big the buffer or if it's circular? Is there anyway to fix this behavior?
It's a circular buffer which you can change the size of (CONSOLE_RING_SIZE in xen/drivers/char/console.c).
Quoted 5 lines
The second question I have since I have to enable the serial line. Considering the speed of the serial line is very slow. Would that affect the performance of XEN than just buffering the output (for 'xm dmesg')? I do have to output some messages when a certain event occurs. Will enabling more consoles (serials, vga, tty) slow the performance by default?
Yes the serial line will be the bottleneck if producing lost of console output in DOM0. It's much slower than placing Xen's output in the ring, or writing it to VGA.
Quoted 5 lines
Just by reading the XEN papers, XEN has a way to register asynchronous events to the domains. Would it be better in terms of performance to send the event messages to a particular domain (e.g: Domain 0) using the asynchronous mechanism and have the domain kernel to handle the messages as XEN events.
Batching events and sending them to DOM0 for storage will be much faster than sending them over a serial line.
-- Keir
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl