make precision correct when calling conversion between LttTime and double, fix viewer...
[lttv.git] / ltt / branches / poly / doc / developer / requests_servicing_schedulers.txt
index 9779691f3ccc21ea8c733236f679a2382f0232e1..beaca69998bf1a1c318c68111358b718769a9dd0 100644 (file)
@@ -73,7 +73,7 @@ context (the trace is specified by the viewer). Then, it processes the whole
 trace with this context (and hooks).
 
 Typically, a module that extends statistics will register hooks in the global
-attributes tree under /TraceState/Statistics/ModuleName/hook_name . A viewer
+attributes tree under /computation/modulename/hook_name . A viewer
 that needs these statistics for a set of traces does a background computation
 request through a call to the main window API function. It must specify all
 types of hooks that must be called for the specified trace.
@@ -94,7 +94,8 @@ queue.
 
 Every hook that are added to the context by the scheduler comes from global
 attributes, i.e.
-/traces/trace_path/TraceState/Statistics/ModuleName/hook_name
+/traces/#
+    in LttvTrace attributes : modulename/hook_name
 
 They come with a flag telling either in_progress or ready. If the flag
 ready is set, a viewer knows that the data it needs is already ready and he
@@ -113,15 +114,15 @@ added!).
 
 New Global Attributes
 
-When a hook is added to the trace context, The variable
-/traces/trace_path/TraceState/Statistics/ModuleName/hook_name is set.
+/traces/#
+    in LttvTrace attributes :
 
 When a processing is fired, a variable
-/traces/trace_path/TraceState/Statistics/ModuleName/in_progress is set.
+                              computation/modulename/in_progress is set.
 
 When a processing finished, a variable
-/traces/trace_path/TraceState/Statistics/ModuleName/in_progress is unset
-/traces/trace_path/TraceState/Statistics/ModuleName/ready is set
+                              computation/modulename/in_progress is unset
+                              computation/modulename/ready is set
 
 
 
@@ -131,7 +132,7 @@ Typical Use For a Viewer
 
 When a viewer wants extended information, it must first check if it is ready.
 if not :
-Before a viewer makes a request, it must check the in_prgoress status of the
+Before a viewer makes a request, it must check the in_progress status of the
 hooks.
 
 If the in_progress is unset, it makes the request.
@@ -178,44 +179,92 @@ Background Scheduler
 Global traces
 
 Two global attributes per trace : 
-/traces/path_to_trace/LttvTrace
+traces/#
   It is a pointer to the LttvTrace structure.
-/traces/path_to_trace/LttvBackgroundComputation
-/traces/path_to_trace/TraceState/...  hooks to add to background computation
-                                      in_progress and ready flags.
-
-struct _LttvBackgroundComputation {
-  GSList *events_requests;
- /* A GSList * to the first events request of background computation for a
-  * trace. */
-  LttvTraceset *ts;
- /* A factice traceset that contains just one trace */
-  LttvTracesetContext *tsc;
- /* The traceset context that reads this trace */
-}
-
+  In the LttvTrace attributes :
+    state/
+      saved_states/
+    statistics/
+      modes/
+      cpu/
+      processes/
+      modulename1/
+      modulename2/
+      ...
+    computation/  /* Trace specific background computation hooks status */
+      state/
+        in_progress
+        ready
+      stats/
+        in_progress
+        ready
+      modulename1/
+        in_progress
+        ready
+    requests_queue/     /* Background computation requests */
+    requests_current/   /* Type : BackgroundRequest */
+    notify_queue/
+    notify_current/
+    computation_traceset/
+    computation_traceset_context/
+
+
+computation/      /* Global background computation hooks */
+  state/
+    before_chunk_traceset
+    before_chunk_trace
+    before_chunk_tracefile
+    after_...
+    before_request
+    after_request
+    event_hook
+    event_hook_by_id
+    hook_adder
+    hook_remover
+  stats/
+    ...
+  modulename1/
+    ...
+
+Hook Adder and Hook remover
+
+Hook functions that takes a trace context as call data. They simply 
+add / remove the computation related hooks from the trace context.
 
 
 
 Modify Traceset
-Points to the global traces. Opens new one only when no instance of the pathname
-exists.
-
-Modify LttvTrace ?
+Points to the global traces. Main window must open a new one only when no
+instance of the pathname exists.
 
 Modify trace opening / close to make them create and destroy
-LttvBackgroundComputation (and call end requests hooks for servicing requests ?)
+LttvBackgroundComputation (and call end requests hooks for servicing requests)
+and global trace info when references to the trace is zero.
+
+
 
 EventsRequest Structure
 
-This structure is the element of the events requests pools. The viewer field is
-used as an ownership identifier as well as pointer to the data structure upon
-which the action applies. Typically, this is a pointer to the viewer's data
-structure.
+This structure is the element of the events requests pools. The owner field is
+used as an ownership identifier. The viewer field is a pointer to the data
+structure upon which the action applies. Typically, both will be pointers to
+the viewer's data structure.
+
+In a ad hoc events request, a pointer to the EventsRequest structure is used as
+hook_data in the hook lists : it must have been added by the viewers.
 
-In a ad hoc events request, a pointer to this structure is used as hook_data in
-the hook lists
 
+Modify module load/unload
+
+A module that registers global computation hooks in the global attributes upon
+load should unregister them when unloaded. Also, it must remove every background
+computation request for each trace that has its own module_name as GQuark.
+
+
+Give an API for calculation modules
+
+Must have an API for module which register calculation hooks. Unregistration
+must also remove all requests made for these hooks.
 
 
 Background Requests Servicing Algorithm (v1)
@@ -229,33 +278,47 @@ notify_in : currently checked notifications
 notify_out : queue of notifications that comes along with next processing.
 
 
+0.1 Lock traces
+0.2 Sync tracefiles
+
 1. Before processing
-  if list_in is empty
+  if list_in is empty
     - Add all requests in list_out to list_in, empty list_out
     - for each request in list_in
-      - add hooks to context
       - set hooks'in_progress flag to TRUE
+      - call before request hook
     - seek trace to start
     - Move all notifications from notify_out to notify_in.
+  - for each request in list_in
+    - Call before chunk hooks for list_in
+    - add hooks to context *note only one hook of each type added.
 
 2. call process traceset middle for a chunk
   (assert list_in is not empty! : should not even be called in that case)
 
 3. After the chunk
-  3.1 call after_chunk hooks from list_in
+  3.1 call after_chunk hooks for list_in
+    - for each request in list_in
+      - Call after chunk hooks for list_in
+      - remove hooks from context *note : only one hook of each type
   3.2 for each notify_in
     - if current time >= notify time, call notify and remove from notify_in
     - if current position >= notify position, call notify and remove from
       notify_in
-  3.2 if end of trace reached
+  3.3 if end of trace reached
     - for each request in list_in
       - set hooks'in_progress flag to FALSE
       - set hooks'ready flag to TRUE
-      - remove hooks from context
+      - call after request hook
       - remove request
     - for each notifications in notify_in
       - call notify and remove from notify_in
-    - return FALSE (scheduler stopped)
-  3.3 else
+    - reset the context
+    - if list_out is empty
+      return FALSE (scheduler stopped)
+    - else
+      return TRUE (scheduler still registered)
+  3.4 else
     - return TRUE (scheduler still registered)
 
+4. Unlock traces
This page took 0.039345 seconds and 4 git commands to generate.