update compat
[lttv.git] / tags / lttv-0.11.3-23102008 / doc / developer / lttng-userspace-tracing-lite.txt
CommitLineData
13ab9fcb 1
2
3Mathieu Desnoyers
4
5March 2006
6
7Here is a simpler, but slower, version of user space tracing design.
8
9It will be useful on architectures where doing a system call is mandatory, for
10example when CPUs are lacking a 64 bits TSC : it must be worked around by doing
11a system call to the the time or the synthetic MSB of the TSC (yes, disabling
12preemption is at least required).
13
14
15So the design is simple :
16
17Two system calls :
18
19One system call for event logging
20
21
22ltt_trace_generic
23args :
24fac_id
25event_id
26data pointer
27data size
28
29ltt_register_generic
30args:
31struct pointer (in)
32fac_id pointer (out)
33
34#define NAME_MAX 4096
35
36struct :
37char name[NAME_MAX]
38u32 num_events
39u32 checksum
40u32 alignment
41u32 int_size
42u32 long_size
43u32 pointer_size
44u32 size_t_size
45
46
47If a facility is registered twice, the same handle is used.
48 For a facility to be the exact same, it must share _every_ element of the
49 struct (even type sizes).
50Potential problem : If a facility is registered, it is never unregistered.
51
52Now.. not being able to free facilities when they are not used is not fun. So
53how can we know every process that has registered a facility have finished using
54it ? If we know that, we might do a cleanup when _all_ the traces are destroyed:
55this is way better than a reboot.
56
57A solution might be to keep a reference count to the fac_id : it would be
58incremented upon registration and decremented when a process exits. To do that,
59a process must keep an array of fac ids it uses. 0 is unset.
60
61CONFIG option :
62
63CONFIG_LTT_USERSPACE_GENERIC
64
65
66
67
68
69
This page took 0.024837 seconds and 4 git commands to generate.