blob: 824d35c341968a4cace7cbe3c72b267feb59d5c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/** @mainpage SystemTap Runtime Library
*
* @section intro_sec Introduction
*
* The SystemTap Runtime Library consists of all functions
* and code fragments needed by the compiler/translator to
* include in building a kernel module using kprobes.
*
* @section design_sec Design
* @subsection map_sec Maps (Associative Arrays)
* Maps are implemented as hash lists. It is not expected that users will
* attempt to collect so much data in kernel space that performance problems will require
* more complex solutions such as AVL trees.
*
* Maps are created with _stp_map_new(). Each map can hold only one type of
* data; int64, string, or statistics. Each element belonging to a map can have up to 2 keys
* and a value. Implemented key types are strings and longs.
*
* To simplify the implementation, the functions to set the key and the functions to set the data are separated.
* That means we need only 4 functions to set the key and 3 functions to set the value.
*
* For example:
* @include map.c
* All elements have a default value of 0 (or NULL). Elements are only saved to the map when their value is set
* to something nonzero. This means that querying for the existance of a key is inexpensive because
* no element is created, just a hash table lookup.
*
* A list is a special map which has internally ascending long integer keys. Adding a value to
* a list does not require setting a key first. See _stp_list_add_str() and _stp_list_add_int64().
*
* @section status_sec Status
* Maps are implemented and tested. Histograms are not yet finished.
*
* Copy_From_User functions are done.
*
* If maps overflow or memory runs out for some reason, globals are set but nothing is done yet.
* I expect to implement a function to tell the system to either ignore it or unload the module and quit.
*
* @section probe_sec Example Probes
*
* Working sample probe code using the runtime is in runtime/probes.
*
*
* @section todo_sec ToDo
* \link todo Click Here for Complete List \endlink
* The Runtime Library is not actually a library yet. It is just a collection of functions
* included in the probe boilerplate. Maybe it should stay that way to allow the translator
* more flexibility in what is included.
*
*/
|