On (Tue) 24 Jul 2012 [11:36:57], Yoshihiro YUNOMAE wrote:
Therefore, we propose a new system "virtio-trace", which uses enhanced
virtio-serial and existing ring-buffer of ftrace, for collecting guest kernel
tracing data. In this system, there are 5 main components:
(1) Ring-buffer of ftrace in a guest
- When trace agent reads ring-buffer, a page is removed from ring-buffer.
(2) Trace agent in the guest
- Splice the page of ring-buffer to read_pipe using splice() without
memory copying. Then, the page is spliced from write_pipe to virtio
without memory copying.
I really like the splicing idea.
(3) Virtio-console driver in the guest
- Pass the page to virtio-ring
(4) Virtio-serial bus in QEMU
- Copy the page to kernel pipe
(5) Reader in the host
- Read guest tracing data via FIFO(named pipe)
So will this be useful only if guest and host run the same kernel?
I'd like to see the host kernel not being used at all -- collect all
relevant info from the guest and send it out to qemu, where it can be
consumed directly by apps driving the tracing.
***Evaluation***
When a host collects tracing data of a guest, the performance of using
virtio-trace is compared with that of using native(just running ftrace),
IVRing, and virtio-serial(normal method of read/write).
Why is tracing performance-sensitive? i.e. why try to optimise this
at all?
***Just enhancement ideas***
- Support for trace-cmd
- Support for 9pfs protocol
- Support for non-blocking mode in QEMU
There were patches long back (by me) to make chardevs non-blocking but
they didn't make it upstream. Fedora carries them, if you want to try
out. Though we want to converge on a reasonable solution that's
acceptable upstream as well. Just that no one's working on it
currently. Any help here will be appreciated.
- Make "vhost-serial"
I need to understand a) why it's perf-critical, and b) why should the
host be involved at all, to comment on these.