Description of the architecture of requests servicing schedulers, with separated
[lttv.git] / ltt / branches / poly / doc / developer / requests_servicing_schedulers.txt
CommitLineData
ca566f70 1Linux Trace Toolkit
2
3Requests Servicing Schedulers
4
5
6Mathieu Desnoyers, 07/06/2004
7
8
9In the LTT graphical interface, two main types of events requests may occur :
10
11- events requests made by a viewer concerning a traceset for a ad hoc
12 computation.
13- events requests made by a viewer concerning a trace for a precomputation.
14
15
16Ad Hoc Computation
17
18The ad hoc computation must be serviced immediately : they are directly
19responding to events requests that must be serviced to complete the graphical
20widgets'data. This kind of computation may lead to incomplete result as long as
21precomputation are not finished. Once precomputation is over, the widgets will
22be redrawn if they needed such information. A ad hoc computation is done on a
23traceset : the workspace of a tab.
24
25Precomputation
26
27Traces are global objects. Only one instance of a trace is opened for all the
28program. Precomputation will append data to the traces attributes (states,
29statistics). It must inform the widgets which asked for such states or
30statistics of their availability. Only one precomputation must be launched for
31each trace and no duplication of precomputation must be done.
32
33
34Schedulers
35
36There is one tracesetcontext per traceset. Each reference to a trace by a
37traceset also has its own tracecontext. Each trace, by itself, has its own
38tracecontext.
39
40Let's define a scheduler as a g_idle events request servicing function.
41
42There is one scheduler per traceset context (registered when there are requests
43to answer). There is also one scheduler per autonomous trace context (not
44related to any traceset context).
45
46A scheduler processes requests for a specific traceset or trace by combining
47time intervals of the requests. It is interruptible by any GTK event. A
48precomputation scheduler has a lower priority than a ad hoc computation
49scheduler. That means that no precomputation will be performed until there is
50no more ad hoc compuation pending. When a scheduler is interrupted, it makes no
51assumption about the presence or absence of the current requests in its pool
52when it starts back.
53
54
55Foreground Scheduler
56
57There can be one foreground scheduler per traceset (one traceset per tab). It
58simply calls the hooks given by the events requests of the viewers for the
59specified time intervals.
60
61
62Background Scheduler
63
64It has its own events requests pool. It services them just like a foreground
65scheduler. The difference comes in that there may be duplicated requests :
66for instance, statistics computation for a trace can be asked by two viewers
67at the same time. Another difference is that the hook_data of theses requests
68will typically be NULL, and the typical hook function will be located in a
69library upon which the viewer depends.
70
71
72
73Hooks Lists
74
75In order to answer the problems of background processing, we need to add a
76reference counter for each hook of a hook list. If the same hook is added twice,
77it will be called only once, but it will need two "remove" to be really removed
78from the list. Two hooks are identical if they have the same function pointer
79and hook_data.
80
81
82EventsRequest Structure
83
84This structure is the element of the events requests pools. The viewer field is
85used as an ownership identifier as well as pointer to the data structure upon
86which the action applies. Typically, this is a pointer to the viewer's data
87structure.
88
89In a ad hoc events request, a pointer to this structure is used as hook_data in
90the hook lists
91
92The typical case for a background computation is that the hook_data will be set
93to NULL instead. No particular hook_data is needed as this type of request does
94only modify trace related data structures which are available through the
95call_data.
96
97
98
This page took 0.025336 seconds and 4 git commands to generate.