From: compudj Date: Tue, 5 Dec 2006 22:11:28 +0000 (+0000) Subject: update xen design X-Git-Tag: v0.12.20~1204 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d3a1730c69b9079c352fffb718ce2e45b62d27cc;p=lttv.git update xen design git-svn-id: http://ltt.polymtl.ca/svn@2285 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/doc/developer/lttng-xen.txt b/ltt/branches/poly/doc/developer/lttng-xen.txt new file mode 100644 index 00000000..0c26a4bf --- /dev/null +++ b/ltt/branches/poly/doc/developer/lttng-xen.txt @@ -0,0 +1,83 @@ + + +LTTng for Xen + +Design document + +Mathieu Desnoyers, November 2006 + +Last modification : + +Only allow a single channel. Directory consumed by a lttd-xen client through +hypercalls. This design choice is made because there are no RCU lists and there +is no link between the number of CPUs seen by Xen and number of CPUs in the +dom0. + +Does better than Xentrace : +Variable size records +Easily extensible event description +// not planned : missing RCU list. Multiple active traces +Reader uses poll()-like mechanism instead of polling the buffers each 100ms. + + +* Dom0 lttd-xen process + +Does an hypercall to map the buffers. +Does an hypercall to poll for data, put to sleep by the OS. +Uses write from the mapped buffers to a file. + + +* Xen + +tb_control (hypercalls seen from dom0 OS) +- trace_create +Map a page for control information, return it for mapping by user space. (rw) +Map multiple pages for buffers. return them for mapping by user space. +(shared, read-only for consumer) +- trace_start +Activate tracing in control information. +- trace_stop +Stop tracing in control information. +- trace_destroy +wait for pending writers (is the hypervisor preemptible ? not full.) + Preemption : not full -> spinlock does not disable preemption : would deadlock + for the non irq_disable case. + volountary : poll call -> volountary. explicit __schedule call., do_yield(). +Quiescent state detection. + for_each_domain( d ) + for_each_vcpu( d, v ) + vcpu_sleep_sync(v); +destroy the channels + +Events coming from xen : +- Buffer switch + through virq sent to dom0 + + + +* Dom0 Linux OS + +Receive virq upon buffer switch. +xen_wakeup_readers handler : wakes up the readers for the channel. + +Hypercalls are autonomous from LTTng linux kernel tracing. + +on lttngxentrace create, hypercall channel_create +on lttngxentrace start, hypercall channel_start +on lttngxentrace stop, hypercall channel_stop +on lttngxentrace destroy, hypercall channel_destroy + + +* Facilities + +Export a facilities per cpu channel too. + + +Q1 : In Xen preemptible ? Full ? Volountary ? Volountary X +Q2 : How to synchronize to wait for writers to finish writing ? X + + +Number of CPUs in dom0 != number of CPUs in Xen. +CPU hotplug in kernel tracing ? Done. + +