update compat
[lttv.git] / doc / developer / lttng-xen.txt
CommitLineData
d3a1730c 1
2
3LTTng for Xen
4
5Design document
6
7Mathieu Desnoyers, November 2006
8
9Last modification :
10
11Only allow a single channel. Directory consumed by a lttd-xen client through
12hypercalls. This design choice is made because there are no RCU lists and there
13is no link between the number of CPUs seen by Xen and number of CPUs in the
14dom0.
15
16Does better than Xentrace :
17Variable size records
18Easily extensible event description
19// not planned : missing RCU list. Multiple active traces
20Reader uses poll()-like mechanism instead of polling the buffers each 100ms.
21
22
23* Dom0 lttd-xen process
24
1bb8d3a5 25Does an hypercall to map the buffers (increment refcount)
d3a1730c 26Does an hypercall to poll for data, put to sleep by the OS.
27Uses write from the mapped buffers to a file.
1bb8d3a5 28unmap buffer, decrement refcount.
d3a1730c 29
30
31* Xen
32
33tb_control (hypercalls seen from dom0 OS)
1bb8d3a5 34(hypercalls done by lttctl-xen)
d3a1730c 35- trace_create
36Map a page for control information, return it for mapping by user space. (rw)
37Map multiple pages for buffers. return them for mapping by user space.
38(shared, read-only for consumer)
1bb8d3a5 39increment refcount
d3a1730c 40- trace_start
41Activate tracing in control information.
42- trace_stop
43Stop tracing in control information.
44- trace_destroy
45wait for pending writers (is the hypervisor preemptible ? not full.)
46 Preemption : not full -> spinlock does not disable preemption : would deadlock
47 for the non irq_disable case.
48 volountary : poll call -> volountary. explicit __schedule call., do_yield().
49Quiescent state detection.
50 for_each_domain( d )
51 for_each_vcpu( d, v )
52 vcpu_sleep_sync(v);
1bb8d3a5 53decrement refcount : destroy the channels
d3a1730c 54
55Events coming from xen :
56- Buffer switch
57 through virq sent to dom0
c850d220 58- wakes up poll on the buffers FD.
d3a1730c 59
60
61* Dom0 Linux OS
62
63Receive virq upon buffer switch.
64xen_wakeup_readers handler : wakes up the readers for the channel.
65
66Hypercalls are autonomous from LTTng linux kernel tracing.
67
68on lttngxentrace create, hypercall channel_create
69on lttngxentrace start, hypercall channel_start
70on lttngxentrace stop, hypercall channel_stop
71on lttngxentrace destroy, hypercall channel_destroy
72
73
74* Facilities
75
76Export a facilities per cpu channel too.
77
78
79Q1 : In Xen preemptible ? Full ? Volountary ? Volountary X
80Q2 : How to synchronize to wait for writers to finish writing ? X
81
82
83Number of CPUs in dom0 != number of CPUs in Xen.
84CPU hotplug in kernel tracing ? Done.
85
86
This page took 0.050101 seconds and 4 git commands to generate.