convert from svn repository: remove tags directory
[lttv.git] / trunk / lttv / doc / developer / lttng-new-marker-event-desc.txt
CommitLineData
a1d12f1e 1
2Mathieu Desnoyers, June 2007
3
4Marker design
5
6Events are described in data structures in DECLARE_MARKER(), in the same file
7the marker is in, or exported and in a globally included header.
8
9When a new marker is encountered (module load, marker armed), an event_load
10event is traced in the facilities channel. If the marker refers to an already
11existing marker declaration, nothing changes, except that it must check that the
12types match.
13
14At trace start, we take the superset of the filtered in events and arm their
15markers. We trace an event load event for each armed marker encountered.
16
17Format string verification by GCC.
18
19Format string extensions (sequence, structs, arrays..)
20
21Field names.
22
23
24User space tracing
25
26Declare their own DECLARE_MARKER, use MARK() macros that refers to it. At module
27load, (to decide) either the kernel or the library walks on the markers sections
28and issues a marker_load system call. Facility namespacing prefix "user_" is
29used for userspace facilities.
30
31We have to deal with multiple registrations of the same event with different
32caracteristics but same name.
33
34Markers must be enabled by the kernel, if activated and tracing starts.
35
36Modify linker script to get section start and end in programs.
37
38
39-------------------------
40
41Maybe DECLARE_MARKER is not necessary:
42
43Use LTTV dictionnary to add information about events.
44event and field description.
45
46<facility name="fac">
47<event name="event"> <description> assdfas </description> </event>
48<field name="field1"> <description> asdfasdf </description> </field>
49<field name="field2"> <enum>....</enum><description> asdfasdf </description> </field>
50</facility>
51
52Field names
53
54trace_mark(facility_event, "field1 %u field2 %p", asdf, asdf);
55
56Extract the field names from the format string.
57Check for format string equivalence before enabling a marker. Allow enabling
58markers with the same format string as the first one found, but warn about the
59others which do not match.
60Trace an event_load event for each enabled marker with non-NULL format string at
61trace start and when they are activated. Since we want to keep the same format
62string if module loads/unload/reload, and we cannot point into this module's
63memory, we reallocate the entry and copy the format string whenever the newly
64loaded module contains active markers and these markers have a NULL format
65string.
66When we enable a marker, if the marker has a non null format string, we trace a
67marker_load.
68
69Default : cardinal field1, field2....
70Calling: ltt_trace
71callback[0]: ltt_serialize_data
72
73Types
74
75-- Add network byte ordering to types.
76-- Change format strings to use backward compatible types. (format check)
77
78Reserve 8 IDs for core events. Never allow wrapping over 65535 IDs during a
79trace : need compaction when no trace is active.
80
81Marker hash table points to a structure containing the marker's event ID (16
82bits). Assign event ID when a probe is registered.
83
84Compact channel. Use separate 8 bits event IDs for events going in the
85compact channel. Identified by registering probe with id type MARKER_ID_COMPACT.
86
87update probes (temp)
88
89-- Enabling a marker:
90-- give: state marker name, channel.
91/proc/markers: enable/disable name [channel]
92
93probe_data should provide, for ltt:
a1d12f1e 94callbacks
95id <-- will stay in marker because otherwise we would need another hash table.
282ae6d3 96channel index : put inside the marker structure (parameter to register).
97A marker control module
a1d12f1e 98
99Q: field names in dictionnary or in marker ?
100
101
282ae6d3 102What users will do with marker interface:
103
104from userspace:
105enable/disable marker_name (act on any marker, reg by module or other)
106channel marker_name channel_name (act on any marker)
107
108Default: use serializer
109But.. module can override _default_ probe with a "register" operation.
110
111Use case
112Set channel
113Register by specific module (unregister default, register specific)
114activate.
115
116Serve as a proxy for probe registration.
117
118
a1d12f1e 119
This page took 0.035282 seconds and 4 git commands to generate.