add 3rd gen viewer architecture document
[lttv.git] / trunk / masters-pmf / 3rd_gen_viewer / 3rd_gen_viewer_arch.lyx
CommitLineData
1fde1b39 1#LyX 1.5.5 created this file. For more info see http://www.lyx.org/
2\lyxformat 276
3\begin_document
4\begin_header
5\textclass article
6\language english
7\inputencoding auto
8\font_roman default
9\font_sans default
10\font_typewriter default
11\font_default_family default
12\font_sc false
13\font_osf false
14\font_sf_scale 100
15\font_tt_scale 100
16\graphics default
17\paperfontsize default
18\spacing single
19\papersize default
20\use_geometry false
21\use_amsmath 1
22\use_esint 1
23\cite_engine basic
24\use_bibtopic false
25\paperorientation portrait
26\secnumdepth 3
27\tocdepth 3
28\paragraph_separation skip
29\defskip medskip
30\quotes_language english
31\papercolumns 1
32\papersides 1
33\paperpagestyle default
34\tracking_changes false
35\output_changes false
36\author ""
37\author ""
38\end_header
39
40\begin_body
41
42\begin_layout Title
43A Set of APIs for a Third-Generation Trace Viewer
44\end_layout
45
46\begin_layout Author
47\noindent
48Pierre-Marc Fournier, Michel Dagenais, Mathieu Desnoyers
49\newline
50
51\family typewriter
52\size footnotesize
53<pierre-marc.fournier _at_ polymtl.ca>
54\family default
55\size default
56
57\newline
58
59\newline
60CASI Lab
61\newline
62École Polytechnique de Montréal
63\newline
64
65\newline
66WORK IN PROGRESS
67\end_layout
68
69\begin_layout Section
70Introduction
71\end_layout
72
73\begin_layout Standard
74This document proposes some APIs for a trace viewing and analysis infrastructure.
75\end_layout
76
77\begin_layout Standard
78Design choices were made based on the experience acquired by the design,
79 development and use of two previous generations of trace viewers, respectively
80 the Trace Visualizer from the Linux Trace Toolkit and its successor, the
81 LTTV from the LTTng tracing toolkit.
82\end_layout
83
84\begin_layout Section
85Goals
86\end_layout
87
88\begin_layout Itemize
89Provide an infrastructure for fast, interactive visualization and analysis
90 of huge traces (>10 GB) on standard workstations
91\begin_inset Foot
92status open
93
94\begin_layout Standard
95Efficiency is of great importance.
96 It is tempting to think that as computers get faster, it will be possible
97 to run more complex analyses on traces in a shorter time.
98 In fact, the size of the traces grows as computers get more powerful, because
99 they do more operations than before in the same amount of time and therefore
100 generate more events.
101 The current tendency to parallelize systems is another factor that results
102 in bigger traces.
103\end_layout
104
105\end_inset
106
107
108\end_layout
109
110\begin_layout Itemize
111Support live trace processing
112\end_layout
113
114\begin_layout Itemize
115Allow merging of traces of different formats
116\end_layout
117
118\begin_layout Standard
119\begin_inset Note Note
120status open
121
122\begin_layout Itemize
123Design the viewer in such a way that it can run in parallel on multi-core
124 systems
125\begin_inset Note Greyedout
126status open
127
128\begin_layout Standard
129(Is it worth it? Beware of complex locking issues)
130\end_layout
131
132\end_inset
133
134; No, we don't.
135\end_layout
136
137\end_inset
138
139
140\end_layout
141
142\begin_layout Itemize
143Design with both command line utilities (C language) and graphical interfaces
144 (Java and others) in mind, sharing code and standardizing interfaces as
145 much as possible
146\end_layout
147
148\begin_deeper
149\begin_layout Standard
150Both command-line interfaces and graphical interfaces have an important
151 role to play in trace analysis.
152 While graphical interfaces allow for complex views, command-line utilities
153 can be used quickly in more environments; they can also be more convenient
154 in some circumstances.
155 A good design should be such that they can share code and APIs.
156\end_layout
157
158\end_deeper
159\begin_layout Section
160General aspects
161\end_layout
162
163\begin_layout Itemize
164All data structures must be accessed through API methods, in order to allow
165 for internal change without breaking compatibility.
166\end_layout
167
168\begin_layout Section
169Controlling the tracing of a system
170\end_layout
171
172\begin_layout Subsection
173Overview
174\end_layout
175
176\begin_layout Standard
177The goal of this API is to provide a portable way of controlling tracing
178 of heterogenous systems.
179\end_layout
180
181\begin_layout Standard
182It should enable to do the following actions.
183\end_layout
184
185\begin_layout Itemize
186Set the parameters of a trace (channels, buffering, destination of data
187 (file, network, process)...)
188\end_layout
189
190\begin_layout Itemize
191Control the recording of events (start, stop, pause the trace)
192\end_layout
193
194\begin_layout Itemize
195Create tracepoints (on dynamic tracers) and control which tracepoints are
196 activated (some may be at trace level, others might only permit system
197 level)
198\end_layout
199
200\begin_layout Subsection
201Trace control API
202\end_layout
203
204\begin_layout Itemize
205List the static tracepoints available on a system
206\end_layout
207
208\begin_deeper
209\begin_layout Standard
210These may be static tracepoints (active or inactive) or dynamic tracepoints
211 (active or proposed).
212\end_layout
213
214\end_deeper
215\begin_layout Itemize
216Add a new dynamic tracepoint
217\end_layout
218
219\begin_layout Itemize
220Activate a tracepoint
221\end_layout
222
223\begin_layout Itemize
224Deactivate a tracepoint
225\end_layout
226
227\begin_layout Itemize
228List available probes
229\end_layout
230
231\begin_layout Itemize
232Connect a probe to a tracepoint
233\end_layout
234
235\begin_layout Itemize
236Start tracing
237\end_layout
238
239\begin_layout Itemize
240Stop tracing
241\end_layout
242
243\begin_layout Itemize
244\begin_inset Note Greyedout
245status open
246
247\begin_layout Standard
248others missing...
249\end_layout
250
251\end_inset
252
253
254\end_layout
255
256\begin_layout Section
257Reading traces
258\end_layout
259
260\begin_layout Subsection
261Overview
262\end_layout
263
264\begin_layout Subsubsection
265Timestamps
266\end_layout
267
268\begin_layout Standard
269Timestamps, at the framework level, should be in an architecture-independent
270 format.
271 One possibility would be to have them stored in seconds (with decimals).
272 Offsetting, if necessary, could be handled by the traceset (trace merging)
273 level.
274 An uncertainty value should accompany the timestamp.
275 Timestamps in cycles should be available if they are provided by the tracer.
276\end_layout
277
278\begin_layout Subsection
279Low-level trace reading API
280\end_layout
281
282\begin_layout Standard
283The goal of this API is to provide a uniform way for the framework to access
284 the events recorded in a trace, in an encoding-independant way.
285\end_layout
286
287\begin_layout Subsubsection
288Factory methods
289\end_layout
290
291\begin_layout Itemize
292get_supported_formats()
293\end_layout
294
295\begin_deeper
296\begin_layout Standard
297Arguments: none
298\end_layout
299
300\begin_layout Standard
301Return:
302\end_layout
303
304\begin_layout Itemize
305a list of supported formats
306\end_layout
307
308\end_deeper
309\begin_layout Itemize
310open_trace()
311\end_layout
312
313\begin_deeper
314\begin_layout Standard
315Arguments:
316\end_layout
317
318\begin_layout Itemize
319trace URL
320\end_layout
321
322\begin_deeper
323\begin_layout Itemize
324local file name
325\end_layout
326
327\begin_layout Itemize
328other special url to establish a network connection
329\end_layout
330
331\begin_layout Itemize
332etc...
333\end_layout
334
335\end_deeper
336\begin_layout Itemize
337trace format (optional, for cases where auto detection would not work or
338 be ambiguous)
339\end_layout
340
341\begin_layout Standard
342Return:
343\end_layout
344
345\begin_layout Itemize
346a trace handle
347\end_layout
348
349\end_deeper
350\begin_layout Subsubsection
351Trace methods
352\end_layout
353
354\begin_layout Itemize
355close()
356\end_layout
357
358\begin_layout Itemize
359current_event()
360\end_layout
361
362\begin_deeper
363\begin_layout Standard
364Arguments: none
365\end_layout
366
367\begin_layout Standard
368Return:
369\end_layout
370
371\begin_layout Itemize
372the event currently pointed by the position pointer
373\end_layout
374
375\end_deeper
376\begin_layout Itemize
377advance()
378\end_layout
379
380\begin_deeper
381\begin_layout Standard
382Advance the position pointer to the next event in the trace.
383\end_layout
384
385\begin_layout Standard
386Arguments: none
387\end_layout
388
389\begin_layout Standard
390Return values:
391\end_layout
392
393\begin_layout Itemize
394The result:
395\end_layout
396
397\begin_deeper
398\begin_layout Itemize
399Success
400\end_layout
401
402\begin_layout Itemize
403Final end of trace (end of a non-live trace or of a completed live trace)
404\end_layout
405
406\begin_layout Itemize
407No more events for now (end of a still running live trace)
408\end_layout
409
410\end_deeper
411\end_deeper
412\begin_layout Itemize
413seek_time()
414\end_layout
415
416\begin_deeper
417\begin_layout Standard
418Arguments:
419\end_layout
420
421\begin_layout Itemize
422The time to seek to
423\end_layout
424
425\begin_layout Standard
426Return: none
427\end_layout
428
429\end_deeper
430\begin_layout Itemize
431get_position_handle()
432\end_layout
433
434\begin_layout Itemize
435seek_to_position_handle()
436\end_layout
437
438\begin_layout Itemize
439destroy_position_handle()
440\end_layout
441
442\begin_layout Itemize
443get_time_start()
444\end_layout
445
446\begin_deeper
447\begin_layout Standard
448Arguments: none
449\end_layout
450
451\begin_layout Standard
452Return:
453\end_layout
454
455\begin_layout Itemize
456the timestamp of the first event in the trace
457\end_layout
458
459\end_deeper
460\begin_layout Itemize
461get_time_end()
462\end_layout
463
464\begin_deeper
465\begin_layout Standard
466Arguments: none
467\end_layout
468
469\begin_layout Standard
470Return:
471\end_layout
472
473\begin_layout Itemize
474the timestamp of the last event in the trace
475\end_layout
476
477\end_deeper
478\begin_layout Itemize
479register_callback_new_event()
480\end_layout
481
482\begin_deeper
483\begin_layout Standard
484Register a callback that is called when a new event becomes available in
485 a live trace.
486 It is also called when the live trace ends.
487\end_layout
488
489\begin_layout Standard
490Arguments:
491\end_layout
492
493\begin_layout Itemize
494after (timestamp) : call only if the event occurent later than
495\emph on
496after
497\end_layout
498
499\begin_layout Itemize
500the callback function
501\begin_inset Note Note
502status open
503
504\begin_layout Standard
505specify its args and return val
506\end_layout
507
508\end_inset
509
510
511\end_layout
512
513\begin_layout Standard
514Return:
515\end_layout
516
517\begin_layout Itemize
518Result (success or failure)
519\end_layout
520
521\end_deeper
522\begin_layout Subsection
523High-level trace reading API
524\end_layout
525
526\begin_layout Standard
527The goal of this API is to provide a uniform way for analyses and views
528 to obtain trace events from a traceset (merge of many traces or a single
529 trace), regardless of the system they were recorded on and of the tracer
530 used.
531\end_layout
532
533\begin_layout Itemize
534Request a range of events
535\end_layout
536
537\begin_deeper
538\begin_layout Standard
539Arguments:
540\end_layout
541
542\begin_layout Itemize
543(implicitly) the traceset
544\end_layout
545
546\begin_layout Itemize
547start timestamp
548\end_layout
549
550\begin_layout Itemize
551stop timestamp (special value for infinity, for live traces)
552\end_layout
553
554\begin_layout Itemize
555list of event types and callbacks
556\end_layout
557
558\begin_layout Itemize
559filter with complex expressions
560\end_layout
561
562\begin_layout Itemize
563private pointer to be passed to the callbacks
564\end_layout
565
566\begin_layout Standard
567Return:
568\end_layout
569
570\begin_layout Itemize
571handle to the request for cancelling it
572\end_layout
573
574\end_deeper
575\begin_layout Itemize
576Cancel a request
577\end_layout
578
579\begin_deeper
580\begin_layout Standard
581Arguments:
582\end_layout
583
584\begin_layout Itemize
585the handle to the request
586\end_layout
587
588\end_deeper
589\begin_layout Subsection
590State management
591\end_layout
592
593\begin_layout Subsubsection
594State accessing API
595\end_layout
596
597\begin_layout Itemize
598Request the values of a given set of state variables at a point in time
599\end_layout
600
601\begin_deeper
602\begin_layout Standard
603Arguments:
604\end_layout
605
606\begin_layout Itemize
607the list of state variables
608\end_layout
609
610\begin_layout Itemize
611the timestamp
612\end_layout
613
614\end_deeper
615\begin_layout Itemize
616Request all the states changes of a given set of state variables between
617 two time indexes
618\end_layout
619
620\begin_deeper
621\begin_layout Standard
622Arguments:
623\end_layout
624
625\begin_layout Itemize
626the list of state variables
627\end_layout
628
629\begin_layout Itemize
630timestamp 1
631\end_layout
632
633\begin_layout Itemize
634timestamp 2
635\end_layout
636
637\end_deeper
638\begin_layout Subsubsection
639State setting API
640\end_layout
641
642\begin_layout Section
643Describing event types
644\end_layout
645
646\begin_layout Subsection
647Overview
648\end_layout
649
650\begin_layout Standard
651Because tracepoints may be created dynamically, information about the descriptio
652n of events is just as dynamic.
653 In this context, one simple way to communicate the event description informatio
654n to upper layers would be to send them as events, as it is done in recent
655 versions of LTTV.
656 The core events used to describe other events are the only ones whose descripti
657on is hardcoded in the framework.
658\end_layout
659
660\begin_layout Standard
661These event-type-describing events could then be received and interpreted
662 by a module, the Event Description Service, which would be a client to
663 the high-level tracing API at the same level as normal views and analyses.
664 It would store the information and allow the other views and analyses to
665 access it via this API.
666\end_layout
667
668\begin_layout Subsection
669Events-describing events
670\end_layout
671
672\begin_layout Itemize
673Event type declaration event
674\end_layout
675
676\begin_deeper
677\begin_layout Standard
678Announce the existence of an event type
679\end_layout
680
681\begin_layout Itemize
682event type name
683\end_layout
684
685\end_deeper
686\begin_layout Itemize
687Argument declaration event
688\end_layout
689
690\begin_deeper
691\begin_layout Standard
692Announce the existence of an event argument
693\end_layout
694
695\begin_layout Itemize
696event type name
697\end_layout
698
699\begin_layout Itemize
700name
701\end_layout
702
703\begin_layout Itemize
704type
705\end_layout
706
707\end_deeper
708\begin_layout Itemize
709Event destruction
710\end_layout
711
712\begin_deeper
713\begin_layout Standard
714Announce that an event type ceased to exist
715\end_layout
716
717\begin_layout Itemize
718event type name
719\end_layout
720
721\end_deeper
722\begin_layout Subsection
723Event type description API
724\end_layout
725
726\begin_layout Itemize
727Get the list of all the event types
728\end_layout
729
730\begin_layout Itemize
731Find an event type by name
732\end_layout
733
734\begin_layout Itemize
735Get the number of arguments of an event
736\end_layout
737
738\begin_layout Itemize
739Get the list of arguments of an event
740\end_layout
741
742\begin_layout Itemize
743Find an argument by name
744\end_layout
745
746\begin_layout Itemize
747Get the type of an argument of an event type
748\end_layout
749
750\begin_layout Itemize
751Get a string representation of an argument of any type, given an event that
752 contains it an instance of it
753\end_layout
754
755\begin_layout Itemize
756Get an integer representation of an integer argument, a floating-point represent
757ation of a floating-point argument
758\end_layout
759
760\begin_layout Itemize
761Functions for accessing other types
762\end_layout
763
764\begin_layout Section
765Inspecting events
766\end_layout
767
768\begin_layout Subsection
769Overview
770\end_layout
771
772\begin_layout Standard
773Events contain the following information.
774\end_layout
775
776\begin_layout Itemize
777Timestamp
778\end_layout
779
780\begin_layout Itemize
781Event type identifier
782\end_layout
783
784\begin_deeper
785\begin_layout Standard
786Two possibilities:
787\end_layout
788
789\begin_layout Itemize
790an event id (integer)
791\end_layout
792
793\begin_layout Itemize
794an event name (string)
795\end_layout
796
797\end_deeper
798\begin_layout Itemize
799The name of the machine it occured on
800\end_layout
801
802\begin_layout Subsection
803Event inspecting API
804\end_layout
805
806\begin_layout Itemize
807get the event type identifier
808\end_layout
809
810\begin_layout Itemize
811get timestamp
812\end_layout
813
814\begin_layout Itemize
815get the name of the machine on which the event occured
816\end_layout
817
818\begin_layout Itemize
819get information on the type of tracing technology that was used
820\end_layout
821
822\begin_layout Itemize
823get the corresponding tracepoint (machine/tracing technology/name/location
824 in code(if available))
825\end_layout
826
827\end_body
828\end_document
This page took 0.059126 seconds and 4 git commands to generate.