diff options
author | hunt <hunt> | 2005-04-07 21:48:47 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-04-07 21:48:47 +0000 |
commit | 655ee2825121e149a9976e562946892efb20aea1 (patch) | |
tree | 91b9b4cc46aeee50e9d789689bea0b96e11ceba1 /runtime/docs | |
parent | 3d4bc8bea6b45893bd4b49f44df26bd602b4cba5 (diff) | |
download | systemtap-steved-655ee2825121e149a9976e562946892efb20aea1.tar.gz systemtap-steved-655ee2825121e149a9976e562946892efb20aea1.tar.xz systemtap-steved-655ee2825121e149a9976e562946892efb20aea1.zip |
*** empty log message ***
Diffstat (limited to 'runtime/docs')
102 files changed, 4406 insertions, 3621 deletions
diff --git a/runtime/docs/html/MAP-example.html b/runtime/docs/html/MAP-example.html deleted file mode 100644 index 45e6a3c3..00000000 --- a/runtime/docs/html/MAP-example.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>MAP</h1>arglist ;<p> -int inst_do_execve (char * filename, char __user *__user *argv, char __user *__user *envp, struct pt_regs * regs) { struct <a class="el" href="structmap__node__str.html">map_node_str</a> *ptr;<p> -_stp_copy_argv_from_user (arglist, argv);<p> -foreach (arglist, ptr) printk ("%s ", ptr->str); printk ("\n");<p> -<div class="fragment"><pre class="fragment"></pre></div> <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 03:32:10 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/README-source.html b/runtime/docs/html/README-source.html index 1b03993d..1421d7e2 100644 --- a/runtime/docs/html/README-source.html +++ b/runtime/docs/html/README-source.html @@ -4,61 +4,116 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @mainpage SystemTap Runtime Library</span> -00002 <span class="comment"> *</span> -00003 <span class="comment"> * @section intro_sec Introduction</span> -00004 <span class="comment"> *</span> -00005 <span class="comment"> * The SystemTap Runtime Library consists of all functions</span> -00006 <span class="comment"> * and code fragments needed by the compiler/translator to</span> -00007 <span class="comment"> * include in building a kernel module using kprobes.</span> -00008 <span class="comment"> *</span> -00009 <span class="comment"> * @section design_sec Design</span> -00010 <span class="comment"> * @subsection impl_sec Implementation</span> -00011 <span class="comment"> * The library is written in \c C and is really not a library but a collection of code</span> -00012 <span class="comment"> * That can be conditionally included in a modules. It will probably become a library later.</span> -00013 <span class="comment"> *</span> -00014 <span class="comment"> * @subsection map_sec Maps (Associative Arrays)</span> -00015 <span class="comment"> * Maps are implemented as hash lists. It is not expected that users will</span> -00016 <span class="comment"> * attempt to collect so much data in kernel space that performance problems will require</span> -00017 <span class="comment"> * more complex solutions such as AVL trees.</span> -00018 <span class="comment"> *</span> -00019 <span class="comment"> * Maps are created with _stp_map_new(). Each map can hold only one type of </span> -00020 <span class="comment"> * data; int64, string, or statistics. Each element belonging to a map can have up to 2 keys</span> -00021 <span class="comment"> * and a value. Implemented key types are strings and longs.</span> -00022 <span class="comment"> * </span> -00023 <span class="comment"> * To simplify the implementation, the functions to set the key and the functions to set the data are separated.</span> -00024 <span class="comment"> * That means we need only 4 functions to set the key and 3 functions to set the value. </span> -00025 <span class="comment"> *</span> -00026 <span class="comment"> * For example:</span> -00027 <span class="comment"> * @include map.c</span> -00028 <span class="comment"></span> -00029 <span class="comment"> * All elements have a default value of 0 (or NULL). Elements are only saved to the map when their value is set</span> -00030 <span class="comment"> * to something nonzero. This means that querying for the existance of a key is inexpensive because</span> -00031 <span class="comment"> * no element is created, just a hash table lookup.</span> -00032 <span class="comment"> *</span> -00033 <span class="comment"> * @subsection list_sec Lists</span> -00034 <span class="comment"> * A list is a special map which has internally ascending long integer keys. Adding a value to</span> -00035 <span class="comment"> * a list does not require setting a key first. Create a list with _stp_list_new(). Add to it</span> -00036 <span class="comment"> * with _stp_list_add_str() and _stp_list_add_int64(). Clear it with _stp_list_clear().</span> -00037 <span class="comment"> *</span> -00038 <span class="comment"> * @section status_sec Status</span> -00039 <span class="comment"> * @li Maps are implemented and tested. Histograms are not yet finished.</span> -00040 <span class="comment"> * @li Copy_From_User functions are done.</span> -00041 <span class="comment"> * @li If maps overflow or memory runs out for some reason, globals are set but nothing is done yet.</span> -00042 <span class="comment"> * I expect to implement a function to tell the system to either ignore it or unload the module and quit.</span> -00043 <span class="comment"> * @li Locking and per-cpu data are not yet implemented to be SMP-safe. This is not yet necessary because the</span> -00044 <span class="comment"> * current kprobes implementation single-threads probes for us. </span> -00045 <span class="comment"> *</span> -00046 <span class="comment"> * @section probe_sec Example Probes</span> -00047 <span class="comment"> * </span> -00048 <span class="comment"> * Working sample probe code using the runtime is in runtime/probes.</span> -00049 <span class="comment"> * <a href="dir_000000.html"> Browse probes.</a></span> -00050 <span class="comment"> * </span> -00051 <span class="comment"> * @section todo_sec ToDo </span> -00052 <span class="comment"> * \link todo Click Here for Complete List \endlink</span> -00053 <span class="comment"> *</span> -00054 <span class="comment"> * @section links Links</span> -00055 <span class="comment"> * <a href="http://sources.redhat.com/systemtap/">SystemTap Project Page</a></span> -00056 <span class="comment"> */</span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @mainpage SystemTap Runtime</span> +00002 <span class="comment"></span> +00003 <span class="comment">@section intro_sec Introduction</span> +00004 <span class="comment"></span> +00005 <span class="comment">This document describes the implementation of the SystemTap Runtime. It is intended for developers</span> +00006 <span class="comment">of the SystemTap Language translator or, possibly TapSet authors. These functions are not directly</span> +00007 <span class="comment">available from the SystemTap Language.</span> +00008 <span class="comment"></span> +00009 <span class="comment">The SystemTap Runtime Library consists of all functions</span> +00010 <span class="comment">and code fragments needed by the compiler/translator to</span> +00011 <span class="comment">include in building a kernel module using kprobes. It</span> +00012 <span class="comment">also include I/O code to transmit its output from the kernel to userspace.</span> +00013 <span class="comment"> </span> +00014 <span class="comment">In addition to the library, the runtime includes a SystemTap user-space daemon</span> +00015 <span class="comment">(stpd). Stpd grabs data sent from the I/O code in the runtime and displays it</span> +00016 <span class="comment">and/or saves it to files. Stpd (or a script invoking it) will handle other issues like</span> +00017 <span class="comment">inserting and removing modules.</span> +00018 <span class="comment"></span> +00019 <span class="comment">Stpd and the I/O code make use of both relayfs and netlink for communication. For</span> +00020 <span class="comment">kernels without relayfs builtin, it is provided as a standalone module under the runtime directory.</span> +00021 <span class="comment"></span> +00022 <span class="comment">@section design_sec Design</span> +00023 <span class="comment">@subsection impl_sec Implementation</span> +00024 <span class="comment">The library is written in C and is really not a library but a collection of code</span> +00025 <span class="comment">That can be conditionally included in a modules. It may become a library later, but for now</span> +00026 <span class="comment">there are some advantages to being able to change the sizes of static items with simple #defines.</span> +00027 <span class="comment"></span> +00028 <span class="comment">@subsection map_sec Maps (Associative Arrays)</span> +00029 <span class="comment">Maps are implemented as hash lists. It is not expected that users will</span> +00030 <span class="comment">attempt to collect so much data in kernel space that performance problems will require</span> +00031 <span class="comment">more complex solutions such as AVL trees.</span> +00032 <span class="comment"></span> +00033 <span class="comment">Maps are created with _stp_map_new(). Each map can hold only one type of </span> +00034 <span class="comment">data; int64, string, or statistics. Each element belonging to a map can have up to 2 keys</span> +00035 <span class="comment">and a value. Implemented key types are strings and longs.</span> +00036 <span class="comment"> </span> +00037 <span class="comment">To simplify the implementation, the functions to set the key and the functions to set the data are separated.</span> +00038 <span class="comment">That means we need only 4 functions to set the key and 3 functions to set the value. </span> +00039 <span class="comment"></span> +00040 <span class="comment">For example:</span> +00041 <span class="comment">\code</span> +00042 <span class="comment">/* create a map with a max of 100 elements */</span> +00043 <a class="code" href="group__maps.html#ga1">MAP</a> mymap = map_new(100, INT64); +00044 +00045 <span class="comment">/* mymap[birth year] = 2000 */</span> +00046 map_key_str (mymap, <span class="stringliteral">"birth year"</span>); +00047 map_set_int64 (mymap, 2000); +00048 \endcode +00049 +00050 All elements have a <span class="keywordflow">default</span> value of 0 (or NULL). Elements are only saved to the map when their value is set +00051 to something nonzero. This means that querying <span class="keywordflow">for</span> the existance of a key is inexpensive because +00052 no element is created, just a hash table lookup. +00053 +00054 @subsection list_sec Lists +00055 A list is a special map which has internally ascending <span class="keywordtype">long</span> integer keys. Adding a value to +00056 a list does not require setting a key first. Create a list with <a class="code" href="group__lists.html#ga0">_stp_list_new</a>(). Add to it +00057 with <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a>() and _stp_list_add_int64(). Clear it with _stp_list_clear(). +00058 +00059 @subsection string_sec Strings +00060 One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack. +00061 It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with +00062 statically allocated space for strings. This is what is implemented in the String module. Strings use +00063 preallocated per-cpu buffers and are safe to use (unlike C strings). +00064 +00065 @subsection io_sec I/O +00066 Generally things are written to a "print buffer" using the internal +00067 functions _stp_print_xxx(). +00068 \code +00069 _stp_print ("Output is: "); +00070 _stp_printf ("pid is %d ", current->pid); +00071 _stp_printf ("name is %s", current->comm); +00072 \endcode +00073 before the probe returns it must call _stp_print_flush(). This +00074 timestamps the accumulated print buffer and sends it to relayfs. +00075 When relayfs fills an internal buffer, the user-space daemon is notified +00076 data is ready and reads a bug per-cpu chunk, which contains a line like: +00077 \verbatim +00078 [123456.000002] Output is: pid is 1234 name is bash +00079 \endverbatim +00080 +00081 The user-daemon (stpd) saves this data to a file named something like +00082 "stpd_cpu2". When the user hits ^c, a timer expires, or the probe +00083 module notifies stpd (through a netlink command channel) that it wants +00084 to terminate, stpd does "system(rmmod)" then collects the last output +00085 before exiting. +00086 As an option, if we don't need bulk per-cpu data, we can put +00087 \code +00088 #define STP_NETLINK_ONLY +00089 \endcode +00090 at the top of the module and all output will go over a netlink channel. +00091 In the SystemTap language, we will provide some simple functions to control the buffering policy, which +00092 will control the use of netlink and parameters to relayfs and stpd. +00093 +00094 @section status_sec Status +00095 @li Maps are implemented and tested. Histograms are not yet finished. +00096 @li Copy_From_User functions are done. +00097 @li If maps overflow or memory runs out for some reason, globals are set but nothing is done yet. +00098 I expect to implement a function to tell the system to either ignore it or unload the module and quit. +00099 @li Stack functions need much improvement. +00100 +00101 @section probe_sec Example Probes +00102 +00103 Working sample probe code using the runtime is in runtime/probes. +00104 <a href="dir_000000.html"> Browse probes.</a> +00105 +00106 @section todo_sec ToDo +00107 \link todo Click Here for Complete List \endlink +00108 +00109 @section links Links +00110 <a href="http:<span class="comment">//sources.redhat.com/systemtap/">SystemTap Project Page</a></span> +00111 */ </pre></div></body></html> diff --git a/runtime/docs/html/README.html b/runtime/docs/html/README.html deleted file mode 100644 index d4ddc434..00000000 --- a/runtime/docs/html/README.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.4.1 --> -<h1>README File Reference</h1> -<p> -<a href="README-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -</table> -<hr size="1"><address style="align: right;"><small>Generated on Mon Mar 21 13:29:45 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/TODO-source.html b/runtime/docs/html/TODO-source.html new file mode 100644 index 00000000..ff8d219b --- /dev/null +++ b/runtime/docs/html/TODO-source.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: TODO Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>TODO</h1><a href="TODO.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/**</span> +00002 <span class="comment">@file TODO</span> +00003 <span class="comment">@brief To-Do List</span> +00004 <span class="comment"></span> +00005 <span class="comment">***** STPD *****</span> +00006 <span class="comment"></span> +00007 <span class="comment">@todo stpd needs an option to disable ANSI colors.</span> +00008 <span class="comment"></span> +00009 <span class="comment">@todo stpd needs to be able to write netlink REALTIME_DATA to a file.</span> +00010 <span class="comment"></span> +00011 <span class="comment">@todo stpd/stp/io.c stpd needs better startup/shutdown integration with io.c in runtime. </span> +00012 <span class="comment">Shutdown works, but isn't very clean. Currently the stp script loads the module, then</span> +00013 <span class="comment">starts stpd. Data is lost until stpd is active. Maybe stpd needs to load the module. </span> +00014 <span class="comment">Maybe it needs to signal the module that stpd is ready and the module can proceed to load the probes.</span> +00015 <span class="comment"></span> +00016 <span class="comment">@todo stpd/stp - What if there are multiple probes running? </span> +00017 <span class="comment"></span> +00018 <span class="comment">@todo stpd/stp - Need something to post-process relayfs files and integrate into a single file.</span> +00019 <span class="comment"></span> +00020 <span class="comment">@todo stpd - Implement command that runtime can send to stpd to tell it to fork a specified program and pass</span> +00021 <span class="comment">the output from the probe module to it. Create example probe to use it.</span> +00022 <span class="comment"></span> +00023 <span class="comment">***** relayfs *****</span> +00024 <span class="comment">@todo relayfs/build - figure out how to get rid of the linker warnings when building probes. </span> +00025 <span class="comment"></span> +00026 <span class="comment">***** runtime *****</span> +00027 <span class="comment">@todo runtime - Clean up #defines. Need to have a clearer way to have the probe writer (translator) </span> +00028 <span class="comment">see which defines affect what and all defines should have reasonable defaults.</span> +00029 <span class="comment"></span> +00030 <span class="comment">@todo runtime - current.c - implement a memory dump function. Does a hex dump into String or print buffer.</span> +00031 <span class="comment">@todo runtime - put wrappers around current task struct entries, like pid, ppid, comm, etc.</span> +00032 <span class="comment">@todo runtime - Implement stack functions for kprobes (not just jprobes)</span> +00033 <span class="comment"></span> +00034 <span class="comment">*/</span> +</pre></div></body></html> diff --git a/runtime/docs/html/TODO.html b/runtime/docs/html/TODO.html new file mode 100644 index 00000000..e5771873 --- /dev/null +++ b/runtime/docs/html/TODO.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: TODO File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>TODO File Reference</h1>To-Do List. <a href="#_details">More...</a> +<p> + +<p> +<a href="TODO-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +To-Do List. +<p> +STPD *****<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd needs an option to disable ANSI colors. </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd needs to be able to write netlink REALTIME_DATA to a file. </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd/stp/io.c stpd needs better startup/shutdown integration with <a class="el" href="io_8c.html">io.c</a> in runtime. Shutdown works, but isn't very clean. Currently the stp script loads the module, then starts stpd. Data is lost until stpd is active. Maybe stpd needs to load the module. Maybe it needs to signal the module that stpd is ready and the module can proceed to load the probes. </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd/stp - What if there are multiple probes running? </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd/stp - Need something to post-process relayfs files and integrate into a single file. </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>stpd - Implement command that runtime can send to stpd to tell it to fork a specified program and pass the output from the probe module to it. Create example probe to use it. </dd></dl> +relayfs ***** <p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>relayfs/build - figure out how to get rid of the linker warnings when building probes. </dd></dl> +runtime ***** <p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>runtime - Clean up #defines. Need to have a clearer way to have the probe writer (translator) see which defines affect what and all defines should have reasonable defaults. </dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>runtime - <a class="el" href="current_8c.html">current.c</a> - implement a memory dump function. Does a hex dump into String or print buffer.</dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>runtime - put wrappers around current task struct entries, like pid, ppid, comm, etc.</dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000010">Todo:</a></b></dt><dd>runtime - Implement stack functions for kprobes (not just jprobes) </dd></dl> + +<p> +Definition in file <a class="el" href="TODO-source.html">TODO</a>.</body></html> diff --git a/runtime/docs/html/alloc_8c-source.html b/runtime/docs/html/alloc_8c-source.html index 34641788..4e76adbb 100644 --- a/runtime/docs/html/alloc_8c-source.html +++ b/runtime/docs/html/alloc_8c-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>alloc.c</h1><a href="alloc_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _ALLOC_C_</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define _ALLOC_C_</span> 00003 <span class="preprocessor"></span> diff --git a/runtime/docs/html/alloc_8c.html b/runtime/docs/html/alloc_8c.html index 358cb6a8..8e9f7d80 100644 --- a/runtime/docs/html/alloc_8c.html +++ b/runtime/docs/html/alloc_8c.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>alloc.c File Reference</h1>Memory functions. <a href="#_details">More...</a> <p> diff --git a/runtime/docs/html/alloc_8h-source.html b/runtime/docs/html/alloc_8h-source.html deleted file mode 100644 index 551deccd..00000000 --- a/runtime/docs/html/alloc_8h-source.html +++ /dev/null @@ -1,85 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: alloc.h Source File</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>alloc.h</h1><a href="alloc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file alloc.h</span> -00003 <span class="comment"> * @brief Memory allocation functions.</span> -00004 <span class="comment"> * @todo Should really be alloc.c for consistency.</span> -00005 <span class="comment"> */</span> -00006 -00007 <span class="keyword">enum</span> errorcode { ERR_NONE=0, ERR_NO_MEM }; -00008 <span class="keyword">enum</span> errorcode _stp_error = ERR_NONE; -00009 <span class="comment"></span> -00010 <span class="comment">/** Allocates memory within a probe.</span> -00011 <span class="comment"> * This is used for small allocations from within a running</span> -00012 <span class="comment"> * probe where the process cannot sleep. </span> -00013 <span class="comment"> * @param len Number of bytes to allocate.</span> -00014 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> -00015 <span class="comment"> * @bug Currently uses kmalloc (GFP_ATOMIC).</span> -00016 <span class="comment"> */</span> -00017 -<a name="l00018"></a><a class="code" href="alloc_8h.html#a3">00018</a> <span class="keywordtype">void</span> *<a class="code" href="alloc_8h.html#a3">_stp_alloc</a>(size_t len) -00019 { -00020 <span class="keywordtype">void</span> *ptr = kmalloc(len, GFP_ATOMIC); -00021 <span class="keywordflow">if</span> (unlikely(ptr == NULL)) -00022 _stp_error = ERR_NO_MEM; -00023 <span class="keywordflow">return</span> ptr; -00024 } -00025 <span class="comment"></span> -00026 <span class="comment">/** Allocates and clears memory within a probe.</span> -00027 <span class="comment"> * This is used for small allocations from within a running</span> -00028 <span class="comment"> * probe where the process cannot sleep. </span> -00029 <span class="comment"> * @param len Number of bytes to allocate.</span> -00030 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> -00031 <span class="comment"> * @bug Currently uses kmalloc (GFP_ATOMIC).</span> -00032 <span class="comment"> */</span> -00033 -<a name="l00034"></a><a class="code" href="alloc_8h.html#a4">00034</a> <span class="keywordtype">void</span> *<a class="code" href="alloc_8h.html#a4">_stp_calloc</a>(size_t len) -00035 { -00036 <span class="keywordtype">void</span> *ptr = <a class="code" href="alloc_8h.html#a3">_stp_alloc</a>(len); -00037 <span class="keywordflow">if</span> (likely(ptr)) -00038 memset(ptr, 0, len); -00039 <span class="keywordflow">return</span> ptr; -00040 } -00041 <span class="comment"></span> -00042 <span class="comment">/** Allocates and clears memory outside a probe.</span> -00043 <span class="comment"> * This is typically used in the module initialization to</span> -00044 <span class="comment"> * allocate new maps, lists, etc.</span> -00045 <span class="comment"> * @param len Number of bytes to allocate.</span> -00046 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> -00047 <span class="comment"> */</span> -00048 -<a name="l00049"></a><a class="code" href="alloc_8h.html#a5">00049</a> <span class="keywordtype">void</span> *<a class="code" href="alloc_8h.html#a5">_stp_valloc</a>(size_t len) -00050 { -00051 <span class="keywordtype">void</span> *ptr = vmalloc(len); -00052 <span class="keywordflow">if</span> (likely(ptr)) -00053 memset(ptr, 0, len); -00054 <span class="keywordflow">else</span> -00055 _stp_error = ERR_NO_MEM; -00056 <span class="keywordflow">return</span> ptr; -00057 } -00058 <span class="comment"></span> -00059 <span class="comment">/** Frees memory allocated by _stp_alloc or _stp_calloc.</span> -00060 <span class="comment"> * @param ptr pointer to memory to free</span> -00061 <span class="comment"> */</span> -00062 -<a name="l00063"></a><a class="code" href="alloc_8h.html#a6">00063</a> <span class="keywordtype">void</span> <a class="code" href="alloc_8h.html#a6">_stp_free</a>(<span class="keywordtype">void</span> *ptr) -00064 { -00065 <span class="keywordflow">if</span> (likely(ptr)) -00066 kfree(ptr); -00067 } -00068 <span class="comment"></span> -00069 <span class="comment">/** Frees memory allocated by _stp_valloc.</span> -00070 <span class="comment"> * @param ptr pointer to memory to free</span> -00071 <span class="comment"> */</span> -00072 -<a name="l00073"></a><a class="code" href="alloc_8h.html#a7">00073</a> <span class="keywordtype">void</span> <a class="code" href="alloc_8h.html#a7">_stp_vfree</a>(<span class="keywordtype">void</span> *ptr) -00074 { -00075 <span class="keywordflow">if</span> (likely(ptr)) -00076 vfree(ptr); -00077 } -</pre></div></body></html> diff --git a/runtime/docs/html/alloc_8h.html b/runtime/docs/html/alloc_8h.html deleted file mode 100644 index c8735838..00000000 --- a/runtime/docs/html/alloc_8h.html +++ /dev/null @@ -1,249 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: alloc.h File Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>alloc.h File Reference</h1>Memory allocation functions. <a href="#_details">More...</a> -<p> - -<p> -<a href="alloc_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b>errorcode</b> { <b>ERR_NONE</b> = 0, -<b>ERR_NO_MEM</b> - }</td></tr> - -<tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a3">_stp_alloc</a> (size_t len)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates memory within a probe. <a href="#a3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a4">_stp_calloc</a> (size_t len)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates and clears memory within a probe. <a href="#a4"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a5">_stp_valloc</a> (size_t len)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates and clears memory outside a probe. <a href="#a5"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a6">_stp_free</a> (void *ptr)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees memory allocated by _stp_alloc or _stp_calloc. <a href="#a6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a7">_stp_vfree</a> (void *ptr)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees memory allocated by _stp_valloc. <a href="#a7"></a><br></td></tr> -<tr><td colspan="2"><br><h2>Variables</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0" doxytag="alloc.h::_stp_error"></a> -enum errorcode </td><td class="memItemRight" valign="bottom"><b>_stp_error</b> = ERR_NONE</td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -Memory allocation functions. -<p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>Should really be alloc.c for consistency. </dd></dl> - -<p> -Definition in file <a class="el" href="alloc_8h-source.html">alloc.h</a>.<hr><h2>Function Documentation</h2> -<a class="anchor" name="a3" doxytag="alloc.h::_stp_alloc"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void* _stp_alloc </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">size_t </td> - <td class="mdname1" valign="top" nowrap> <em>len</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Allocates memory within a probe. -<p> -This is used for small allocations from within a running probe where the process cannot sleep. <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Number of bytes to allocate. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl> -<dl compact><dt><b><a class="el" href="bug.html#_bug000001">Bug:</a></b></dt><dd>Currently uses kmalloc (GFP_ATOMIC). </dd></dl> - -<p> -Definition at line <a class="el" href="alloc_8h-source.html#l00018">18</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>. -<p> -Referenced by <a class="el" href="alloc_8h-source.html#l00034">_stp_calloc()</a>, and <a class="el" href="map_8c-source.html#l00582">_stp_map_set_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a4" doxytag="alloc.h::_stp_calloc"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void* _stp_calloc </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">size_t </td> - <td class="mdname1" valign="top" nowrap> <em>len</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Allocates and clears memory within a probe. -<p> -This is used for small allocations from within a running probe where the process cannot sleep. <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Number of bytes to allocate. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl> -<dl compact><dt><b><a class="el" href="bug.html#_bug000002">Bug:</a></b></dt><dd>Currently uses kmalloc (GFP_ATOMIC). </dd></dl> - -<p> -Definition at line <a class="el" href="alloc_8h-source.html#l00034">34</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00018">_stp_alloc()</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00667">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00582">_stp_map_set_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a6" doxytag="alloc.h::_stp_free"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void _stp_free </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">void * </td> - <td class="mdname1" valign="top" nowrap> <em>ptr</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Frees memory allocated by _stp_alloc or _stp_calloc. -<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to memory to free </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="alloc_8h-source.html#l00063">63</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00807">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00112">_stp_map_key_del()</a>, and <a class="el" href="map_8c-source.html#l00582">_stp_map_set_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a5" doxytag="alloc.h::_stp_valloc"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void* _stp_valloc </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">size_t </td> - <td class="mdname1" valign="top" nowrap> <em>len</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Allocates and clears memory outside a probe. -<p> -This is typically used in the module initialization to allocate new maps, lists, etc. <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Number of bytes to allocate. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl> - -<p> -Definition at line <a class="el" href="alloc_8h-source.html#l00049">49</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00051">_stp_map_new()</a>. </td> - </tr> -</table> -<a class="anchor" name="a7" doxytag="alloc.h::_stp_vfree"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void _stp_vfree </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">void * </td> - <td class="mdname1" valign="top" nowrap> <em>ptr</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Frees memory allocated by _stp_valloc. -<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to memory to free </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="alloc_8h-source.html#l00073">73</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00199">_stp_map_del()</a>. </td> - </tr> -</table> -</body></html> diff --git a/runtime/docs/html/annotated.html b/runtime/docs/html/annotated.html deleted file mode 100644 index 4359c217..00000000 --- a/runtime/docs/html/annotated.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: Data Structures</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindexHL" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>SystemTap Data Structures</h1>Here are the data structures with brief descriptions:<table> - <tr><td class="indexkey"><a class="el" href="unionkey__data.html">key_data</a></td><td class="indexvalue">Keys are either longs or char * </td></tr> - <tr><td class="indexkey"><a class="el" href="structmap__node.html">map_node</a></td><td class="indexvalue">Basic map element </td></tr> - <tr><td class="indexkey"><a class="el" href="structmap__node__int64.html">map_node_int64</a></td><td class="indexvalue">Map element containing int64 </td></tr> - <tr><td class="indexkey"><a class="el" href="structmap__node__stat.html">map_node_stat</a></td><td class="indexvalue">Map element containing stats </td></tr> - <tr><td class="indexkey"><a class="el" href="structmap__node__str.html">map_node_str</a></td><td class="indexvalue">Map element containing string </td></tr> - <tr><td class="indexkey"><a class="el" href="structmap__root.html">map_root</a></td><td class="indexvalue">This structure contains all information about a map </td></tr> - <tr><td class="indexkey"><a class="el" href="structstat.html">stat</a></td><td class="indexvalue">Statistics are stored in this struct </td></tr> -</table> -</body></html> diff --git a/runtime/docs/html/argv__example_8c-example.html b/runtime/docs/html/argv__example_8c-example.html deleted file mode 100644 index 1369c4c2..00000000 --- a/runtime/docs/html/argv__example_8c-example.html +++ /dev/null @@ -1,32 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>argv_example.c</h1><dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>A list. </td></tr> - <tr><td valign="top"></td><td valign="top"><em>argv</em> </td><td>Source argv, in user space. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>number of elements in <em>list</em></dd></dl> -<div class="fragment"><pre class="fragment"><a name="_a0"></a><a class="code" href="structmap__root.html">MAP</a> arglist ; - -<span class="keywordtype">int</span> inst_do_execve (<span class="keywordtype">char</span> * filename, <span class="keywordtype">char</span> __user *__user *argv, <span class="keywordtype">char</span> __user *__user *envp, <span class="keyword">struct</span> pt_regs * regs) -{ - <span class="keyword">struct </span><a name="_a1"></a><a class="code" href="structmap__node__str.html">map_node_str</a> *ptr; - - <a name="a2"></a><a class="code" href="copy_8c.html#a2">_stp_copy_argv_from_user</a> (arglist, argv); - - <a name="a3"></a><a class="code" href="map_8h.html#a8">foreach</a> (arglist, ptr) - printk ("%s ", ptr->str); - printk ("\n"); -} -</pre></div> <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 03:40:33 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/bug.html b/runtime/docs/html/bug.html index 4ed1d36b..e19f1b2e 100644 --- a/runtime/docs/html/bug.html +++ b/runtime/docs/html/bug.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1><a class="anchor" name="bug">Bug List</a></h1><a class="anchor" name="_bug000001"></a> <dl> <dt>Global <a class="el" href="group__alloc.html#ga1">_stp_alloc</a> (size_t len) </dt> <dd>Currently uses kmalloc (GFP_ATOMIC). </dd> @@ -16,7 +16,12 @@ </dl> <p> <a class="anchor" name="_bug000003"></a> <dl> -<dt>Global <a class="el" href="group__io.html#ga0">dlog</a> (const char *fmt,...) </dt> -<dd>Lines are limited in length by printk buffer. If there is no newline in the format string, then other syslog output could get appended to the SystemTap line.</dd> +<dt>Global <a class="el" href="group__stack.html#ga6">_stp_stack_print</a> (int verbose, int levels) </dt> +<dd>levels parameter is not functional </dd> +</dl> +<p> +<a class="anchor" name="_bug000004"></a> <dl> +<dt>Global <a class="el" href="group__stack.html#ga7">_stp_stack_sprint</a> (String str, int verbose, int levels) </dt> +<dd>levels parameter is not functional </dd> </dl> </body></html> diff --git a/runtime/docs/html/copy_8c-source.html b/runtime/docs/html/copy_8c-source.html index 1d4f8652..273aa45c 100644 --- a/runtime/docs/html/copy_8c-source.html +++ b/runtime/docs/html/copy_8c-source.html @@ -4,159 +4,183 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>copy.c</h1><a href="copy_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _COPY_C_</span> -00002 <span class="preprocessor"></span><span class="preprocessor">#define _COPY_C_</span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>copy.c</h1><a href="copy_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _COPY_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _COPY_C_</span> 00003 <span class="preprocessor"></span> -00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00005 <span class="comment">/** @file copy.c</span> -00006 <span class="comment"> * @brief Functions to copy from user space.</span> -00007 <span class="comment"> */</span> -00008 <span class="comment"></span> -00009 <span class="comment">/** @addtogroup copy Functions to copy from user space.</span> -00010 <span class="comment"> * Functions to copy from user space.</span> -00011 <span class="comment"> * None of these functions will sleep (for example to allow pages</span> -00012 <span class="comment"> * to be swapped in). It is possible (although rare) that the data</span> -00013 <span class="comment"> * in user space will not present and these functions will return an error.</span> -00014 <span class="comment"> * @{</span> -00015 <span class="comment"> */</span> -00016 -00017 <span class="keywordtype">long</span> <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count); -00018 <span class="comment">//static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);</span> -00019 -00020 <span class="preprocessor">#if defined (__i386__)</span> -00021 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> -00022 <span class="preprocessor">do { \</span> -00023 <span class="preprocessor"> int __d0, __d1, __d2; \</span> -00024 <span class="preprocessor"> __asm__ __volatile__( \</span> -00025 <span class="preprocessor"> " testl %1,%1\n" \</span> -00026 <span class="preprocessor"> " jz 2f\n" \</span> -00027 <span class="preprocessor"> "0: lodsb\n" \</span> -00028 <span class="preprocessor"> " stosb\n" \</span> -00029 <span class="preprocessor"> " testb %%al,%%al\n" \</span> -00030 <span class="preprocessor"> " jz 1f\n" \</span> -00031 <span class="preprocessor"> " decl %1\n" \</span> -00032 <span class="preprocessor"> " jnz 0b\n" \</span> -00033 <span class="preprocessor"> "1: subl %1,%0\n" \</span> -00034 <span class="preprocessor"> "2:\n" \</span> -00035 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> -00036 <span class="preprocessor"> "3: movl %5,%0\n" \</span> -00037 <span class="preprocessor"> " jmp 2b\n" \</span> -00038 <span class="preprocessor"> ".previous\n" \</span> -00039 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> -00040 <span class="preprocessor"> " .align 4\n" \</span> -00041 <span class="preprocessor"> " .long 0b,3b\n" \</span> -00042 <span class="preprocessor"> ".previous" \</span> -00043 <span class="preprocessor"> : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> -00044 <span class="preprocessor"> "=&D" (__d2) \</span> -00045 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> -00046 <span class="preprocessor"> : "memory"); \</span> -00047 <span class="preprocessor">} while (0)</span> -00048 <span class="preprocessor"></span><span class="preprocessor">#elif defined (__x86_64__)</span> -00049 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> -00050 <span class="preprocessor">do { \</span> -00051 <span class="preprocessor"> long __d0, __d1, __d2; \</span> -00052 <span class="preprocessor"> __asm__ __volatile__( \</span> -00053 <span class="preprocessor"> " testq %1,%1\n" \</span> -00054 <span class="preprocessor"> " jz 2f\n" \</span> -00055 <span class="preprocessor"> "0: lodsb\n" \</span> -00056 <span class="preprocessor"> " stosb\n" \</span> -00057 <span class="preprocessor"> " testb %%al,%%al\n" \</span> -00058 <span class="preprocessor"> " jz 1f\n" \</span> -00059 <span class="preprocessor"> " decq %1\n" \</span> -00060 <span class="preprocessor"> " jnz 0b\n" \</span> -00061 <span class="preprocessor"> "1: subq %1,%0\n" \</span> -00062 <span class="preprocessor"> "2:\n" \</span> -00063 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> -00064 <span class="preprocessor"> "3: movq %5,%0\n" \</span> -00065 <span class="preprocessor"> " jmp 2b\n" \</span> -00066 <span class="preprocessor"> ".previous\n" \</span> -00067 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> -00068 <span class="preprocessor"> " .align 8\n" \</span> -00069 <span class="preprocessor"> " .quad 0b,3b\n" \</span> -00070 <span class="preprocessor"> ".previous" \</span> -00071 <span class="preprocessor"> : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> -00072 <span class="preprocessor"> "=&D" (__d2) \</span> -00073 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> -00074 <span class="preprocessor"> : "memory"); \</span> -00075 <span class="preprocessor">} while (0)</span> -00076 <span class="preprocessor"></span><span class="preprocessor">#endif</span> -00077 <span class="preprocessor"></span><span class="comment"></span> -00078 <span class="comment">/** Copy a NULL-terminated string from userspace.</span> -00079 <span class="comment"> * On success, returns the length of the string (not including the trailing</span> -00080 <span class="comment"> * NULL).</span> -00081 <span class="comment"> *</span> -00082 <span class="comment"> * If access to userspace fails, returns -EFAULT (some data may have been</span> -00083 <span class="comment"> * copied).</span> -00084 <span class="comment"> * @param dst Destination address, in kernel space. This buffer must be at</span> -00085 <span class="comment"> * least <i>count</i> bytes long.</span> -00086 <span class="comment"> * @param src Source address, in user space.</span> -00087 <span class="comment"> * @param count Maximum number of bytes to copy, including the trailing NULL.</span> -00088 <span class="comment"> * </span> -00089 <span class="comment"> * If <i>count</i> is smaller than the length of the string, copies </span> -00090 <span class="comment"> * <i>count</i> bytes and returns <i>count</i>.</span> -00091 <span class="comment"> */</span> -00092 -00093 <span class="keywordtype">long</span> -<a name="l00094"></a><a class="code" href="group__copy.html#ga0">00094</a> <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count) -00095 { -00096 <span class="keywordtype">long</span> res; -00097 __stp_strncpy_from_user(dst, src, count, res); -00098 <span class="keywordflow">return</span> res; -00099 } -00100 <span class="comment"></span> -00101 <span class="comment">/** Copy a block of data from user space.</span> -00102 <span class="comment"> *</span> -00103 <span class="comment"> * If some data could not be copied, this function will pad the copied</span> -00104 <span class="comment"> * data to the requested size using zero bytes.</span> -00105 <span class="comment"></span> -00106 <span class="comment"> * @param dst Destination address, in kernel space.</span> -00107 <span class="comment"> * @param src Source address, in user space.</span> -00108 <span class="comment"> * @param count Number of bytes to copy.</span> -00109 <span class="comment"> * @return number of bytes that could not be copied. On success, </span> -00110 <span class="comment"> * this will be zero.</span> -00111 <span class="comment"> *</span> -00112 <span class="comment"> */</span> -00113 -00114 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keyword">inline</span> -<a name="l00115"></a><a class="code" href="group__copy.html#ga1">00115</a> <a class="code" href="group__copy.html#ga1">_stp_copy_from_user</a> (<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> count) -00116 { -00117 <span class="keywordflow">return</span> __copy_from_user_inatomic(dst, src, count); -00118 } -00119 <span class="comment"></span> -00120 <span class="comment">/** Copy an argv from user space to a List.</span> -00121 <span class="comment"> *</span> -00122 <span class="comment"> * @param list A list.</span> -00123 <span class="comment"> * @param argv Source argv, in user space.</span> -00124 <span class="comment"> * @return number of elements in <i>list</i></span> -00125 <span class="comment"> *</span> -00126 <span class="comment"> * @b Example:</span> -00127 <span class="comment"> * @include argv.c</span> -00128 <span class="comment"> */</span> -00129 -<a name="l00130"></a><a class="code" href="group__copy.html#ga2">00130</a> <span class="keywordtype">int</span> <a class="code" href="group__copy.html#ga2">_stp_copy_argv_from_user</a> (<a class="code" href="structmap__root.html">MAP</a> list, <span class="keywordtype">char</span> __user *__user *argv) -00131 { -00132 <span class="keywordtype">char</span> str[128]; -00133 <span class="keywordtype">char</span> __user *vstr; -00134 <span class="keywordtype">int</span> len; -00135 -00136 <span class="keywordflow">if</span> (argv) -00137 argv++; -00138 -00139 <span class="keywordflow">while</span> (argv != NULL) { -00140 <span class="keywordflow">if</span> (get_user (vstr, argv)) -00141 <span class="keywordflow">break</span>; -00142 -00143 <span class="keywordflow">if</span> (vstr == NULL) -00144 <span class="keywordflow">break</span>; -00145 -00146 len = <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(str, vstr, 128); -00147 str[len] = 0; -00148 <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a> (list, str); -00149 argv++; -00150 } -00151 <span class="keywordflow">return</span> list-><a class="code" href="structmap__root.html#o2">num</a>; -00152 }<span class="comment"></span> -00153 <span class="comment">/** @} */</span> -00154 <span class="preprocessor">#endif </span><span class="comment">/* _COPY_C_ */</span> +00004 <span class="preprocessor">#include "<a class="code" href="string_8c.html">string.c</a>"</span> +00005 <span class="comment"></span> +00006 <span class="comment">/** @file copy.c</span> +00007 <span class="comment"> * @brief Functions to copy from user space.</span> +00008 <span class="comment"> */</span> +00009 <span class="comment"></span> +00010 <span class="comment">/** @addtogroup copy Functions to copy from user space.</span> +00011 <span class="comment"> * Functions to copy from user space.</span> +00012 <span class="comment"> * None of these functions will sleep (for example to allow pages</span> +00013 <span class="comment"> * to be swapped in). It is possible (although rare) that the data</span> +00014 <span class="comment"> * in user space will not present and these functions will return an error.</span> +00015 <span class="comment"> * @{</span> +00016 <span class="comment"> */</span> +00017 +00018 <span class="keywordtype">long</span> <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count); +00019 <span class="comment">//static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);</span> +00020 +00021 <span class="preprocessor">#if defined (__i386__)</span> +00022 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> +00023 <span class="preprocessor">do { \</span> +00024 <span class="preprocessor"> int __d0, __d1, __d2; \</span> +00025 <span class="preprocessor"> __asm__ __volatile__( \</span> +00026 <span class="preprocessor"> " testl %1,%1\n" \</span> +00027 <span class="preprocessor"> " jz 2f\n" \</span> +00028 <span class="preprocessor"> "0: lodsb\n" \</span> +00029 <span class="preprocessor"> " stosb\n" \</span> +00030 <span class="preprocessor"> " testb %%al,%%al\n" \</span> +00031 <span class="preprocessor"> " jz 1f\n" \</span> +00032 <span class="preprocessor"> " decl %1\n" \</span> +00033 <span class="preprocessor"> " jnz 0b\n" \</span> +00034 <span class="preprocessor"> "1: subl %1,%0\n" \</span> +00035 <span class="preprocessor"> "2:\n" \</span> +00036 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> +00037 <span class="preprocessor"> "3: movl %5,%0\n" \</span> +00038 <span class="preprocessor"> " jmp 2b\n" \</span> +00039 <span class="preprocessor"> ".previous\n" \</span> +00040 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> +00041 <span class="preprocessor"> " .align 4\n" \</span> +00042 <span class="preprocessor"> " .long 0b,3b\n" \</span> +00043 <span class="preprocessor"> ".previous" \</span> +00044 <span class="preprocessor"> : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> +00045 <span class="preprocessor"> "=&D" (__d2) \</span> +00046 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> +00047 <span class="preprocessor"> : "memory"); \</span> +00048 <span class="preprocessor">} while (0)</span> +00049 <span class="preprocessor"></span><span class="preprocessor">#elif defined (__x86_64__)</span> +00050 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> +00051 <span class="preprocessor">do { \</span> +00052 <span class="preprocessor"> long __d0, __d1, __d2; \</span> +00053 <span class="preprocessor"> __asm__ __volatile__( \</span> +00054 <span class="preprocessor"> " testq %1,%1\n" \</span> +00055 <span class="preprocessor"> " jz 2f\n" \</span> +00056 <span class="preprocessor"> "0: lodsb\n" \</span> +00057 <span class="preprocessor"> " stosb\n" \</span> +00058 <span class="preprocessor"> " testb %%al,%%al\n" \</span> +00059 <span class="preprocessor"> " jz 1f\n" \</span> +00060 <span class="preprocessor"> " decq %1\n" \</span> +00061 <span class="preprocessor"> " jnz 0b\n" \</span> +00062 <span class="preprocessor"> "1: subq %1,%0\n" \</span> +00063 <span class="preprocessor"> "2:\n" \</span> +00064 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> +00065 <span class="preprocessor"> "3: movq %5,%0\n" \</span> +00066 <span class="preprocessor"> " jmp 2b\n" \</span> +00067 <span class="preprocessor"> ".previous\n" \</span> +00068 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> +00069 <span class="preprocessor"> " .align 8\n" \</span> +00070 <span class="preprocessor"> " .quad 0b,3b\n" \</span> +00071 <span class="preprocessor"> ".previous" \</span> +00072 <span class="preprocessor"> : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> +00073 <span class="preprocessor"> "=&D" (__d2) \</span> +00074 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> +00075 <span class="preprocessor"> : "memory"); \</span> +00076 <span class="preprocessor">} while (0)</span> +00077 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +00078 <span class="preprocessor"></span><span class="comment"></span> +00079 <span class="comment">/** Copy a NULL-terminated string from userspace.</span> +00080 <span class="comment"> * On success, returns the length of the string (not including the trailing</span> +00081 <span class="comment"> * NULL).</span> +00082 <span class="comment"> *</span> +00083 <span class="comment"> * If access to userspace fails, returns -EFAULT (some data may have been</span> +00084 <span class="comment"> * copied).</span> +00085 <span class="comment"> * @param dst Destination address, in kernel space. This buffer must be at</span> +00086 <span class="comment"> * least <i>count</i> bytes long.</span> +00087 <span class="comment"> * @param src Source address, in user space.</span> +00088 <span class="comment"> * @param count Maximum number of bytes to copy, including the trailing NULL.</span> +00089 <span class="comment"> * </span> +00090 <span class="comment"> * If <i>count</i> is smaller than the length of the string, copies </span> +00091 <span class="comment"> * <i>count</i> bytes and returns <i>count</i>.</span> +00092 <span class="comment"> * @deprecated I can't think of why you wouldn't use _stp_string_from_user() instead.</span> +00093 <span class="comment"> */</span> +00094 +00095 <span class="keywordtype">long</span> +<a name="l00096"></a><a class="code" href="group__copy.html#ga0">00096</a> <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count) +00097 { +00098 <span class="keywordtype">long</span> res; +00099 __stp_strncpy_from_user(dst, src, count, res); +00100 <span class="keywordflow">return</span> res; +00101 } +00102 <span class="comment"></span> +00103 <span class="comment">/** Copy a String from userspace.</span> +00104 <span class="comment"> * Copies a string of up to \e count bytes from userspace into a String. </span> +00105 <span class="comment"> * If access to userspace fails, returns -EFAULT (some data may have been</span> +00106 <span class="comment"> * copied).</span> +00107 <span class="comment"> * @param str Destination String.</span> +00108 <span class="comment"> * @param src Source address, in user space.</span> +00109 <span class="comment"> * @param count Maximum number of bytes to copy, including the trailing NULL.</span> +00110 <span class="comment"> * </span> +00111 <span class="comment"> */</span> +00112 +<a name="l00113"></a><a class="code" href="group__copy.html#ga1">00113</a> <span class="keywordtype">void</span> <a class="code" href="group__copy.html#ga1">_stp_string_from_user</a> (String str, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count) +00114 { +00115 <span class="keywordtype">long</span> res; +00116 <span class="keywordflow">if</span> (count > <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str->len - 1) +00117 count = <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str->len - 1; +00118 __stp_strncpy_from_user(str->buf + str->len, src, count, res); +00119 <span class="keywordflow">if</span> (res > 0) { +00120 str->len += res; +00121 str->buf[str->len] = <span class="charliteral">'\0'</span>; +00122 } +00123 } +00124 <span class="comment"></span> +00125 <span class="comment">/** Copy a block of data from user space.</span> +00126 <span class="comment"> *</span> +00127 <span class="comment"> * If some data could not be copied, this function will pad the copied</span> +00128 <span class="comment"> * data to the requested size using zero bytes.</span> +00129 <span class="comment"></span> +00130 <span class="comment"> * @param dst Destination address, in kernel space.</span> +00131 <span class="comment"> * @param src Source address, in user space.</span> +00132 <span class="comment"> * @param count Number of bytes to copy.</span> +00133 <span class="comment"> * @return number of bytes that could not be copied. On success, </span> +00134 <span class="comment"> * this will be zero.</span> +00135 <span class="comment"> *</span> +00136 <span class="comment"> */</span> +00137 +00138 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> +<a name="l00139"></a><a class="code" href="group__copy.html#ga2">00139</a> <a class="code" href="group__copy.html#ga2">_stp_copy_from_user</a> (<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> count) +00140 { +00141 <span class="keywordflow">return</span> __copy_from_user_inatomic(dst, src, count); +00142 } +00143 <span class="comment"></span> +00144 <span class="comment">/** Copy an argv from user space to a List.</span> +00145 <span class="comment"> *</span> +00146 <span class="comment"> * @param list A list.</span> +00147 <span class="comment"> * @param argv Source argv, in user space.</span> +00148 <span class="comment"> * @return number of elements in <i>list</i></span> +00149 <span class="comment"> *</span> +00150 <span class="comment"> * @b Example:</span> +00151 <span class="comment"> * @include argv.c</span> +00152 <span class="comment"> */</span> +00153 +<a name="l00154"></a><a class="code" href="group__copy.html#ga3">00154</a> <span class="keywordtype">int</span> <a class="code" href="group__copy.html#ga3">_stp_copy_argv_from_user</a> (<a class="code" href="group__maps.html#ga1">MAP</a> list, <span class="keywordtype">char</span> __user *__user *argv) +00155 { +00156 <span class="keywordtype">char</span> str[128]; +00157 <span class="keywordtype">char</span> __user *vstr; +00158 <span class="keywordtype">int</span> len; +00159 +00160 <span class="keywordflow">if</span> (argv) +00161 argv++; +00162 +00163 <span class="keywordflow">while</span> (argv != NULL) { +00164 <span class="keywordflow">if</span> (get_user (vstr, argv)) +00165 <span class="keywordflow">break</span>; +00166 +00167 <span class="keywordflow">if</span> (vstr == NULL) +00168 <span class="keywordflow">break</span>; +00169 +00170 len = <a class="code" href="group__copy.html#ga0">_stp_strncpy_from_user</a>(str, vstr, 128); +00171 str[len] = 0; +00172 <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a> (list, str); +00173 argv++; +00174 } +00175 <span class="keywordflow">return</span> list->num; +00176 }<span class="comment"></span> +00177 <span class="comment">/** @} */</span> +00178 <span class="preprocessor">#endif </span><span class="comment">/* _COPY_C_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/copy_8c.html b/runtime/docs/html/copy_8c.html index 6877dc73..b9c4cc23 100644 --- a/runtime/docs/html/copy_8c.html +++ b/runtime/docs/html/copy_8c.html @@ -4,9 +4,10 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>copy.c File Reference</h1>Functions to copy from user space. <a href="#_details">More...</a> <p> +<code>#include "<a class="el" href="string_8c-source.html">string.c</a>"</code><br> <p> <a href="copy_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> @@ -15,12 +16,15 @@ <tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga0">_stp_strncpy_from_user</a> (char *dst, const char __user *src, long count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a NULL-terminated string from userspace. <a href="group__copy.html#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga1">_stp_copy_from_user</a> (char *dst, const char __user *src, unsigned long count)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga1">_stp_string_from_user</a> (String str, const char __user *src, long count)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a block of data from user space. <a href="group__copy.html#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga2">_stp_copy_argv_from_user</a> (<a class="el" href="structmap__root.html">MAP</a> list, char __user *__user *argv)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a String from userspace. <a href="group__copy.html#ga1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga2">_stp_copy_from_user</a> (char *dst, const char __user *src, unsigned long count)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy an argv from user space to a List. <a href="group__copy.html#ga2"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a block of data from user space. <a href="group__copy.html#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga3">_stp_copy_argv_from_user</a> (<a class="el" href="group__maps.html#ga1">MAP</a> list, char __user *__user *argv)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy an argv from user space to a List. <a href="group__copy.html#ga3"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Functions to copy from user space. diff --git a/runtime/docs/html/current_8c-source.html b/runtime/docs/html/current_8c-source.html index 88ad571a..cbe1bca7 100644 --- a/runtime/docs/html/current_8c-source.html +++ b/runtime/docs/html/current_8c-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>current.c</h1><a href="current_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _CURRENT_C_</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define _CURRENT_C_</span> 00003 <span class="preprocessor"></span> diff --git a/runtime/docs/html/current_8c.html b/runtime/docs/html/current_8c.html index bfb2b727..698a4467 100644 --- a/runtime/docs/html/current_8c.html +++ b/runtime/docs/html/current_8c.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>current.c File Reference</h1>Functions to get the current state. <a href="#_details">More...</a> <p> diff --git a/runtime/docs/html/deprecated.html b/runtime/docs/html/deprecated.html new file mode 100644 index 00000000..fbfbb5d0 --- /dev/null +++ b/runtime/docs/html/deprecated.html @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: Deprecated List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1><a class="anchor" name="deprecated">Deprecated List</a></h1><a class="anchor" name="_deprecated000001"></a> <dl> +<dt>Global <a class="el" href="group__copy.html#ga0">_stp_strncpy_from_user</a> (char *dst, const char __user *src, long count) </dt> +<dd>I can't think of why you wouldn't use <a class="el" href="group__copy.html#ga1">_stp_string_from_user()</a> instead. </dd> +</dl> +</body></html> diff --git a/runtime/docs/html/dir_000000.html b/runtime/docs/html/dir_000000.html index acfc2d57..9ee08412 100644 --- a/runtime/docs/html/dir_000000.html +++ b/runtime/docs/html/dir_000000.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a></div> <h1>probes Directory Reference</h1>This directory contains working example probes that demonstrate and test the runtime library. diff --git a/runtime/docs/html/dir_000001.html b/runtime/docs/html/dir_000001.html index e9fac182..3e97a453 100644 --- a/runtime/docs/html/dir_000001.html +++ b/runtime/docs/html/dir_000001.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000001.html">shellsnoop</a></div> <h1>shellsnoop Directory Reference</h1>Snoops on what commands are being run by shells. @@ -13,13 +13,15 @@ <tr><td colspan="2"><br><h2>Files</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>dtr.c</b> <a href="shellsnoop_2dtr_8c-source.html">[code]</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>dtr.mod.c</b> <a href="dtr_8mod_8c-source.html">[code]</a></td></tr> + <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>README</b> <a href="probes_2shellsnoop_2README-source.html">[code]</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Snoops on what commands are being run by shells. <p> -This is a translation of on an old dtr probe. It demonstrates maps, lists, and how to use <a class="el" href="group__copy.html#ga2">_stp_copy_argv_from_user()</a> and <a class="el" href="group__copy.html#ga0">_stp_strncpy_from_user()</a>.<p> +This is a translation of on an old dtr probe. It demonstrates maps, lists, and how to use <a class="el" href="group__copy.html#ga3">_stp_copy_argv_from_user()</a> and <a class="el" href="group__copy.html#ga0">_stp_strncpy_from_user()</a>.<p> Original dtr source:<p> <div class="fragment"><pre class="fragment"> # shellsnoop.probe - snoop shell execution as it occurs. diff --git a/runtime/docs/html/dir_000002.html b/runtime/docs/html/dir_000002.html index 0a007775..0fe099ec 100644 --- a/runtime/docs/html/dir_000002.html +++ b/runtime/docs/html/dir_000002.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000002.html">tasklet</a></div> <h1>tasklet Directory Reference</h1>Sample probe in a tasklet. diff --git a/runtime/docs/html/dir_000003.html b/runtime/docs/html/dir_000003.html index b9e20e19..497baf4d 100644 --- a/runtime/docs/html/dir_000003.html +++ b/runtime/docs/html/dir_000003.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000003.html">test4</a></div> <h1>test4 Directory Reference</h1>This example probe tracks file opens, reads and writes. @@ -13,10 +13,6 @@ <tr><td colspan="2"><br><h2>Files</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>dtr.c</b> <a href="test4_2dtr_8c-source.html">[code]</a></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>dtr.mod.c</b> <a href="dtr_8mod_8c-source.html">[code]</a></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>nrec.c</b> <a href="nrec_8c-source.html">[code]</a></td></tr> - <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>README</b> <a href="probes_2test4_2README-source.html">[code]</a></td></tr> </table> diff --git a/runtime/docs/html/dir_000004.html b/runtime/docs/html/dir_000004.html index d3e72861..4eeb55a8 100644 --- a/runtime/docs/html/dir_000004.html +++ b/runtime/docs/html/dir_000004.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000004.html">where_func</a></div> <h1>where_func Directory Reference</h1>This is a silly little instrumentation routine to instrument functions entry by name. @@ -13,8 +13,6 @@ <tr><td colspan="2"><br><h2>Files</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>kprobe_where_funct.c</b> <a href="kprobe__where__funct_8c-source.html">[code]</a></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>kprobe_where_funct.mod.c</b> <a href="kprobe__where__funct_8mod_8c-source.html">[code]</a></td></tr> - <tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><b>README</b> <a href="probes_2where__func_2README-source.html">[code]</a></td></tr> </table> diff --git a/runtime/docs/html/dirs.html b/runtime/docs/html/dirs.html index 36214b8b..9cc73aaf 100644 --- a/runtime/docs/html/dirs.html +++ b/runtime/docs/html/dirs.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindexHL" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindexHL" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>SystemTap Directories</h1>This directory hierarchy is sorted roughly, but not completely, alphabetically:<ul> <li><a class="el" href="dir_000000.html">probes</a> <ul> diff --git a/runtime/docs/html/docs_2argv__example_8c-example.html b/runtime/docs/html/docs_2argv__example_8c-example.html deleted file mode 100644 index 0ad61d6d..00000000 --- a/runtime/docs/html/docs_2argv__example_8c-example.html +++ /dev/null @@ -1,20 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>docs/argv_example.c</h1><dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>A list. </td></tr> - <tr><td valign="top"></td><td valign="top"><em>argv</em> </td><td>Source argv, in user space. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>number of elements in <em>list</em></dd></dl> -<div class="fragment"><pre class="fragment"></pre></div> <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 03:35:02 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/dtr_8mod_8c-source.html b/runtime/docs/html/dtr_8mod_8c-source.html index e497c5c4..c1483735 100644 --- a/runtime/docs/html/dtr_8mod_8c-source.html +++ b/runtime/docs/html/dtr_8mod_8c-source.html @@ -1,12 +1,12 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: probes/test4/dtr.mod.c Source File</title> +<title>SystemTap: probes/shellsnoop/dtr.mod.c Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> -<a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000003.html">test4</a></div> +<a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000001.html">shellsnoop</a></div> <h1>dtr.mod.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#include <linux/module.h></span> 00002 <span class="preprocessor">#include <linux/vermagic.h></span> 00003 <span class="preprocessor">#include <linux/compiler.h></span> @@ -27,32 +27,32 @@ 00018 __attribute_used__ 00019 __attribute__((section("__versions"))) = { 00020 { 0x506abef7, <span class="stringliteral">"struct_module"</span> }, -00021 { 0xfcdec747, <span class="stringliteral">"sock_release"</span> }, -00022 { 0x8968634b, <span class="stringliteral">"netlink_kernel_create"</span> }, -00023 { 0xb240ca65, <span class="stringliteral">"schedule_work"</span> }, -00024 { 0x1b9aca3f, <span class="stringliteral">"jprobe_return"</span> }, -00025 { 0x757b6858, <span class="stringliteral">"skb_dequeue"</span> }, -00026 { 0xd4aed67a, <span class="stringliteral">"netlink_ack"</span> }, -00027 { 0x5fc0695e, <span class="stringliteral">"__kfree_skb"</span> }, -00028 { 0xaa1449d7, <span class="stringliteral">"netlink_unicast"</span> }, -00029 { 0x3958414f, <span class="stringliteral">"skb_over_panic"</span> }, -00030 { 0x559dbbb8, <span class="stringliteral">"alloc_skb"</span> }, -00031 { 0x7ec9bfbc, <span class="stringliteral">"strncpy"</span> }, -00032 { 0xe3b0192b, <span class="stringliteral">"vscnprintf"</span> }, -00033 { 0x45e5f47f, <span class="stringliteral">"register_kprobe"</span> }, -00034 { 0x1e736243, <span class="stringliteral">"unregister_kprobe"</span> }, -00035 { 0xdd03a51e, <span class="stringliteral">"register_jprobe"</span> }, -00036 { 0x49a83d3a, <span class="stringliteral">"unregister_jprobe"</span> }, -00037 { 0x3fa03a97, <span class="stringliteral">"memset"</span> }, -00038 { 0xc16fe12d, <span class="stringliteral">"__memcpy"</span> }, -00039 { 0xe914e41e, <span class="stringliteral">"strcpy"</span> }, -00040 { 0xe2d5255a, <span class="stringliteral">"strcmp"</span> }, -00041 { 0x2fd1d81c, <span class="stringliteral">"vfree"</span> }, -00042 { 0x37a0cba, <span class="stringliteral">"kfree"</span> }, -00043 { 0xd6ee688f, <span class="stringliteral">"vmalloc"</span> }, -00044 { 0x8ce16b3f, <span class="stringliteral">"__kmalloc"</span> }, -00045 { 0x8e3c9cc3, <span class="stringliteral">"vprintk"</span> }, -00046 { 0xdd132261, <span class="stringliteral">"printk"</span> }, +00021 { 0x1b9aca3f, <span class="stringliteral">"jprobe_return"</span> }, +00022 { 0x45e5f47f, <span class="stringliteral">"register_kprobe"</span> }, +00023 { 0x1e736243, <span class="stringliteral">"unregister_kprobe"</span> }, +00024 { 0xdd03a51e, <span class="stringliteral">"register_jprobe"</span> }, +00025 { 0x49a83d3a, <span class="stringliteral">"unregister_jprobe"</span> }, +00026 { 0xaa27f890, <span class="stringliteral">"__get_user_8"</span> }, +00027 { 0x21e5679c, <span class="stringliteral">"copy_user_generic"</span> }, +00028 { 0x3fa03a97, <span class="stringliteral">"memset"</span> }, +00029 { 0xc16fe12d, <span class="stringliteral">"__memcpy"</span> }, +00030 { 0xe914e41e, <span class="stringliteral">"strcpy"</span> }, +00031 { 0xe2d5255a, <span class="stringliteral">"strcmp"</span> }, +00032 { 0x2fd1d81c, <span class="stringliteral">"vfree"</span> }, +00033 { 0x37a0cba, <span class="stringliteral">"kfree"</span> }, +00034 { 0xd6ee688f, <span class="stringliteral">"vmalloc"</span> }, +00035 { 0x8ce16b3f, <span class="stringliteral">"__kmalloc"</span> }, +00036 { 0xfcdec747, <span class="stringliteral">"sock_release"</span> }, +00037 { 0x8968634b, <span class="stringliteral">"netlink_kernel_create"</span> }, +00038 { 0x7ec9bfbc, <span class="stringliteral">"strncpy"</span> }, +00039 { 0xe3b0192b, <span class="stringliteral">"vscnprintf"</span> }, +00040 { 0x757b6858, <span class="stringliteral">"skb_dequeue"</span> }, +00041 { 0xd4aed67a, <span class="stringliteral">"netlink_ack"</span> }, +00042 { 0xdd132261, <span class="stringliteral">"printk"</span> }, +00043 { 0x5fc0695e, <span class="stringliteral">"__kfree_skb"</span> }, +00044 { 0xaa1449d7, <span class="stringliteral">"netlink_unicast"</span> }, +00045 { 0x3958414f, <span class="stringliteral">"skb_over_panic"</span> }, +00046 { 0x559dbbb8, <span class="stringliteral">"alloc_skb"</span> }, 00047 }; 00048 00049 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> __module_depends[] @@ -61,5 +61,5 @@ 00052 <span class="stringliteral">"depends="</span>; 00053 00054 -00055 MODULE_INFO(srcversion, <span class="stringliteral">"01D3B50188E5E952DA9FD12"</span>); +00055 MODULE_INFO(srcversion, <span class="stringliteral">"F330A962246F179FE15E94B"</span>); </pre></div></body></html> diff --git a/runtime/docs/html/examples.html b/runtime/docs/html/examples.html deleted file mode 100644 index cd53f417..00000000 --- a/runtime/docs/html/examples.html +++ /dev/null @@ -1,16 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>SystemTap Examples</h1>Here is a list of all examples:<ul> -<li><a class="el" href="foreach_8c-example.html">foreach.c</a> -</ul> -<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 12:24:52 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/files.html b/runtime/docs/html/files.html index f61591f6..0099797e 100644 --- a/runtime/docs/html/files.html +++ b/runtime/docs/html/files.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindexHL" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindexHL" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>SystemTap File List</h1>Here is a list of all documented files with brief descriptions:<table> <tr><td class="indexkey"><a class="el" href="alloc_8c.html">alloc.c</a> <a href="alloc_8c-source.html">[code]</a></td><td class="indexvalue">Memory functions </td></tr> <tr><td class="indexkey"><a class="el" href="copy_8c.html">copy.c</a> <a href="copy_8c-source.html">[code]</a></td><td class="indexvalue">Functions to copy from user space </td></tr> @@ -12,23 +12,24 @@ <tr><td class="indexkey"><a class="el" href="io_8c.html">io.c</a> <a href="io_8c-source.html">[code]</a></td><td class="indexvalue">I/O functions </td></tr> <tr><td class="indexkey"><a class="el" href="map_8c.html">map.c</a> <a href="map_8c-source.html">[code]</a></td><td class="indexvalue">Implements maps (associative arrays) and lists </td></tr> <tr><td class="indexkey"><a class="el" href="map_8h.html">map.h</a> <a href="map_8h-source.html">[code]</a></td><td class="indexvalue">Header file for maps and lists </td></tr> + <tr><td class="indexkey"><b>print.c</b> <a href="print_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="probes_8c.html">probes.c</a> <a href="probes_8c-source.html">[code]</a></td><td class="indexvalue">Functions to assist loading and unloading groups of probes </td></tr> <tr><td class="indexkey"><b>README</b> <a href="README-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><b>relay-app.h</b> <a href="relay-app_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="runtime_8h.html">runtime.h</a> <a href="runtime_8h-source.html">[code]</a></td><td class="indexvalue">Main include file for runtime functions </td></tr> - <tr><td class="indexkey"><b>scbuf.c</b> <a href="scbuf_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="stack_8c.html">stack.c</a> <a href="stack_8c-source.html">[code]</a></td><td class="indexvalue">Stack Tracing Functions </td></tr> + <tr><td class="indexkey"><a class="el" href="string_8c.html">string.c</a> <a href="string_8c-source.html">[code]</a></td><td class="indexvalue">Implements String type </td></tr> <tr><td class="indexkey"><b>sym.c</b> <a href="sym_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><a class="el" href="TODO.html">TODO</a> <a href="TODO-source.html">[code]</a></td><td class="indexvalue">To-Do List </td></tr> <tr><td class="indexkey">probes/<b>README</b> <a href="probes_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/shellsnoop/<b>dtr.c</b> <a href="shellsnoop_2dtr_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">probes/shellsnoop/<b>dtr.mod.c</b> <a href="dtr_8mod_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/shellsnoop/<b>README</b> <a href="probes_2shellsnoop_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/tasklet/<b>README</b> <a href="probes_2tasklet_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/tasklet/<b>stp_tasklet.c</b> <a href="stp__tasklet_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/test4/<b>dtr.c</b> <a href="test4_2dtr_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> - <tr><td class="indexkey">probes/test4/<b>dtr.mod.c</b> <a href="dtr_8mod_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> - <tr><td class="indexkey">probes/test4/<b>nrec.c</b> <a href="nrec_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/test4/<b>README</b> <a href="probes_2test4_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/where_func/<b>kprobe_where_funct.c</b> <a href="kprobe__where__funct_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> - <tr><td class="indexkey">probes/where_func/<b>kprobe_where_funct.mod.c</b> <a href="kprobe__where__funct_8mod_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey">probes/where_func/<b>README</b> <a href="probes_2where__func_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> </table> </body></html> diff --git a/runtime/docs/html/foreach_8c-example.html b/runtime/docs/html/foreach_8c-example.html deleted file mode 100644 index ccafaeeb..00000000 --- a/runtime/docs/html/foreach_8c-example.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>foreach.c</h1><dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to a <a class="el" href="structmap__node__stat.html">map_node_stat</a>, <a class="el" href="structmap__node__int64.html">map_node_int64</a> or <a class="el" href="structmap__node__str.html">map_node_str</a></td></tr> - </table> -</dl> -<div class="fragment"><pre class="fragment"><span class="comment">/* example showing how to print all the stats in a map using foreach() */</span> - -<span class="keyword">struct </span><a name="_a0"></a><a class="code" href="structmap__node__stat.html">map_node_stat</a> *ptr; - -<a name="a1"></a><a class="code" href="map_8h.html#a8">foreach</a> (map, ptr) - printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), - key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, - ptr->stats.max); - -</pre></div> <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 12:24:52 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/ftv2blank.png b/runtime/docs/html/ftv2blank.png Binary files differdeleted file mode 100644 index 493c3c0b..00000000 --- a/runtime/docs/html/ftv2blank.png +++ /dev/null diff --git a/runtime/docs/html/ftv2doc.png b/runtime/docs/html/ftv2doc.png Binary files differdeleted file mode 100644 index f72999f9..00000000 --- a/runtime/docs/html/ftv2doc.png +++ /dev/null diff --git a/runtime/docs/html/ftv2folderclosed.png b/runtime/docs/html/ftv2folderclosed.png Binary files differdeleted file mode 100644 index d6d06344..00000000 --- a/runtime/docs/html/ftv2folderclosed.png +++ /dev/null diff --git a/runtime/docs/html/ftv2folderopen.png b/runtime/docs/html/ftv2folderopen.png Binary files differdeleted file mode 100644 index bbe2c913..00000000 --- a/runtime/docs/html/ftv2folderopen.png +++ /dev/null diff --git a/runtime/docs/html/ftv2lastnode.png b/runtime/docs/html/ftv2lastnode.png Binary files differdeleted file mode 100644 index e7b9ba90..00000000 --- a/runtime/docs/html/ftv2lastnode.png +++ /dev/null diff --git a/runtime/docs/html/ftv2link.png b/runtime/docs/html/ftv2link.png Binary files differdeleted file mode 100644 index 14f3fed0..00000000 --- a/runtime/docs/html/ftv2link.png +++ /dev/null diff --git a/runtime/docs/html/ftv2mlastnode.png b/runtime/docs/html/ftv2mlastnode.png Binary files differdeleted file mode 100644 index 09ceb6ad..00000000 --- a/runtime/docs/html/ftv2mlastnode.png +++ /dev/null diff --git a/runtime/docs/html/ftv2mnode.png b/runtime/docs/html/ftv2mnode.png Binary files differdeleted file mode 100644 index 3254c051..00000000 --- a/runtime/docs/html/ftv2mnode.png +++ /dev/null diff --git a/runtime/docs/html/ftv2node.png b/runtime/docs/html/ftv2node.png Binary files differdeleted file mode 100644 index c9f06a57..00000000 --- a/runtime/docs/html/ftv2node.png +++ /dev/null diff --git a/runtime/docs/html/ftv2plastnode.png b/runtime/docs/html/ftv2plastnode.png Binary files differdeleted file mode 100644 index 0b07e009..00000000 --- a/runtime/docs/html/ftv2plastnode.png +++ /dev/null diff --git a/runtime/docs/html/ftv2pnode.png b/runtime/docs/html/ftv2pnode.png Binary files differdeleted file mode 100644 index 2001b797..00000000 --- a/runtime/docs/html/ftv2pnode.png +++ /dev/null diff --git a/runtime/docs/html/ftv2vertline.png b/runtime/docs/html/ftv2vertline.png Binary files differdeleted file mode 100644 index b330f3a3..00000000 --- a/runtime/docs/html/ftv2vertline.png +++ /dev/null diff --git a/runtime/docs/html/functions.html b/runtime/docs/html/functions.html deleted file mode 100644 index e48ba9fa..00000000 --- a/runtime/docs/html/functions.html +++ /dev/null @@ -1,25 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: Data Fields</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<div class="qindex"><a class="qindexHL" href="functions.html">All</a> | <a class="qindex" href="functions_vars.html">Variables</a></div> - -<p> -Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:<ul> -<li>create -: <a class="el" href="structmap__root.html#o7">map_root</a><li>hashes -: <a class="el" href="structmap__root.html#o13">map_root</a><li>head -: <a class="el" href="structmap__root.html#o4">map_root</a><li>hnode -: <a class="el" href="structmap__node.html#o1">map_node</a><li>key -: <a class="el" href="structmap__root.html#o6">map_root</a><li>lnode -: <a class="el" href="structmap__node.html#o0">map_node</a><li>maxnum -: <a class="el" href="structmap__root.html#o1">map_root</a><li>membuf -: <a class="el" href="structmap__root.html#o14">map_root</a><li>no_wrap -: <a class="el" href="structmap__root.html#o3">map_root</a><li>num -: <a class="el" href="structmap__root.html#o2">map_root</a><li>pool -: <a class="el" href="structmap__root.html#o5">map_root</a><li>type -: <a class="el" href="structmap__root.html#o0">map_root</a></ul> -</body></html> diff --git a/runtime/docs/html/functions_vars.html b/runtime/docs/html/functions_vars.html deleted file mode 100644 index ed63f0fd..00000000 --- a/runtime/docs/html/functions_vars.html +++ /dev/null @@ -1,25 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: Data Fields - Variables</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindexHL" href="functions_vars.html">Variables</a></div> - -<p> -<ul> -<li>create -: <a class="el" href="structmap__root.html#o7">map_root</a><li>hashes -: <a class="el" href="structmap__root.html#o13">map_root</a><li>head -: <a class="el" href="structmap__root.html#o4">map_root</a><li>hnode -: <a class="el" href="structmap__node.html#o1">map_node</a><li>key -: <a class="el" href="structmap__root.html#o6">map_root</a><li>lnode -: <a class="el" href="structmap__node.html#o0">map_node</a><li>maxnum -: <a class="el" href="structmap__root.html#o1">map_root</a><li>membuf -: <a class="el" href="structmap__root.html#o14">map_root</a><li>no_wrap -: <a class="el" href="structmap__root.html#o3">map_root</a><li>num -: <a class="el" href="structmap__root.html#o2">map_root</a><li>pool -: <a class="el" href="structmap__root.html#o5">map_root</a><li>type -: <a class="el" href="structmap__root.html#o0">map_root</a></ul> -</body></html> diff --git a/runtime/docs/html/globals.html b/runtime/docs/html/globals.html index 7ac847b4..bc04b2aa 100644 --- a/runtime/docs/html/globals.html +++ b/runtime/docs/html/globals.html @@ -4,9 +4,9 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindexHL" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> -<div class="qindex"><a class="qindex" href="#index__">_</a> | <a class="qindex" href="#index_d">d</a> | <a class="qindex" href="#index_f">f</a> | <a class="qindex" href="#index_k">k</a> | <a class="qindex" href="#index_m">m</a> | <a class="qindex" href="#index_p">p</a> | <a class="qindex" href="#index_v">v</a></div> +<div class="qindex"><a class="qindex" href="#index__">_</a> | <a class="qindex" href="#index_f">f</a> | <a class="qindex" href="#index_k">k</a> | <a class="qindex" href="#index_m">m</a> | <a class="qindex" href="#index_p">p</a> | <a class="qindex" href="#index_s">s</a> | <a class="qindex" href="#index_v">v</a></div> <p> @@ -15,23 +15,25 @@ Here is a list of all documented functions, variables, defines, enums, and typed <li>_stp_alloc() : <a class="el" href="group__alloc.html#ga1">alloc.c</a><li>_stp_calloc() : <a class="el" href="group__alloc.html#ga2">alloc.c</a><li>_stp_copy_argv_from_user() -: <a class="el" href="group__copy.html#ga2">copy.c</a><li>_stp_copy_from_user() -: <a class="el" href="group__copy.html#ga1">copy.c</a><li>_stp_free() +: <a class="el" href="group__copy.html#ga3">copy.c</a><li>_stp_copy_from_user() +: <a class="el" href="group__copy.html#ga2">copy.c</a><li>_stp_free() : <a class="el" href="group__alloc.html#ga4">alloc.c</a><li>_stp_list_add -: <a class="el" href="group__lists.html#ga5">map.h</a><li>_stp_list_add_int64() -: <a class="el" href="group__lists.html#ga3">map.c</a><li>_stp_list_add_str() -: <a class="el" href="group__lists.html#ga2">map.c</a><li>_stp_list_clear() +: <a class="el" href="group__lists.html#ga6">map.h</a><li>_stp_list_add_int64() +: <a class="el" href="group__lists.html#ga4">map.c</a><li>_stp_list_add_str() +: <a class="el" href="group__lists.html#ga2">map.c</a><li>_stp_list_add_string() +: <a class="el" href="group__lists.html#ga3">map.c</a><li>_stp_list_clear() : <a class="el" href="group__lists.html#ga1">map.c</a><li>_stp_list_new() : <a class="el" href="group__lists.html#ga0">map.c</a><li>_stp_list_size() -: <a class="el" href="group__lists.html#ga4">map.c</a><li>_stp_map_add_int64() +: <a class="el" href="group__lists.html#ga5">map.c</a><li>_stp_log() +: <a class="el" href="group__io.html#ga2">io.c</a><li>_stp_map_add_int64() : <a class="el" href="group__maps.html#ga17">map.c</a><li>_stp_map_del() : <a class="el" href="group__maps.html#ga7">map.c</a><li>_stp_map_get_int64() : <a class="el" href="group__maps.html#ga18">map.c</a><li>_stp_map_get_stat() -: <a class="el" href="group__maps.html#ga22">map.c</a><li>_stp_map_get_str() -: <a class="el" href="group__maps.html#ga20">map.c</a><li>_stp_map_iter() +: <a class="el" href="group__maps.html#ga23">map.c</a><li>_stp_map_get_str() +: <a class="el" href="group__maps.html#ga21">map.c</a><li>_stp_map_iter() : <a class="el" href="group__maps.html#ga6">map.c</a><li>_stp_map_key -: <a class="el" href="group__maps.html#ga29">map.h</a><li>_stp_map_key2 -: <a class="el" href="group__maps.html#ga28">map.h</a><li>_stp_map_key_del() +: <a class="el" href="group__maps.html#ga30">map.h</a><li>_stp_map_key2 +: <a class="el" href="group__maps.html#ga29">map.h</a><li>_stp_map_key_del() : <a class="el" href="group__maps.html#ga4">map.c</a><li>_stp_map_key_long() : <a class="el" href="group__maps.html#ga13">map.c</a><li>_stp_map_key_long_long() : <a class="el" href="group__maps.html#ga8">map.c</a><li>_stp_map_key_long_str() @@ -40,43 +42,54 @@ Here is a list of all documented functions, variables, defines, enums, and typed : <a class="el" href="group__maps.html#ga10">map.c</a><li>_stp_map_key_str_str() : <a class="el" href="group__maps.html#ga9">map.c</a><li>_stp_map_new() : <a class="el" href="group__maps.html#ga2">map.c</a><li>_stp_map_set -: <a class="el" href="group__maps.html#ga30">map.h</a><li>_stp_map_set_int64() +: <a class="el" href="group__maps.html#ga31">map.h</a><li>_stp_map_set_int64() : <a class="el" href="group__maps.html#ga16">map.c</a><li>_stp_map_set_stat() -: <a class="el" href="group__maps.html#ga21">map.c</a><li>_stp_map_set_str() -: <a class="el" href="group__maps.html#ga19">map.c</a><li>_stp_map_start() +: <a class="el" href="group__maps.html#ga22">map.c</a><li>_stp_map_set_str() +: <a class="el" href="group__maps.html#ga19">map.c</a><li>_stp_map_set_string() +: <a class="el" href="group__maps.html#ga20">map.c</a><li>_stp_map_start() : <a class="el" href="group__maps.html#ga5">map.c</a><li>_stp_map_stat_add() -: <a class="el" href="group__maps.html#ga23">map.c</a><li>_stp_print() -: <a class="el" href="group__io.html#ga1">io.c</a><li>_stp_print_str() -: <a class="el" href="group__io.html#ga2">io.c</a><li>_stp_register_jprobes() -: <a class="el" href="probes_8c.html#a2">probes.c</a><li>_stp_register_kprobes() -: <a class="el" href="probes_8c.html#a4">probes.c</a><li>_stp_ret_addr() -: <a class="el" href="group__current.html#ga0">current.c</a><li>_stp_stack_print() -: <a class="el" href="group__stack.html#ga6">stack.c</a><li>_stp_strncpy_from_user() +: <a class="el" href="group__maps.html#ga24">map.c</a><li>_stp_netlink_close() +: <a class="el" href="group__io.html#ga8">io.c</a><li>_stp_netlink_open() +: <a class="el" href="group__io.html#ga7">io.c</a><li>_stp_register_jprobes() +: <a class="el" href="probes_8c.html#a3">probes.c</a><li>_stp_register_kprobes() +: <a class="el" href="probes_8c.html#a5">probes.c</a><li>_stp_ret_addr() +: <a class="el" href="group__current.html#ga0">current.c</a><li>_stp_sprintf() +: <a class="el" href="group__string.html#ga3">string.c</a><li>_stp_stack_print() +: <a class="el" href="group__stack.html#ga6">stack.c</a><li>_stp_stack_sprint() +: <a class="el" href="group__stack.html#ga7">stack.c</a><li>_stp_string_cat +: <a class="el" href="group__string.html#ga9">string.c</a><li>_stp_string_cat_cstr() +: <a class="el" href="group__string.html#ga5">string.c</a><li>_stp_string_cat_string() +: <a class="el" href="group__string.html#ga6">string.c</a><li>_stp_string_from_user() +: <a class="el" href="group__copy.html#ga1">copy.c</a><li>_stp_string_init() +: <a class="el" href="group__string.html#ga2">string.c</a><li>_stp_string_ptr() +: <a class="el" href="group__string.html#ga7">string.c</a><li>_stp_strncpy_from_user() : <a class="el" href="group__copy.html#ga0">copy.c</a><li>_stp_unregister_jprobes() -: <a class="el" href="probes_8c.html#a1">probes.c</a><li>_stp_unregister_kprobes() -: <a class="el" href="probes_8c.html#a3">probes.c</a><li>_stp_valloc() +: <a class="el" href="probes_8c.html#a2">probes.c</a><li>_stp_unregister_kprobes() +: <a class="el" href="probes_8c.html#a4">probes.c</a><li>_stp_valloc() : <a class="el" href="group__alloc.html#ga3">alloc.c</a><li>_stp_vfree() -: <a class="el" href="group__alloc.html#ga5">alloc.c</a></ul> -<h3><a class="anchor" name="index_d">- d -</a></h3><ul> -<li>dlog() -: <a class="el" href="group__io.html#ga0">io.c</a></ul> +: <a class="el" href="group__alloc.html#ga5">alloc.c</a><li>_stp_vsprintf() +: <a class="el" href="group__string.html#ga4">string.c</a></ul> <h3><a class="anchor" name="index_f">- f -</a></h3><ul> <li>foreach -: <a class="el" href="group__maps.html#ga31">map.h</a></ul> +: <a class="el" href="group__maps.html#ga32">map.h</a></ul> <h3><a class="anchor" name="index_k">- k -</a></h3><ul> <li>key1int -: <a class="el" href="group__maps.html#ga26">map.h</a><li>key1str -: <a class="el" href="group__maps.html#ga24">map.h</a><li>key2int -: <a class="el" href="group__maps.html#ga27">map.h</a><li>key2str -: <a class="el" href="group__maps.html#ga25">map.h</a><li>keytype -: <a class="el" href="group__maps.html#ga32">map.h</a></ul> +: <a class="el" href="group__maps.html#ga27">map.h</a><li>key1str +: <a class="el" href="group__maps.html#ga25">map.h</a><li>key2int +: <a class="el" href="group__maps.html#ga28">map.h</a><li>key2str +: <a class="el" href="group__maps.html#ga26">map.h</a><li>keytype +: <a class="el" href="group__maps.html#ga33">map.h</a></ul> <h3><a class="anchor" name="index_m">- m -</a></h3><ul> <li>MAP : <a class="el" href="group__maps.html#ga1">map.h</a></ul> <h3><a class="anchor" name="index_p">- p -</a></h3><ul> <li>packed : <a class="el" href="group__maps.html#ga0">map.h</a></ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>STP_LOG_BUF_LEN +: <a class="el" href="group__io.html#ga9">io.c</a><li>STP_STRING_SIZE +: <a class="el" href="group__string.html#ga8">string.c</a></ul> <h3><a class="anchor" name="index_v">- v -</a></h3><ul> <li>valtype -: <a class="el" href="group__maps.html#ga33">map.h</a></ul> +: <a class="el" href="group__maps.html#ga34">map.h</a></ul> </body></html> diff --git a/runtime/docs/html/globals_defs.html b/runtime/docs/html/globals_defs.html index fd07c918..93e7a777 100644 --- a/runtime/docs/html/globals_defs.html +++ b/runtime/docs/html/globals_defs.html @@ -4,19 +4,22 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindexHL" href="globals_defs.html">Defines</a></div> <p> <ul> <li>_stp_list_add -: <a class="el" href="group__lists.html#ga5">map.h</a><li>_stp_map_key -: <a class="el" href="group__maps.html#ga29">map.h</a><li>_stp_map_key2 -: <a class="el" href="group__maps.html#ga28">map.h</a><li>_stp_map_set -: <a class="el" href="group__maps.html#ga30">map.h</a><li>foreach -: <a class="el" href="group__maps.html#ga31">map.h</a><li>key1int -: <a class="el" href="group__maps.html#ga26">map.h</a><li>key1str -: <a class="el" href="group__maps.html#ga24">map.h</a><li>key2int -: <a class="el" href="group__maps.html#ga27">map.h</a><li>key2str -: <a class="el" href="group__maps.html#ga25">map.h</a></ul> +: <a class="el" href="group__lists.html#ga6">map.h</a><li>_stp_map_key +: <a class="el" href="group__maps.html#ga30">map.h</a><li>_stp_map_key2 +: <a class="el" href="group__maps.html#ga29">map.h</a><li>_stp_map_set +: <a class="el" href="group__maps.html#ga31">map.h</a><li>_stp_string_cat +: <a class="el" href="group__string.html#ga9">string.c</a><li>foreach +: <a class="el" href="group__maps.html#ga32">map.h</a><li>key1int +: <a class="el" href="group__maps.html#ga27">map.h</a><li>key1str +: <a class="el" href="group__maps.html#ga25">map.h</a><li>key2int +: <a class="el" href="group__maps.html#ga28">map.h</a><li>key2str +: <a class="el" href="group__maps.html#ga26">map.h</a><li>STP_LOG_BUF_LEN +: <a class="el" href="group__io.html#ga9">io.c</a><li>STP_STRING_SIZE +: <a class="el" href="group__string.html#ga8">string.c</a></ul> </body></html> diff --git a/runtime/docs/html/globals_enum.html b/runtime/docs/html/globals_enum.html index da3f3ac0..f283f502 100644 --- a/runtime/docs/html/globals_enum.html +++ b/runtime/docs/html/globals_enum.html @@ -4,12 +4,12 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindexHL" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> <p> <ul> <li>keytype -: <a class="el" href="group__maps.html#ga32">map.h</a><li>valtype -: <a class="el" href="group__maps.html#ga33">map.h</a></ul> +: <a class="el" href="group__maps.html#ga33">map.h</a><li>valtype +: <a class="el" href="group__maps.html#ga34">map.h</a></ul> </body></html> diff --git a/runtime/docs/html/globals_eval.html b/runtime/docs/html/globals_eval.html deleted file mode 100644 index 4771c4a5..00000000 --- a/runtime/docs/html/globals_eval.html +++ /dev/null @@ -1,27 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindexHL" href="globals_eval.html">Enumeration values</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> - -<p> -<ul> -<li>END -: <a class="el" href="map_8h.html#a19a17">map.h</a><li>ERR_NO_MEM -: <a class="el" href="alloc_8h.html#a8a2">alloc.h</a><li>ERR_NONE -: <a class="el" href="alloc_8h.html#a8a1">alloc.h</a><li>INT64 -: <a class="el" href="map_8h.html#a19a14">map.h</a><li>LONG -: <a class="el" href="map_8h.html#a18a12">map.h</a><li>NONE -: <a class="el" href="map_8h.html#a18a11">map.h</a><li>STAT -: <a class="el" href="map_8h.html#a19a15">map.h</a><li>STR -: <a class="el" href="map_8h.html#a18a13">map.h</a><li>STRING -: <a class="el" href="map_8h.html#a19a16">map.h</a></ul> -<hr size="1"><address style="align: right;"><small>Generated on Mon Mar 21 13:29:45 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/globals_func.html b/runtime/docs/html/globals_func.html index 1562f9d2..a74e4ad0 100644 --- a/runtime/docs/html/globals_func.html +++ b/runtime/docs/html/globals_func.html @@ -4,9 +4,9 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindexHL" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> -<div class="qindex"><a class="qindex" href="#index__">_</a> | <a class="qindex" href="#index_d">d</a></div> +<div class="qindex"><a class="qindex" href="#index__">_</a></div> <p> @@ -15,19 +15,21 @@ <li>_stp_alloc() : <a class="el" href="group__alloc.html#ga1">alloc.c</a><li>_stp_calloc() : <a class="el" href="group__alloc.html#ga2">alloc.c</a><li>_stp_copy_argv_from_user() -: <a class="el" href="group__copy.html#ga2">copy.c</a><li>_stp_copy_from_user() -: <a class="el" href="group__copy.html#ga1">copy.c</a><li>_stp_free() +: <a class="el" href="group__copy.html#ga3">copy.c</a><li>_stp_copy_from_user() +: <a class="el" href="group__copy.html#ga2">copy.c</a><li>_stp_free() : <a class="el" href="group__alloc.html#ga4">alloc.c</a><li>_stp_list_add_int64() -: <a class="el" href="group__lists.html#ga3">map.c</a><li>_stp_list_add_str() -: <a class="el" href="group__lists.html#ga2">map.c</a><li>_stp_list_clear() +: <a class="el" href="group__lists.html#ga4">map.c</a><li>_stp_list_add_str() +: <a class="el" href="group__lists.html#ga2">map.c</a><li>_stp_list_add_string() +: <a class="el" href="group__lists.html#ga3">map.c</a><li>_stp_list_clear() : <a class="el" href="group__lists.html#ga1">map.c</a><li>_stp_list_new() : <a class="el" href="group__lists.html#ga0">map.c</a><li>_stp_list_size() -: <a class="el" href="group__lists.html#ga4">map.c</a><li>_stp_map_add_int64() +: <a class="el" href="group__lists.html#ga5">map.c</a><li>_stp_log() +: <a class="el" href="group__io.html#ga2">io.c</a><li>_stp_map_add_int64() : <a class="el" href="group__maps.html#ga17">map.c</a><li>_stp_map_del() : <a class="el" href="group__maps.html#ga7">map.c</a><li>_stp_map_get_int64() : <a class="el" href="group__maps.html#ga18">map.c</a><li>_stp_map_get_stat() -: <a class="el" href="group__maps.html#ga22">map.c</a><li>_stp_map_get_str() -: <a class="el" href="group__maps.html#ga20">map.c</a><li>_stp_map_iter() +: <a class="el" href="group__maps.html#ga23">map.c</a><li>_stp_map_get_str() +: <a class="el" href="group__maps.html#ga21">map.c</a><li>_stp_map_iter() : <a class="el" href="group__maps.html#ga6">map.c</a><li>_stp_map_key_del() : <a class="el" href="group__maps.html#ga4">map.c</a><li>_stp_map_key_long() : <a class="el" href="group__maps.html#ga13">map.c</a><li>_stp_map_key_long_long() @@ -38,22 +40,28 @@ : <a class="el" href="group__maps.html#ga9">map.c</a><li>_stp_map_new() : <a class="el" href="group__maps.html#ga2">map.c</a><li>_stp_map_set_int64() : <a class="el" href="group__maps.html#ga16">map.c</a><li>_stp_map_set_stat() -: <a class="el" href="group__maps.html#ga21">map.c</a><li>_stp_map_set_str() -: <a class="el" href="group__maps.html#ga19">map.c</a><li>_stp_map_start() +: <a class="el" href="group__maps.html#ga22">map.c</a><li>_stp_map_set_str() +: <a class="el" href="group__maps.html#ga19">map.c</a><li>_stp_map_set_string() +: <a class="el" href="group__maps.html#ga20">map.c</a><li>_stp_map_start() : <a class="el" href="group__maps.html#ga5">map.c</a><li>_stp_map_stat_add() -: <a class="el" href="group__maps.html#ga23">map.c</a><li>_stp_print() -: <a class="el" href="group__io.html#ga1">io.c</a><li>_stp_print_str() -: <a class="el" href="group__io.html#ga2">io.c</a><li>_stp_register_jprobes() -: <a class="el" href="probes_8c.html#a2">probes.c</a><li>_stp_register_kprobes() -: <a class="el" href="probes_8c.html#a4">probes.c</a><li>_stp_ret_addr() -: <a class="el" href="group__current.html#ga0">current.c</a><li>_stp_stack_print() -: <a class="el" href="group__stack.html#ga6">stack.c</a><li>_stp_strncpy_from_user() +: <a class="el" href="group__maps.html#ga24">map.c</a><li>_stp_netlink_close() +: <a class="el" href="group__io.html#ga8">io.c</a><li>_stp_netlink_open() +: <a class="el" href="group__io.html#ga7">io.c</a><li>_stp_register_jprobes() +: <a class="el" href="probes_8c.html#a3">probes.c</a><li>_stp_register_kprobes() +: <a class="el" href="probes_8c.html#a5">probes.c</a><li>_stp_ret_addr() +: <a class="el" href="group__current.html#ga0">current.c</a><li>_stp_sprintf() +: <a class="el" href="group__string.html#ga3">string.c</a><li>_stp_stack_print() +: <a class="el" href="group__stack.html#ga6">stack.c</a><li>_stp_stack_sprint() +: <a class="el" href="group__stack.html#ga7">stack.c</a><li>_stp_string_cat_cstr() +: <a class="el" href="group__string.html#ga5">string.c</a><li>_stp_string_cat_string() +: <a class="el" href="group__string.html#ga6">string.c</a><li>_stp_string_from_user() +: <a class="el" href="group__copy.html#ga1">copy.c</a><li>_stp_string_init() +: <a class="el" href="group__string.html#ga2">string.c</a><li>_stp_string_ptr() +: <a class="el" href="group__string.html#ga7">string.c</a><li>_stp_strncpy_from_user() : <a class="el" href="group__copy.html#ga0">copy.c</a><li>_stp_unregister_jprobes() -: <a class="el" href="probes_8c.html#a1">probes.c</a><li>_stp_unregister_kprobes() -: <a class="el" href="probes_8c.html#a3">probes.c</a><li>_stp_valloc() +: <a class="el" href="probes_8c.html#a2">probes.c</a><li>_stp_unregister_kprobes() +: <a class="el" href="probes_8c.html#a4">probes.c</a><li>_stp_valloc() : <a class="el" href="group__alloc.html#ga3">alloc.c</a><li>_stp_vfree() -: <a class="el" href="group__alloc.html#ga5">alloc.c</a></ul> -<h3><a class="anchor" name="index_d">- d -</a></h3><ul> -<li>dlog() -: <a class="el" href="group__io.html#ga0">io.c</a></ul> +: <a class="el" href="group__alloc.html#ga5">alloc.c</a><li>_stp_vsprintf() +: <a class="el" href="group__string.html#ga4">string.c</a></ul> </body></html> diff --git a/runtime/docs/html/globals_type.html b/runtime/docs/html/globals_type.html index ab8a7382..87f1e8a8 100644 --- a/runtime/docs/html/globals_type.html +++ b/runtime/docs/html/globals_type.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_vars.html">Variables</a> | <a class="qindexHL" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> <p> diff --git a/runtime/docs/html/globals_vars.html b/runtime/docs/html/globals_vars.html index a4674892..8c4140c4 100644 --- a/runtime/docs/html/globals_vars.html +++ b/runtime/docs/html/globals_vars.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindexHL" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindexHL" href="globals_vars.html">Variables</a> | <a class="qindex" href="globals_type.html">Typedefs</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_defs.html">Defines</a></div> <p> diff --git a/runtime/docs/html/group__alloc.html b/runtime/docs/html/group__alloc.html index 1a3e32b2..b1151b86 100644 --- a/runtime/docs/html/group__alloc.html +++ b/runtime/docs/html/group__alloc.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Memory Functions</h1>Basic malloc/calloc/free functions. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> @@ -80,7 +80,7 @@ This is used for small allocations from within a running probe where the process <p> Definition at line <a class="el" href="alloc_8c-source.html#l00031">31</a> of file <a class="el" href="alloc_8c-source.html">alloc.c</a>. <p> -Referenced by <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> +Referenced by <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga2" doxytag="alloc.c::_stp_calloc"></a><p> @@ -123,7 +123,7 @@ Definition at line <a class="el" href="alloc_8c-source.html#l00047">47</a> of fi <p> References <a class="el" href="alloc_8c-source.html#l00031">_stp_alloc()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00691">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga4" doxytag="alloc.c::_stp_free"></a><p> @@ -162,7 +162,7 @@ Frees memory allocated by _stp_alloc or _stp_calloc. <p> Definition at line <a class="el" href="alloc_8c-source.html#l00076">76</a> of file <a class="el" href="alloc_8c-source.html">alloc.c</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00813">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00831">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga3" doxytag="alloc.c::_stp_valloc"></a><p> diff --git a/runtime/docs/html/group__copy.html b/runtime/docs/html/group__copy.html index 83928d95..72321187 100644 --- a/runtime/docs/html/group__copy.html +++ b/runtime/docs/html/group__copy.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Functions to copy from user space.</h1>Functions to copy from user space. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> @@ -12,18 +12,21 @@ <tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga0">_stp_strncpy_from_user</a> (char *dst, const char __user *src, long count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a NULL-terminated string from userspace. <a href="#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga1">_stp_copy_from_user</a> (char *dst, const char __user *src, unsigned long count)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga1">_stp_string_from_user</a> (String str, const char __user *src, long count)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a block of data from user space. <a href="#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga2">_stp_copy_argv_from_user</a> (<a class="el" href="structmap__root.html">MAP</a> list, char __user *__user *argv)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a String from userspace. <a href="#ga1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga2">_stp_copy_from_user</a> (char *dst, const char __user *src, unsigned long count)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy an argv from user space to a List. <a href="#ga2"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a block of data from user space. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__copy.html#ga3">_stp_copy_argv_from_user</a> (<a class="el" href="group__maps.html#ga1">MAP</a> list, char __user *__user *argv)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy an argv from user space to a List. <a href="#ga3"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Functions to copy from user space. <p> None of these functions will sleep (for example to allow pages to be swapped in). It is possible (although rare) that the data in user space will not present and these functions will return an error. <hr><h2>Function Documentation</h2> -<a class="anchor" name="ga2" doxytag="copy.c::_stp_copy_argv_from_user"></a><p> +<a class="anchor" name="ga3" doxytag="copy.c::_stp_copy_argv_from_user"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -31,7 +34,7 @@ None of these functions will sleep (for example to allow pages to be swapped in) <tr> <td class="md" nowrap valign="top">int _stp_copy_argv_from_user </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>list</em>, </td> </tr> <tr> @@ -66,27 +69,27 @@ Copy an argv from user space to a List. </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>number of elements in <em>list</em></dd></dl> -<b>Example:</b> <div class="fragment"><pre class="fragment"><a class="code" href="structmap__root.html">MAP</a> arglist ; +<b>Example:</b> <div class="fragment"><pre class="fragment"><a class="code" href="group__maps.html#ga1">MAP</a> arglist ; <span class="keywordtype">int</span> inst_do_execve (<span class="keywordtype">char</span> * filename, <span class="keywordtype">char</span> __user *__user *argv, <span class="keywordtype">char</span> __user *__user *envp, <span class="keyword">struct</span> pt_regs * regs) { - <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> *ptr; + <span class="keyword">struct </span>map_node_str *ptr; <a class="code" href="group__lists.html#ga1">_stp_list_clear</a> (arglist); - <a class="code" href="group__copy.html#ga2">_stp_copy_argv_from_user</a> (arglist, argv); + <a class="code" href="group__copy.html#ga3">_stp_copy_argv_from_user</a> (arglist, argv); - <a class="code" href="group__maps.html#ga31">foreach</a> (arglist, ptr) + <a class="code" href="group__maps.html#ga32">foreach</a> (arglist, ptr) printk ("%s ", ptr->str); printk ("\n"); } </pre></div> <p> -Definition at line <a class="el" href="copy_8c-source.html#l00130">130</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. +Definition at line <a class="el" href="copy_8c-source.html#l00154">154</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>, <a class="el" href="copy_8c-source.html#l00094">_stp_strncpy_from_user()</a>, and <a class="el" href="map_8h-source.html#l00075">map_root::num</a>. </td> +References <a class="el" href="map_8c-source.html#l00872">_stp_list_add_str()</a>, and <a class="el" href="copy_8c-source.html#l00096">_stp_strncpy_from_user()</a>. </td> </tr> </table> -<a class="anchor" name="ga1" doxytag="copy.c::_stp_copy_from_user"></a><p> +<a class="anchor" name="ga2" doxytag="copy.c::_stp_copy_from_user"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -112,7 +115,7 @@ References <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a <tr> <td class="md"></td> <td class="md">) </td> - <td class="md" colspan="2"><code> [inline]</code></td> + <td class="md" colspan="2"></td> </tr> </table> </td> @@ -139,7 +142,63 @@ If some data could not be copied, this function will pad the copied data to the <dl compact><dt><b>Returns:</b></dt><dd>number of bytes that could not be copied. On success, this will be zero. </dd></dl> <p> -Definition at line <a class="el" href="copy_8c-source.html#l00115">115</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. </td> +Definition at line <a class="el" href="copy_8c-source.html#l00139">139</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga1" doxytag="copy.c::_stp_string_from_user"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_string_from_user </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>const char __user * </td> + <td class="mdname" nowrap> <em>src</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>count</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Copy a String from userspace. +<p> +Copies a string of up to <em>count</em> bytes from userspace into a String. If access to userspace fails, returns -EFAULT (some data may have been copied). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>Destination String. </td></tr> + <tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>Source address, in user space. </td></tr> + <tr><td valign="top"></td><td valign="top"><em>count</em> </td><td>Maximum number of bytes to copy, including the trailing NULL. </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="copy_8c-source.html#l00113">113</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. +<p> +References <a class="el" href="string_8c-source.html#l00020">STP_STRING_SIZE</a>. </td> </tr> </table> <a class="anchor" name="ga0" doxytag="copy.c::_stp_strncpy_from_user"></a><p> @@ -192,11 +251,13 @@ If access to userspace fails, returns -EFAULT (some data may have been copied). <tr><td valign="top"></td><td valign="top"><em>count</em> </td><td>Maximum number of bytes to copy, including the trailing NULL.</td></tr> </table> </dl> -If <em>count</em> is smaller than the length of the string, copies <em>count</em> bytes and returns <em>count</em>. +If <em>count</em> is smaller than the length of the string, copies <em>count</em> bytes and returns <em>count</em>. <p> +<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>I can't think of why you wouldn't use <a class="el" href="group__copy.html#ga1">_stp_string_from_user()</a> instead. </dd></dl> + <p> -Definition at line <a class="el" href="copy_8c-source.html#l00094">94</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. +Definition at line <a class="el" href="copy_8c-source.html#l00096">96</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. <p> -Referenced by <a class="el" href="copy_8c-source.html#l00130">_stp_copy_argv_from_user()</a>. </td> +Referenced by <a class="el" href="copy_8c-source.html#l00154">_stp_copy_argv_from_user()</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/group__current.html b/runtime/docs/html/group__current.html index 91973e06..03008852 100644 --- a/runtime/docs/html/group__current.html +++ b/runtime/docs/html/group__current.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Current State</h1>Functions to get the current state. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> diff --git a/runtime/docs/html/group__io.html b/runtime/docs/html/group__io.html index 357e250b..76051d30 100644 --- a/runtime/docs/html/group__io.html +++ b/runtime/docs/html/group__io.html @@ -4,32 +4,37 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>I/O</h1>I/O functions. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="io::STP_LOG_BUF_LEN"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga9">STP_LOG_BUF_LEN</a> 2047</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">private buffer for <a class="el" href="group__io.html#ga2">_stp_log()</a> <br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga0">dlog</a> (const char *fmt,...)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga2">_stp_log</a> (const char *fmt,...)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Logs Data. <a href="#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga1">_stp_print</a> (const char *fmt,...)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Logs Data. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga7">_stp_netlink_open</a> (void)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Prints to the trace buffer. <a href="#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga2">_stp_print_str</a> (char *str)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens netlink and relayfs connections to stpd. <a href="#ga7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga8">_stp_netlink_close</a> (void)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Prints to the trace buffer. <a href="#ga2"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Closes netlink and relayfs connections to stpd. <a href="#ga8"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> I/O functions. <p> <hr><h2>Function Documentation</h2> -<a class="anchor" name="ga1" doxytag="io.c::_stp_print"></a><p> +<a class="anchor" name="ga2" doxytag="io.c::_stp_log"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">void _stp_print </td> + <td class="md" nowrap valign="top">void _stp_log </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>fmt</em>, </td> @@ -57,33 +62,34 @@ I/O functions. <td> <p> -Prints to the trace buffer. +Logs Data. <p> -This function uses the same formatting as printk. It currently writes to the system log.<p> -<dl compact><dt><b>Parameters:</b></dt><dd> +This function prints to the system log if stpd has not connected yet. Otherwise it sends the message immediately to stpd. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>A variable number of args. </td></tr> </table> </dl> -<p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>Needs replaced with something much faster that does not use the system log. </dd></dl> +<dl compact><dt><b>Note:</b></dt><dd>Lines are limited in length by printk buffer. If there is no newline in the format string, then other syslog output could get appended to the SystemTap line. </dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>Evaluate if this function is necessary. </dd></dl> <p> -Definition at line <a class="el" href="io_8c-source.html#l00043">43</a> of file <a class="el" href="io_8c-source.html">io.c</a>. +Definition at line <a class="el" href="io_8c-source.html#l00029">29</a> of file <a class="el" href="io_8c-source.html">io.c</a>. +<p> +References <a class="el" href="io_8c-source.html#l00016">STP_LOG_BUF_LEN</a>. <p> -Referenced by <a class="el" href="sym_8c-source.html#l00059">_stp_symbol_print()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00831">_stp_list_clear()</a>, <a class="el" href="probes_8c-source.html#l00034">_stp_register_jprobes()</a>, <a class="el" href="probes_8c-source.html#l00079">_stp_register_kprobes()</a>, <a class="el" href="stack_8c-source.html#l00171">_stp_stack_sprint()</a>, <a class="el" href="string_8c-source.html#l00042">_stp_string_init()</a>, <a class="el" href="probes_8c-source.html#l00020">_stp_unregister_jprobes()</a>, and <a class="el" href="probes_8c-source.html#l00065">_stp_unregister_kprobes()</a>. </td> </tr> </table> -<a class="anchor" name="ga2" doxytag="io.c::_stp_print_str"></a><p> +<a class="anchor" name="ga8" doxytag="io.c::_stp_netlink_close"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">void _stp_print_str </td> + <td class="md" nowrap valign="top">void _stp_netlink_close </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">char * </td> - <td class="mdname1" valign="top" nowrap> <em>str</em> </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> @@ -99,42 +105,26 @@ Referenced by <a class="el" href="sym_8c-source.html#l00059">_stp_symbol_print() <td> <p> -Prints to the trace buffer. -<p> -This function will write a string to the trace buffer. It currently writes to the system log.<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String. </td></tr> - </table> -</dl> +Closes netlink and relayfs connections to stpd. <p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000005">Todo:</a></b></dt><dd>Needs replaced with something much faster that does not use the system log. </dd></dl> +This must be called after all I/O is done, probably at the end of module cleanup. <dl compact><dt><b>Returns:</b></dt><dd>0 on success. -1 if there is a problem establishing a connection. </dd></dl> <p> -Definition at line <a class="el" href="io_8c-source.html#l00060">60</a> of file <a class="el" href="io_8c-source.html">io.c</a>. </td> +Definition at line <a class="el" href="io_8c-source.html#l00103">103</a> of file <a class="el" href="io_8c-source.html">io.c</a>. </td> </tr> </table> -<a class="anchor" name="ga0" doxytag="io.c::dlog"></a><p> +<a class="anchor" name="ga7" doxytag="io.c::_stp_netlink_open"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">void dlog </td> + <td class="md" nowrap valign="top">int _stp_netlink_open </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">const char * </td> - <td class="mdname" nowrap> <em>fmt</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap> </td> - <td class="mdname" nowrap> <em>...</em></td> - </tr> - <tr> - <td class="md"></td> - <td class="md">) </td> - <td class="md" colspan="2"></td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> </tr> </table> </td> @@ -148,23 +138,11 @@ Definition at line <a class="el" href="io_8c-source.html#l00060">60</a> of file <td> <p> -Logs Data. -<p> -This function is compatible with printk. In fact it currently sends all output to vprintk, after sending "STP: ". This allows us to easily detect SystemTap output in the log file.<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>A variable number of args. </td></tr> - </table> -</dl> -<p> -<dl compact><dt><b><a class="el" href="bug.html#_bug000003">Bug:</a></b></dt><dd>Lines are limited in length by printk buffer. If there is no newline in the format string, then other syslog output could get appended to the SystemTap line.</dd></dl> -<p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>Either deprecate or redefine this as a way to log debug or status messages, separate from the normal program output. </dd></dl> - +Opens netlink and relayfs connections to stpd. <p> -Definition at line <a class="el" href="io_8c-source.html#l00025">25</a> of file <a class="el" href="io_8c-source.html">io.c</a>. +This must be called before any I/O is done, probably at the start of module initialization. <p> -Referenced by <a class="el" href="map_8c-source.html#l00813">_stp_list_clear()</a>, <a class="el" href="probes_8c-source.html#l00032">_stp_register_jprobes()</a>, <a class="el" href="probes_8c-source.html#l00077">_stp_register_kprobes()</a>, <a class="el" href="probes_8c-source.html#l00018">_stp_unregister_jprobes()</a>, and <a class="el" href="probes_8c-source.html#l00063">_stp_unregister_kprobes()</a>. </td> +Definition at line <a class="el" href="io_8c-source.html#l00087">87</a> of file <a class="el" href="io_8c-source.html">io.c</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/group__list.html b/runtime/docs/html/group__list.html deleted file mode 100644 index 3e9f1eb0..00000000 --- a/runtime/docs/html/group__list.html +++ /dev/null @@ -1,58 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: List</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>List</h1><table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Defines</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list.html#ga0">_stp_list_add</a>(map, val)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_list_add function based on the types of the argument. <a href="#ga0"></a><br></td></tr> -</table> -<hr><h2>Define Documentation</h2> -<a class="anchor" name="ga0" doxytag="map.h::_stp_list_add"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">#define _stp_list_add </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">map, <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>val </td> - <td class="mdname1" valign="top" nowrap> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -<b>Value:</b><div class="fragment"><pre class="fragment">({ \ - <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ - <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="group__lists.html#ga3">_stp_list_add_int64</a> (map, (int64_t)(val)); \ - }) -</pre></div>Macro to call the proper _stp_list_add function based on the types of the argument. -<p> -<dl compact><dt><b>Note:</b></dt><dd>May cause compiler warning on some GCCs </dd></dl> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00164">164</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -</body></html> diff --git a/runtime/docs/html/group__lists.html b/runtime/docs/html/group__lists.html index 49550e5c..30b83a00 100644 --- a/runtime/docs/html/group__lists.html +++ b/runtime/docs/html/group__lists.html @@ -4,50 +4,53 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Lists</h1>Lists are special cases of maps. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga5">_stp_list_add</a>(map, val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga6">_stp_list_add</a>(map, val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_list_add function based on the types of the argument. <a href="#ga5"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_list_add function based on the types of the argument. <a href="#ga6"></a><br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga0">_stp_list_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga33">valtype</a> type)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga0">_stp_list_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga34">valtype</a> type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new list. <a href="#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga1">_stp_list_clear</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga1">_stp_list_clear</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clears a list. <a href="#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga2">_stp_list_add_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga2">_stp_list_add_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *str)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a string to a list. <a href="#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga3">_stp_list_add_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a C string to a list. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga3">_stp_list_add_string</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, String str)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to a list. <a href="#ga3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga4">_stp_list_size</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a String to a list. <a href="#ga3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga4">_stp_list_add_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of elements in a list. <a href="#ga4"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to a list. <a href="#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga5">_stp_list_size</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of elements in a list. <a href="#ga5"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Lists are special cases of maps. <p> <b>Example:</b> <div class="fragment"><pre class="fragment"> -<span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> *ptr; +<span class="keyword">struct </span>map_node_str *ptr; -<a class="code" href="structmap__root.html">MAP</a> map = <a class="code" href="group__lists.html#ga0">_stp_list_new</a>(10, STRING); +<a class="code" href="group__maps.html#ga1">MAP</a> map = <a class="code" href="group__lists.html#ga0">_stp_list_new</a>(10, STRING); <span class="keywordflow">for</span> (i = 0; i < 10; i++) { sprintf (buf, <span class="stringliteral">"Item%d"</span>, i); - <a class="code" href="group__lists.html#ga5">_stp_list_add</a> (map, buf); + <a class="code" href="group__lists.html#ga6">_stp_list_add</a> (map, buf); } -<a class="code" href="group__maps.html#ga31">foreach</a> (map, ptr) +<a class="code" href="group__maps.html#ga32">foreach</a> (map, ptr) printf ("map[%ld] = %s\n", key1int(ptr), ptr->str); </pre></div> <hr><h2>Define Documentation</h2> -<a class="anchor" name="ga5" doxytag="map.h::_stp_list_add"></a><p> +<a class="anchor" name="ga6" doxytag="map.h::_stp_list_add"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -75,22 +78,24 @@ Lists are special cases of maps. <td> <p> -<b>Value:</b><div class="fragment"><pre class="fragment">({ \ - <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="group__lists.html#ga3">_stp_list_add_int64</a> (map, (int64_t)(val)); \ + <span class="keywordflow">else</span> <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), String)) \ + <a class="code" href="group__lists.html#ga3">_stp_list_add_string</a> (map, (String)(val)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__lists.html#ga4">_stp_list_add_int64</a> (map, (int64_t)(val)); \ }) </pre></div>Macro to call the proper _stp_list_add function based on the types of the argument. <p> <dl compact><dt><b>Note:</b></dt><dd>May cause compiler warning on some GCCs </dd></dl> <p> -Definition at line <a class="el" href="map_8h-source.html#l00181">181</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> +Definition at line <a class="el" href="map_8h-source.html#l00183">183</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> </tr> </table> <hr><h2>Function Documentation</h2> -<a class="anchor" name="ga3" doxytag="map.c::_stp_list_add_int64"></a><p> +<a class="anchor" name="ga4" doxytag="map.c::_stp_list_add_int64"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -98,7 +103,7 @@ Definition at line <a class="el" href="map_8h-source.html#l00181">181</a> of fil <tr> <td class="md" nowrap valign="top">void _stp_list_add_int64 </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -132,11 +137,12 @@ Adds an int64 to a list. <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td></td></tr> </table> </dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__lists.html#ga6">_stp_list_add()</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00864">864</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00896">896</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>, <a class="el" href="map_8c-source.html#l00541">_stp_map_set_int64()</a>, and <a class="el" href="map_8h-source.html#l00075">map_root::num</a>. </td> +References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>, and <a class="el" href="map_8c-source.html#l00542">_stp_map_set_int64()</a>. </td> </tr> </table> <a class="anchor" name="ga2" doxytag="map.c::_stp_list_add_str"></a><p> @@ -147,7 +153,7 @@ References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a <tr> <td class="md" nowrap valign="top">void _stp_list_add_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -173,7 +179,7 @@ References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a <td> <p> -Adds a string to a list. +Adds a C string to a list. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> @@ -181,13 +187,64 @@ Adds a string to a list. <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td></td></tr> </table> </dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__lists.html#ga6">_stp_list_add()</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00853">853</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00872">872</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>, <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>, and <a class="el" href="map_8h-source.html#l00075">map_root::num</a>. +References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. <p> -Referenced by <a class="el" href="copy_8c-source.html#l00130">_stp_copy_argv_from_user()</a>. </td> +Referenced by <a class="el" href="copy_8c-source.html#l00154">_stp_copy_argv_from_user()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga3" doxytag="map.c::_stp_list_add_string"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_list_add_string </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>String </td> + <td class="mdname" nowrap> <em>str</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Adds a String to a list. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String to add. </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__lists.html#ga6">_stp_list_add()</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00884">884</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga1" doxytag="map.c::_stp_list_clear"></a><p> @@ -198,7 +255,7 @@ Referenced by <a class="el" href="copy_8c-source.html#l00130">_stp_copy_argv_fro <tr> <td class="md" nowrap valign="top">void _stp_list_clear </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -224,9 +281,9 @@ All elements in the list are deleted. <dl compact><dt><b>Parameters:</b></dt><dd </dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00813">813</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00831">831</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a class="el" href="io_8c-source.html#l00025">dlog()</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00075">map_root::num</a>, and <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>. </td> +References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, and <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>. </td> </tr> </table> <a class="anchor" name="ga0" doxytag="map.c::_stp_list_new"></a><p> @@ -235,7 +292,7 @@ References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> _stp_list_new </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> _stp_list_new </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname" nowrap> <em>max_entries</em>, </td> @@ -243,7 +300,7 @@ References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> - <td class="md" nowrap>enum <a class="el" href="group__maps.html#ga33">valtype</a> </td> + <td class="md" nowrap>enum <a class="el" href="group__maps.html#ga34">valtype</a> </td> <td class="mdname" nowrap> <em>type</em></td> </tr> <tr> @@ -272,15 +329,15 @@ A list is a map that internally has an incrementing long key for each member. Li </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>A MAP on success or NULL on failure. </dd></dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">foreach</a> </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga32">foreach</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00801">801</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00819">819</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00057">_stp_map_new()</a>, and <a class="el" href="map_8h-source.html#l00078">map_root::no_wrap</a>. </td> +References <a class="el" href="map_8c-source.html#l00057">_stp_map_new()</a>. </td> </tr> </table> -<a class="anchor" name="ga4" doxytag="map.c::_stp_list_size"></a><p> +<a class="anchor" name="ga5" doxytag="map.c::_stp_list_size"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -288,7 +345,7 @@ References <a class="el" href="map_8c-source.html#l00057">_stp_map_new()</a>, an <tr> <td class="md" nowrap valign="top">int _stp_list_size </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> @@ -315,9 +372,7 @@ Get the number of elements in a list. <dl compact><dt><b>Returns:</b></dt><dd>The number of elements in a list. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00875">875</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00075">map_root::num</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00907">907</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/group__maps.html b/runtime/docs/html/group__maps.html index 1da96a51..1b6e170e 100644 --- a/runtime/docs/html/group__maps.html +++ b/runtime/docs/html/group__maps.html @@ -4,74 +4,67 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Maps</h1>Implements maps (associative arrays) and lists. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structstat.html">stat</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>stat</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Statistics are stored in this struct. <a href="structstat.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">union </td><td class="memItemRight" valign="bottom"><a class="el" href="unionkey__data.html">key_data</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">union </td><td class="memItemRight" valign="bottom"><b>key_data</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Keys are either longs or char *. <a href="unionkey__data.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node.html">map_node</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>map_node</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">basic map element <a href="structmap__node.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__int64.html">map_node_int64</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>map_node_int64</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing int64 <a href="structmap__node__int64.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__str.html">map_node_str</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>map_node_str</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing string <a href="structmap__node__str.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__stat.html">map_node_stat</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>map_node_stat</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing stats <a href="structmap__node__stat.html#_details">More...</a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html">map_root</a></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>map_root</b></td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">This structure contains all information about a map. <a href="structmap__root.html#_details">More...</a><br></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="maps::key1str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga24">key1str</a>(ptr) (ptr->n.key1.str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="maps::key1str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga25">key1str</a>(ptr) (ptr->n.key1.str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key1 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="maps::key2str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga25">key2str</a>(ptr) (ptr->n.key2.str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="maps::key2str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga26">key2str</a>(ptr) (ptr->n.key2.str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key2 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="maps::key1int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga26">key1int</a>(ptr) (ptr->n.key1.val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="maps::key1int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga27">key1int</a>(ptr) (ptr->n.key1.val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key1 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="maps::key2int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga27">key2int</a>(ptr) (ptr->n.key2.val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="maps::key2int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga28">key2int</a>(ptr) (ptr->n.key2.val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key2 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga28">_stp_map_key2</a>(map, key1, key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga29">_stp_map_key2</a>(map, key1, key2)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key functions based on the types of the arguments. <a href="#ga28"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga29">_stp_map_key</a>(map, key)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key functions based on the types of the arguments. <a href="#ga29"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga30">_stp_map_key</a>(map, key)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key function based on the type of the argument. <a href="#ga29"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga30">_stp_map_set</a>(map, val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key function based on the type of the argument. <a href="#ga30"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga31">_stp_map_set</a>(map, val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_set function based on the type of the argument. <a href="#ga30"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga31">foreach</a>(map, ptr)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_set function based on the type of the argument. <a href="#ga31"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga32">foreach</a>(map, ptr)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Loop through all elements of a map or list. <a href="#ga31"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Loop through all elements of a map or list. <a href="#ga32"></a><br></td></tr> <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="maps::MAP"></a> -typedef <a class="el" href="structmap__root.html">map_root</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga1">MAP</a></td></tr> +typedef map_root * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga1">MAP</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">All maps are of this type. <br></td></tr> <tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga32">keytype</a> { <b>NONE</b>, +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga33">keytype</a> { <b>NONE</b>, <b>LONG</b>, <b>STR</b> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga33">valtype</a> { <b>INT64</b>, +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga34">valtype</a> { <b>INT64</b>, <b>STAT</b>, <b>STRING</b>, <b>END</b> @@ -79,74 +72,78 @@ typedef <a class="el" href="structmap__root.html">map_root</a> * </td><td c <tr><td class="mdescLeft"> </td><td class="mdescRight">values can be either int64, stats or strings <br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga2">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga33">valtype</a> type)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga2">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga34">valtype</a> type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new map. <a href="#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga4">_stp_map_key_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga4">_stp_map_key_del</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes the current element. <a href="#ga4"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga5">_stp_map_start</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">map_node * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga5">_stp_map_start</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the first element in a map. <a href="#ga5"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga6">_stp_map_iter</a> (<a class="el" href="structmap__root.html">MAP</a> map, struct <a class="el" href="structmap__node.html">map_node</a> *m)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">map_node * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga6">_stp_map_iter</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, struct map_node *m)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next element in a map. <a href="#ga6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga7">_stp_map_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga7">_stp_map_del</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a map. <a href="#ga7"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga8">_stp_map_key_long_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, long key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga8">_stp_map_key_long_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key1, long key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two longs. <a href="#ga8"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga9">_stp_map_key_str_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, char *key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga9">_stp_map_key_str_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key1, char *key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two strings. <a href="#ga9"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga10">_stp_map_key_str_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, long key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga10">_stp_map_key_str_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key1, long key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string and a long. <a href="#ga10"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga11">_stp_map_key_long_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, char *key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga11">_stp_map_key_long_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key1, char *key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long and a string. <a href="#ga11"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga12">_stp_map_key_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga12">_stp_map_key_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string. <a href="#ga12"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga13">_stp_map_key_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga13">_stp_map_key_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long. <a href="#ga13"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to an int64. <a href="#ga16"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to the current element's value. <a href="#ga17"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga18">_stp_map_get_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga18">_stp_map_get_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga18"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga19">_stp_map_set_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga19">_stp_map_set_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a string. <a href="#ga19"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga20">_stp_map_get_str</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a C string. <a href="#ga19"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga20">_stp_map_set_string</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, String str)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga20"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga21">_stp_map_set_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map, <a class="el" href="structstat.html">stat</a> *stats)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to String. <a href="#ga20"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga21">_stp_map_get_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="#ga21"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstat.html">stat</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga22">_stp_map_get_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga21"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga22">_stp_map_set_stat</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, stat *stats)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga22"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="#ga22"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">stat * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga23">_stp_map_get_stat</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Add to the current element's statistics. <a href="#ga23"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga23"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga24">_stp_map_stat_add</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add to the current element's statistics. <a href="#ga24"></a><br></td></tr> <tr><td colspan="2"><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="maps::packed"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga0">packed</a></td></tr> +enum <a class="el" href="group__maps.html#ga33">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga0">packed</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Implements maps (associative arrays) and lists. <p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000006">Todo:</a></b></dt><dd>Needs to be made SMP-safe for when the big lock is removed from kprobes.</dd></dl> <hr><h2>Define Documentation</h2> -<a class="anchor" name="ga29" doxytag="map.h::_stp_map_key"></a><p> +<a class="anchor" name="ga30" doxytag="map.h::_stp_map_key"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -188,7 +185,7 @@ Implements maps (associative arrays) and lists. Definition at line <a class="el" href="map_8h-source.html#l00141">141</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> </tr> </table> -<a class="anchor" name="ga28" doxytag="map.h::_stp_map_key2"></a><p> +<a class="anchor" name="ga29" doxytag="map.h::_stp_map_key2"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -239,7 +236,7 @@ Definition at line <a class="el" href="map_8h-source.html#l00141">141</a> of fil Definition at line <a class="el" href="map_8h-source.html#l00123">123</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> </tr> </table> -<a class="anchor" name="ga30" doxytag="map.h::_stp_map_set"></a><p> +<a class="anchor" name="ga31" doxytag="map.h::_stp_map_set"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -268,10 +265,12 @@ Definition at line <a class="el" href="map_8h-source.html#l00123">123</a> of fil <p> <b>Value:</b><div class="fragment"><pre class="fragment">({ \ - <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a> (map, (int64_t)(val)); \ + <span class="keywordflow">else</span> <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), String)) \ + <a class="code" href="group__maps.html#ga20">_stp_map_set_string</a> (map, (String)(val)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a> (map, (int64_t)(val)); \ }) </pre></div>Macro to call the proper _stp_map_set function based on the type of the argument. <p> @@ -281,7 +280,7 @@ Definition at line <a class="el" href="map_8h-source.html#l00123">123</a> of fil Definition at line <a class="el" href="map_8h-source.html#l00153">153</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> </tr> </table> -<a class="anchor" name="ga31" doxytag="map.h::foreach"></a><p> +<a class="anchor" name="ga32" doxytag="map.h::foreach"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -310,27 +309,27 @@ Definition at line <a class="el" href="map_8h-source.html#l00153">153</a> of fil <p> <b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">for</span> (ptr = (typeof(ptr))<a class="code" href="group__maps.html#ga5">_stp_map_start</a>(map); ptr; \ - ptr = (typeof(ptr))_stp_map_iter (map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)ptr)) + ptr = (typeof(ptr))_stp_map_iter (map, (<span class="keyword">struct</span> map_node *)ptr)) </pre></div>Loop through all elements of a map or list. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to a <a class="el" href="structmap__node__stat.html">map_node_stat</a>, <a class="el" href="structmap__node__int64.html">map_node_int64</a> or <a class="el" href="structmap__node__str.html">map_node_str</a></td></tr> + <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to a map_node_stat, map_node_int64 or map_node_str</td></tr> </table> </dl> <b>Example:</b> <div class="fragment"><pre class="fragment"><span class="comment">/* example showing how to print all the stats in a map using foreach() */</span> -<span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> *ptr; +<span class="keyword">struct </span>map_node_stat *ptr; -<a class="code" href="group__maps.html#ga31">foreach</a> (map, ptr) +<a class="code" href="group__maps.html#ga32">foreach</a> (map, ptr) printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, ptr->stats.max); </pre></div> <p> -Definition at line <a class="el" href="map_8h-source.html#l00169">169</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> +Definition at line <a class="el" href="map_8h-source.html#l00171">171</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> </tr> </table> <hr><h2>Function Documentation</h2> @@ -342,7 +341,7 @@ Definition at line <a class="el" href="map_8h-source.html#l00169">169</a> of fil <tr> <td class="md" nowrap valign="top">void _stp_map_add_int64 </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -380,7 +379,7 @@ If the element doesn't exist, it is created. If no current element (key) is set <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00558">558</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00559">559</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> <a class="anchor" name="ga7" doxytag="map.c::_stp_map_del"></a><p> @@ -391,7 +390,7 @@ Definition at line <a class="el" href="map_8c-source.html#l00558">558</a> of fil <tr> <td class="md" nowrap valign="top">void _stp_map_del </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -419,7 +418,7 @@ Deletes a map, freeing all memory in all elements. Normally done only when the m <p> Definition at line <a class="el" href="map_8c-source.html#l00205">205</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00086">_stp_vfree()</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, and <a class="el" href="map_8h-source.html#l00104">map_root::membuf</a>. </td> +References <a class="el" href="alloc_8c-source.html#l00086">_stp_vfree()</a>. </td> </tr> </table> <a class="anchor" name="ga18" doxytag="map.c::_stp_map_get_int64"></a><p> @@ -430,7 +429,7 @@ References <a class="el" href="alloc_8c-source.html#l00086">_stp_vfree()</a>, <a <tr> <td class="md" nowrap valign="top">int64_t _stp_map_get_int64 </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -457,20 +456,18 @@ Gets the current element's value. <dl compact><dt><b>Returns:</b></dt><dd>The value. If the current element is not set or doesn't exist, returns 0. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00568">568</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00049">map_node_int64::val</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00569">569</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> -<a class="anchor" name="ga22" doxytag="map.c::_stp_map_get_stat"></a><p> +<a class="anchor" name="ga23" doxytag="map.c::_stp_map_get_stat"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top"><a class="el" href="structstat.html">stat</a>* _stp_map_get_stat </td> + <td class="md" nowrap valign="top">stat* _stp_map_get_stat </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -497,12 +494,10 @@ Gets the current element's value. <dl compact><dt><b>Returns:</b></dt><dd>A pointer to the stats struct. If the current element is not set or doesn't exist, returns NULL. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00732">732</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00750">750</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> -<a class="anchor" name="ga20" doxytag="map.c::_stp_map_get_str"></a><p> +<a class="anchor" name="ga21" doxytag="map.c::_stp_map_get_str"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -510,7 +505,7 @@ References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <tr> <td class="md" nowrap valign="top">char* _stp_map_get_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -537,9 +532,7 @@ Gets the current element's value. <dl compact><dt><b>Returns:</b></dt><dd>A string pointer. If the current element is not set or doesn't exist, returns NULL. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00649">649</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_str::str</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00667">667</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> <a class="anchor" name="ga6" doxytag="map.c::_stp_map_iter"></a><p> @@ -548,15 +541,15 @@ References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">struct <a class="el" href="structmap__node.html">map_node</a>* _stp_map_iter </td> + <td class="md" nowrap valign="top">struct map_node* _stp_map_iter </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> - <td class="md" nowrap>struct <a class="el" href="structmap__node.html">map_node</a> * </td> + <td class="md" nowrap>struct map_node * </td> <td class="mdname" nowrap> <em>m</em></td> </tr> <tr> @@ -584,13 +577,11 @@ Get the next element in a map. <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td>a pointer to the current element, returned from <a class="el" href="group__maps.html#ga5">_stp_map_start()</a> or <a class="el" href="group__maps.html#ga6">_stp_map_iter()</a>. </td></tr> </table> </dl> -<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the next element. This is typically used with <a class="el" href="group__maps.html#ga5">_stp_map_start()</a>. See the <a class="el" href="group__maps.html#ga31">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">foreach</a> </dd></dl> +<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the next element. This is typically used with <a class="el" href="group__maps.html#ga5">_stp_map_start()</a>. See the <a class="el" href="group__maps.html#ga32">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga32">foreach</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00186">186</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, and <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00186">186</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> <a class="anchor" name="ga4" doxytag="map.c::_stp_map_key_del"></a><p> @@ -601,7 +592,7 @@ References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, an <tr> <td class="md" nowrap valign="top">void _stp_map_key_del </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -629,9 +620,9 @@ If no current element (key) for this map is set, this function does nothing. <dl <p> Definition at line <a class="el" href="map_8c-source.html#l00118">118</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, and <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>. +References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00691">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga13" doxytag="map.c::_stp_map_key_long"></a><p> @@ -642,7 +633,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat() <tr> <td class="md" nowrap valign="top">void _stp_map_key_long </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -680,9 +671,9 @@ This sets the current element based on a long key. If the key is not found, a ne <p> Definition at line <a class="el" href="map_8c-source.html#l00430">430</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00233">_stp_map_key_long_long()</a>, and <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>. +References <a class="el" href="map_8c-source.html#l00233">_stp_map_key_long_long()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64()</a>, and <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00896">_stp_list_add_int64()</a>, <a class="el" href="map_8c-source.html#l00872">_stp_list_add_str()</a>, and <a class="el" href="map_8c-source.html#l00884">_stp_list_add_string()</a>. </td> </tr> </table> <a class="anchor" name="ga8" doxytag="map.c::_stp_map_key_long_long"></a><p> @@ -693,7 +684,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64 <tr> <td class="md" nowrap valign="top">void _stp_map_key_long_long </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -738,8 +729,6 @@ This sets the current element based on a key of two strings. If the keys are not <p> Definition at line <a class="el" href="map_8c-source.html#l00233">233</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. -<p> Referenced by <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>. </td> </tr> </table> @@ -751,7 +740,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long() <tr> <td class="md" nowrap valign="top">void _stp_map_key_long_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -794,9 +783,7 @@ This sets the current element based on a key of a long and a string. If the keys </dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00373">373</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00025">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00373">373</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> <a class="anchor" name="ga12" doxytag="map.c::_stp_map_key_str"></a><p> @@ -807,7 +794,7 @@ References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <tr> <td class="md" nowrap valign="top">void _stp_map_key_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -845,7 +832,7 @@ This sets the current element based on a string key. If the key is not found, a <p> Definition at line <a class="el" href="map_8c-source.html#l00414">414</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00276">_stp_map_key_str_str()</a>, and <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>. </td> +References <a class="el" href="map_8c-source.html#l00276">_stp_map_key_str_str()</a>. </td> </tr> </table> <a class="anchor" name="ga10" doxytag="map.c::_stp_map_key_str_long"></a><p> @@ -856,7 +843,7 @@ References <a class="el" href="map_8c-source.html#l00276">_stp_map_key_str_str() <tr> <td class="md" nowrap valign="top">void _stp_map_key_str_long </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -899,9 +886,7 @@ This sets the current element based on a key of a string and a long. If the keys </dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00325">325</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00025">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00325">325</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> <a class="anchor" name="ga9" doxytag="map.c::_stp_map_key_str_str"></a><p> @@ -912,7 +897,7 @@ References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <tr> <td class="md" nowrap valign="top">void _stp_map_key_str_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -957,8 +942,6 @@ This sets the current element based on a key of two strings. If the keys are not <p> Definition at line <a class="el" href="map_8c-source.html#l00276">276</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, and <a class="el" href="map_8h-source.html#l00025">key_data::str</a>. -<p> Referenced by <a class="el" href="map_8c-source.html#l00414">_stp_map_key_str()</a>. </td> </tr> </table> @@ -968,7 +951,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00414">_stp_map_key_str()< <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> _stp_map_new </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> _stp_map_new </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname" nowrap> <em>max_entries</em>, </td> @@ -976,7 +959,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00414">_stp_map_key_str()< <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> - <td class="md" nowrap>enum <a class="el" href="group__maps.html#ga33">valtype</a> </td> + <td class="md" nowrap>enum <a class="el" href="group__maps.html#ga34">valtype</a> </td> <td class="mdname" nowrap> <em>type</em></td> </tr> <tr> @@ -1009,9 +992,9 @@ Maps must be created at module initialization time. <dl compact><dt><b>Parameter <p> Definition at line <a class="el" href="map_8c-source.html#l00057">57</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00062">_stp_valloc()</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00104">map_root::membuf</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00069">map_root::type</a>. +References <a class="el" href="alloc_8c-source.html#l00062">_stp_valloc()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00801">_stp_list_new()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00819">_stp_list_new()</a>. </td> </tr> </table> <a class="anchor" name="ga16" doxytag="map.c::_stp_map_set_int64"></a><p> @@ -1022,7 +1005,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00801">_stp_list_new()</a> <tr> <td class="md" nowrap valign="top">void _stp_map_set_int64 </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -1057,15 +1040,16 @@ If the element doesn't exist, it is created. If no current element (key) is set <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>new value </td></tr> </table> </dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> <p> +<a class="el" href="group__maps.html#ga31">_stp_map_set()</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00541">541</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00542">542</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00896">_stp_list_add_int64()</a>. </td> </tr> </table> -<a class="anchor" name="ga21" doxytag="map.c::_stp_map_set_stat"></a><p> +<a class="anchor" name="ga22" doxytag="map.c::_stp_map_set_stat"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -1073,13 +1057,13 @@ Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64 <tr> <td class="md" nowrap valign="top">void _stp_map_set_stat </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> - <td class="md" nowrap><a class="el" href="structstat.html">stat</a> * </td> + <td class="md" nowrap>stat * </td> <td class="mdname" nowrap> <em>stats</em></td> </tr> <tr> @@ -1101,21 +1085,21 @@ Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64 <p> Set the current element's value to a stat. <p> -This sets the current element's value to an stat struct. The map must have been created to hold stats using <em>_stp_map_new(xxx, STAT)</em>. This function would only be used if we wanted to set stats to something other than the normal initial values (count = 0, sum = 0, etc). It may be deleted if it doesn't turn out to be useful. <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a></dd></dl> +This sets the current element's value to an stat struct. The map must have been created to hold stats using <em>_stp_map_new(xxx, STAT)</em>. This function would only be used if we wanted to set stats to something other than the normal initial values (count = 0, sum = 0, etc). It may be deleted if it doesn't turn out to be useful. <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga24">_stp_map_stat_add</a></dd></dl> If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> <tr><td valign="top"></td><td valign="top"><em>stats</em> </td><td>pointer to stats struct. </td></tr> </table> </dl> -<dl compact><dt><b><a class="el" href="todo.html#_todo000006">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00673">673</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00691">691</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00060">map_node_stat::n</a>, <a class="el" href="map_8h-source.html#l00078">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>. +References <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, and <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00771">_stp_map_stat_add()</a>. </td> </tr> </table> <a class="anchor" name="ga19" doxytag="map.c::_stp_map_set_str"></a><p> @@ -1126,7 +1110,7 @@ Referenced by <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add() <tr> <td class="md" nowrap valign="top">void _stp_map_set_str </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -1152,22 +1136,74 @@ Referenced by <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add() <td> <p> -Set the current element's value to a string. +Set the current element's value to a C string. <p> -This sets the current element's value to an string. The map must have been created to hold int64s using <em>_stp_map_new(xxx, STRING)</em><p> +This sets the current element's value to an C string. The map must have been created to hold int64s using <em>_stp_map_new(xxx, STRING)</em><p> If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>new string </td></tr> </table> </dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">_stp_map_set()</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00588">588</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00590">590</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="alloc_8c-source.html#l00031">_stp_alloc()</a>, <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00054">map_node_str::n</a>, <a class="el" href="map_8h-source.html#l00078">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_str::str</a>. +References <a class="el" href="alloc_8c-source.html#l00031">_stp_alloc()</a>, <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, and <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>. <p> -Referenced by <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00872">_stp_list_add_str()</a>, <a class="el" href="map_8c-source.html#l00884">_stp_list_add_string()</a>, and <a class="el" href="map_8c-source.html#l00657">_stp_map_set_string()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga20" doxytag="map.c::_stp_map_set_string"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_set_string </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>String </td> + <td class="mdname" nowrap> <em>str</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Set the current element's value to String. +<p> +This sets the current element's value to a String. The map must have been created to hold int64s using <em>_stp_map_new(xxx, STRING)</em><p> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String containing new value. </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">_stp_map_set()</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00657">657</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8c-source.html#l00590">_stp_map_set_str()</a>. </td> </tr> </table> <a class="anchor" name="ga5" doxytag="map.c::_stp_map_start"></a><p> @@ -1176,9 +1212,9 @@ Referenced by <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str() <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">struct <a class="el" href="structmap__node.html">map_node</a>* _stp_map_start </td> + <td class="md" nowrap valign="top">struct map_node* _stp_map_start </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname1" valign="top" nowrap> <em>map</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> @@ -1202,16 +1238,14 @@ Get the first element in a map. <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> </table> </dl> -<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the first element. This is typically used with <a class="el" href="group__maps.html#ga6">_stp_map_iter()</a>. See the <a class="el" href="group__maps.html#ga31">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">foreach</a> </dd></dl> +<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the first element. This is typically used with <a class="el" href="group__maps.html#ga6">_stp_map_iter()</a>. See the <a class="el" href="group__maps.html#ga32">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga32">foreach</a> </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00163">163</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>. </td> +Definition at line <a class="el" href="map_8c-source.html#l00163">163</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> </tr> </table> -<a class="anchor" name="ga23" doxytag="map.c::_stp_map_stat_add"></a><p> +<a class="anchor" name="ga24" doxytag="map.c::_stp_map_stat_add"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -1219,7 +1253,7 @@ References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>. <tr> <td class="md" nowrap valign="top">void _stp_map_stat_add </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="md" nowrap valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td> <td class="mdname" nowrap> <em>map</em>, </td> </tr> <tr> @@ -1254,12 +1288,12 @@ If the element doesn't exist, it is created. If no current element (key) is set <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>value to add to the statistics </td></tr> </table> </dl> -<dl compact><dt><b><a class="el" href="todo.html#_todo000007">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000005">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> <p> -Definition at line <a class="el" href="map_8c-source.html#l00753">753</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +Definition at line <a class="el" href="map_8c-source.html#l00771">771</a> of file <a class="el" href="map_8c-source.html">map.c</a>. <p> -References <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, <a class="el" href="map_8h-source.html#l00016">stat::count</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00018">stat::max</a>, <a class="el" href="map_8h-source.html#l00018">stat::min</a>, <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>, and <a class="el" href="map_8h-source.html#l00017">stat::sum</a>. </td> +References <a class="el" href="map_8c-source.html#l00691">_stp_map_set_stat()</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/group__print.html b/runtime/docs/html/group__print.html new file mode 100644 index 00000000..f18a05bf --- /dev/null +++ b/runtime/docs/html/group__print.html @@ -0,0 +1,342 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: Print Buffer</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>Print Buffer</h1>Print Buffer Functions. +<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="print::STP_PRINT_BUF_LEN"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> 8000</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Size of buffer, not including terminating NULL. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="print::TIMESTAMP_SIZE"></a> +#define </td><td class="memItemRight" valign="bottom"><b>TIMESTAMP_SIZE</b> 19</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="print::STP_PRINT_BUF_START"></a> +#define </td><td class="memItemRight" valign="bottom"><b>STP_PRINT_BUF_START</b> (TIMESTAMP_SIZE + 1)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga11">_stp_print</a>(str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a String or C string into the print buffer. <a href="#ga11"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga2">_stp_print_flush</a> (void)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Send the print buffer now. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga3">_stp_printf</a> (const char *fmt,...)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Print into the print buffer. <a href="#ga3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga4">_stp_vprintf</a> (const char *fmt, va_list args)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Print into the print buffer. <a href="#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga5">_stp_print_cstr</a> (const char *str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a C string into the print buffer. <a href="#ga5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga6">_stp_print_clear</a> (void)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear the scratch buffer. <a href="#ga6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__print.html#ga7">_stp_print_string</a> (String str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a String into the print buffer. <a href="#ga7"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Print Buffer Functions. +<p> +The print buffer is for collecting output to send to the user daemon. This is a per-cpu static buffer. The buffer is sent when <a class="el" href="group__print.html#ga2">_stp_print_flush()</a> is called.<p> +The reason to do this is to allow multiple small prints to be combined then timestamped and sent together to stpd. It could flush automatically on newlines, but what about stack traces which span many lines? So try this and see how it works for us. <hr><h2>Define Documentation</h2> +<a class="anchor" name="ga11" doxytag="print.c::_stp_print"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define _stp_print </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">str </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (str), <span class="keywordtype">char</span>[])) { \ + <span class="keywordtype">char</span> *x = (<span class="keywordtype">char</span> *)str; \ + <a class="code" href="group__print.html#ga5">_stp_print_cstr</a>(x); \ + } <span class="keywordflow">else</span> { \ + String x = (String)str; \ + <a class="code" href="group__print.html#ga7">_stp_print_string</a>(x); \ + } \ + }) +</pre></div>Write a String or C string into the print buffer. +<p> +This macro selects the proper function to call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>A String or C string (char *) </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__print.html#ga5">_stp_print_cstr</a> <a class="el" href="group__print.html#ga7">_stp_print_string</a> </dd></dl> + +<p> +Definition at line <a class="el" href="print_8c-source.html#l00188">188</a> of file <a class="el" href="print_8c-source.html">print.c</a>. </td> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga6" doxytag="print.c::_stp_print_clear"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">char* _stp_print_clear </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Clear the scratch buffer. +<p> +This function should be called before anything is written to the scratch buffer. Output will accumulate in the buffer until this function is called again. <dl compact><dt><b>Returns:</b></dt><dd>A pointer to the buffer. </dd></dl> + +<p> +Definition at line <a class="el" href="print_8c-source.html#l00156">156</a> of file <a class="el" href="print_8c-source.html">print.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga5" doxytag="print.c::_stp_print_cstr"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_print_cstr </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname1" valign="top" nowrap> <em>str</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Write a C string into the print buffer. +<p> +Copies a string into a print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, <a class="el" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a>. This is more efficient than using <a class="el" href="group__print.html#ga3">_stp_printf()</a> if you don't need fancy formatting.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>A C string. </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__print.html#ga11">_stp_print</a> </dd></dl> + +<p> +Definition at line <a class="el" href="print_8c-source.html#l00138">138</a> of file <a class="el" href="print_8c-source.html">print.c</a>. +<p> +References <a class="el" href="print_8c-source.html#l00022">STP_PRINT_BUF_LEN</a>. +<p> +Referenced by <a class="el" href="print_8c-source.html#l00176">_stp_print_string()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="print.c::_stp_print_flush"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_print_flush </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Send the print buffer now. +<p> +Output accumulates in the print buffer until this is called. Size is limited by length of print buffer, <a class="el" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a>. +<p> +Definition at line <a class="el" href="print_8c-source.html#l00065">65</a> of file <a class="el" href="print_8c-source.html">print.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga7" doxytag="print.c::_stp_print_string"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_print_string </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname1" valign="top" nowrap> <em>str</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Write a String into the print buffer. +<p> +Copies a String into a print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, <a class="el" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a>. This is more efficient than using <a class="el" href="group__print.html#ga3">_stp_printf()</a> if you don't need fancy formatting.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>A String. </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__print.html#ga11">_stp_print</a> </dd></dl> + +<p> +Definition at line <a class="el" href="print_8c-source.html#l00176">176</a> of file <a class="el" href="print_8c-source.html">print.c</a>. +<p> +References <a class="el" href="print_8c-source.html#l00138">_stp_print_cstr()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga3" doxytag="print.c::_stp_printf"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_printf </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname" nowrap> <em>fmt</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap> </td> + <td class="mdname" nowrap> <em>...</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Print into the print buffer. +<p> +Like printf, except output goes to the print buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of print buffer, <a class="el" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a>.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>A printf-style format string followed by a variable number of args. </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__print.html#ga2">_stp_print_flush()</a> </dd></dl> + +<p> +Definition at line <a class="el" href="print_8c-source.html#l00099">99</a> of file <a class="el" href="print_8c-source.html">print.c</a>. +<p> +References <a class="el" href="print_8c-source.html#l00022">STP_PRINT_BUF_LEN</a>. +<p> +Referenced by <a class="el" href="sym_8c-source.html#l00054">_stp_symbol_print()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="print.c::_stp_vprintf"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_vprintf </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname" nowrap> <em>fmt</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>va_list </td> + <td class="mdname" nowrap> <em>args</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Print into the print buffer. +<p> +Use this if your function already has a va_list. You probably want <a class="el" href="group__print.html#ga3">_stp_printf()</a>. +<p> +Definition at line <a class="el" href="print_8c-source.html#l00117">117</a> of file <a class="el" href="print_8c-source.html">print.c</a>. +<p> +References <a class="el" href="print_8c-source.html#l00022">STP_PRINT_BUF_LEN</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__scbuf.html b/runtime/docs/html/group__scbuf.html deleted file mode 100644 index 89033737..00000000 --- a/runtime/docs/html/group__scbuf.html +++ /dev/null @@ -1,160 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: Scratch Buffer</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>Scratch Buffer</h1>Scratch Buffer Functions. -<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Defines</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="scbuf::STP_BUF_LEN"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__scbuf.html#ga6">STP_BUF_LEN</a> 8191</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum size of buffer, not including terminating NULL. <br></td></tr> -<tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__scbuf.html#ga2">_stp_sprint</a> (const char *fmt,...)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Sprint into the scratch buffer. <a href="#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__scbuf.html#ga3">_stp_sprint_str</a> (const char *str)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a string into the scratch buffer. <a href="#ga3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__scbuf.html#ga4">_stp_scbuf_clear</a> (void)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear the scratch buffer. <a href="#ga4"></a><br></td></tr> -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -Scratch Buffer Functions. -<p> -The scratch buffer is for collecting output before storing in a map, printing, etc. This is a per-cpu static buffer. It is necessary because of the limited stack space available in the kernel. <p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000008">Todo:</a></b></dt><dd>Need careful review of these to insure safety.</dd></dl> -<hr><h2>Function Documentation</h2> -<a class="anchor" name="ga4" doxytag="scbuf.c::_stp_scbuf_clear"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">char* _stp_scbuf_clear </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">void </td> - <td class="mdname1" valign="top" nowrap> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Clear the scratch buffer. -<p> -This function should be called before anything is written to the scratch buffer. Output will accumulate in the buffer until this function is called again. <dl compact><dt><b>Returns:</b></dt><dd>A pointer to the buffer. </dd></dl> - -<p> -Definition at line <a class="el" href="scbuf_8c-source.html#l00074">74</a> of file <a class="el" href="scbuf_8c-source.html">scbuf.c</a>. -<p> -References <a class="el" href="scbuf_8c-source.html#l00017">STP_BUF_LEN</a>. </td> - </tr> -</table> -<a class="anchor" name="ga2" doxytag="scbuf.c::_stp_sprint"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void _stp_sprint </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">const char * </td> - <td class="mdname" nowrap> <em>fmt</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap> </td> - <td class="mdname" nowrap> <em>...</em></td> - </tr> - <tr> - <td class="md"></td> - <td class="md">) </td> - <td class="md" colspan="2"></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Sprint into the scratch buffer. -<p> -Like printf, except output goes into a global scratch buffer which will contain the null-terminated output. Safe because overflowing the buffer is not allowed. Size is limited by length of scratch buffer, STP_BUF_LEN.<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>A printf-style format string followed by a variable number of args. </td></tr> - </table> -</dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__scbuf.html#ga4">_stp_scbuf_clear</a> </dd></dl> - -<p> -Definition at line <a class="el" href="scbuf_8c-source.html#l00034">34</a> of file <a class="el" href="scbuf_8c-source.html">scbuf.c</a>. -<p> -References <a class="el" href="scbuf_8c-source.html#l00017">STP_BUF_LEN</a>. -<p> -Referenced by <a class="el" href="sym_8c-source.html#l00045">_stp_symbol_sprint()</a>. </td> - </tr> -</table> -<a class="anchor" name="ga3" doxytag="scbuf.c::_stp_sprint_str"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void _stp_sprint_str </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">const char * </td> - <td class="mdname1" valign="top" nowrap> <em>str</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Write a string into the scratch buffer. -<p> -Copies a string into a global scratch buffer. Safe because overflowing the buffer is not allowed. Size is limited by length of scratch buffer, STP_BUF_LEN. This is more efficient than using <a class="el" href="group__scbuf.html#ga2">_stp_sprint()</a>.<p> -<dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>A string. </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="scbuf_8c-source.html#l00056">56</a> of file <a class="el" href="scbuf_8c-source.html">scbuf.c</a>. -<p> -References <a class="el" href="scbuf_8c-source.html#l00017">STP_BUF_LEN</a>. </td> - </tr> -</table> -</body></html> diff --git a/runtime/docs/html/group__stack.html b/runtime/docs/html/group__stack.html index 159a529f..ab4922e5 100644 --- a/runtime/docs/html/group__stack.html +++ b/runtime/docs/html/group__stack.html @@ -4,16 +4,16 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Stack Tracing Functions</h1><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__stack.html#ga6">_stp_stack_print</a> (int verbose, int levels)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Print stack dump. <a href="#ga6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="stack::_stp_stack_sprint"></a> -char * </td><td class="memItemRight" valign="bottom"><b>_stp_stack_sprint</b> (int verbose, int levels)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="group__stack.html#ga7">_stp_stack_sprint</a> (String str, int verbose, int levels)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Writes stack dump to a String. <a href="#ga7"></a><br></td></tr> </table> <hr><h2>Function Documentation</h2> <a class="anchor" name="ga6" doxytag="stack.c::_stp_stack_print"></a><p> @@ -52,14 +52,78 @@ char * </td><td class="memItemRight" valign="bottom"><b>_stp_stack_sprint</ <p> Print stack dump. <p> -Prints a stack dump to the trace buffer. <dl compact><dt><b>Parameters:</b></dt><dd> +Prints a stack dump to the print buffer. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>verbose</em> </td><td>Verbosity: </td></tr> + <tr><td valign="top"></td><td valign="top"><em>verbose</em> </td><td>Verbosity </td></tr> + <tr><td valign="top"></td><td valign="top"><em>levels</em> </td><td>Number of levels to trace. </td></tr> </table> </dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000007">Todo:</a></b></dt><dd>Implement verbosity and levels parameters.</dd></dl> +<p> +<dl compact><dt><b><a class="el" href="bug.html#_bug000003">Bug:</a></b></dt><dd>levels parameter is not functional </dd></dl> <p> -Definition at line <a class="el" href="stack_8c-source.html#l00151">151</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. </td> +Definition at line <a class="el" href="stack_8c-source.html#l00155">155</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga7" doxytag="stack.c::_stp_stack_sprint"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">String _stp_stack_sprint </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>verbose</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>levels</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Writes stack dump to a String. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String </td></tr> + <tr><td valign="top"></td><td valign="top"><em>verbose</em> </td><td>Verbosity </td></tr> + <tr><td valign="top"></td><td valign="top"><em>levels</em> </td><td>Number of levels to trace. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>Same String as was input. </dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000008">Todo:</a></b></dt><dd>Implement verbosity and levels parameters.</dd></dl> +<p> +<dl compact><dt><b><a class="el" href="bug.html#_bug000004">Bug:</a></b></dt><dd>levels parameter is not functional </dd></dl> + +<p> +Definition at line <a class="el" href="stack_8c-source.html#l00171">171</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. +<p> +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/group__string.html b/runtime/docs/html/group__string.html new file mode 100644 index 00000000..834b7513 --- /dev/null +++ b/runtime/docs/html/group__string.html @@ -0,0 +1,389 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: String Functions</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>String Functions</h1>One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack. +<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>string</b></td></tr> + +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="string::STP_STRING_SIZE"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga8">STP_STRING_SIZE</a> 2048</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum string size allowed in Strings. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga9">_stp_string_cat</a>(str1, str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a String or C string to a String. <a href="#ga9"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="string::String"></a> +typedef string * </td><td class="memItemRight" valign="bottom"><b>String</b></td></tr> + +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga2">_stp_string_init</a> (int num)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a String for our use. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga3">_stp_sprintf</a> (String str, const char *fmt,...)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sprintf into a String. <a href="#ga3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga4">_stp_vsprintf</a> (String str, const char *fmt, va_list args)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Vsprintf into a String Use this if your function already has a va_list. <a href="#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga5">_stp_string_cat_cstr</a> (String str1, const char *str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a C string to a String. <a href="#ga5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga6">_stp_string_cat_string</a> (String str1, String str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a String to a String. <a href="#ga6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga7">_stp_string_ptr</a> (String str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to String's buffer For rare cases when a C string is needed and you have a String. <a href="#ga7"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack. +<p> +It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with statically allocated space for strings. This is what is implemented in the String module. Strings use preallocated per-cpu buffers and are safe to use (unlike C strings). <hr><h2>Define Documentation</h2> +<a class="anchor" name="ga9" doxytag="string.c::_stp_string_cat"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define _stp_string_cat </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">str1, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>str2 </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (str2), <span class="keywordtype">char</span>[])) { \ + <span class="keywordtype">char</span> *x = (<span class="keywordtype">char</span> *)str2; \ + _str_string_cat_cstr(str1,x); \ + } <span class="keywordflow">else</span> { \ + String x = (String)str2; \ + _str_string_cat_string(str1,x); \ + } \ + }) +</pre></div>ConCATenate (append) a String or C string to a String. +<p> +This macro selects the proper function to call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str1</em> </td><td>A String </td></tr> + <tr><td valign="top"></td><td valign="top"><em>str2</em> </td><td>A String or C string (char *) </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__string.html#ga5">_stp_string_cat_cstr</a> <a class="el" href="group__string.html#ga6">_stp_string_cat_string</a> </dd></dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00150">150</a> of file <a class="el" href="string_8c-source.html">string.c</a>. </td> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga3" doxytag="string.c::_stp_sprintf"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_sprintf </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>fmt</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap> </td> + <td class="mdname" nowrap> <em>...</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Sprintf into a String. +<p> +Like printf, except output goes into a String. Safe because overflowing the buffer is not allowed. Size is limited by length of String, <a class="el" href="group__string.html#ga8">STP_STRING_SIZE</a>.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String </td></tr> + <tr><td valign="top"></td><td valign="top"><em>fmt</em> </td><td>A printf-style format string followed by a variable number of args. </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00077">77</a> of file <a class="el" href="string_8c-source.html">string.c</a>. +<p> +References <a class="el" href="string_8c-source.html#l00020">STP_STRING_SIZE</a>. +<p> +Referenced by <a class="el" href="sym_8c-source.html#l00030">_stp_symbol_sprint()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga5" doxytag="string.c::_stp_string_cat_cstr"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_string_cat_cstr </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>str2</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +ConCATenate (append) a C string to a String. +<p> +Like strcat(). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str1</em> </td><td>String </td></tr> + <tr><td valign="top"></td><td valign="top"><em>str2</em> </td><td>C string (char *) </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__string.html#ga9">_stp_string_cat</a> </dd></dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00106">106</a> of file <a class="el" href="string_8c-source.html">string.c</a>. +<p> +References <a class="el" href="string_8c-source.html#l00020">STP_STRING_SIZE</a>. </td> + </tr> +</table> +<a class="anchor" name="ga6" doxytag="string.c::_stp_string_cat_string"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_string_cat_string </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>String </td> + <td class="mdname" nowrap> <em>str2</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +ConCATenate (append) a String to a String. +<p> +Like strcat(). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str1</em> </td><td>String </td></tr> + <tr><td valign="top"></td><td valign="top"><em>str2</em> </td><td>String </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__string.html#ga9">_stp_string_cat</a> </dd></dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00121">121</a> of file <a class="el" href="string_8c-source.html">string.c</a>. +<p> +References <a class="el" href="string_8c-source.html#l00020">STP_STRING_SIZE</a>. </td> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="string.c::_stp_string_init"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">String _stp_string_init </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname1" valign="top" nowrap> <em>num</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Initialize a String for our use. +<p> +This grabs one of the global Strings for our use.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>num</em> </td><td>Number of the preallocated String to use. #STP_NUM_STRINGS are statically allocated for our use. The translator (or author) should be sure to grab a free one. </td></tr> + </table> +</dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000009">Todo:</a></b></dt><dd>Global (and static) Strings not implemented yet. </dd></dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00042">42</a> of file <a class="el" href="string_8c-source.html">string.c</a>. +<p> +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga7" doxytag="string.c::_stp_string_ptr"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">char* _stp_string_ptr </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname1" valign="top" nowrap> <em>str</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Get a pointer to String's buffer For rare cases when a C string is needed and you have a String. +<p> +One example is when you want to print a String with <a class="el" href="group__print.html#ga3">_stp_printf()</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>A C string (char *) </dd></dl> +<dl compact><dt><b>Note:</b></dt><dd>Readonly. Don't write to this pointer or it will mess up the internal String state and probably mess up your output or crash something. </dd></dl> + +<p> +Definition at line <a class="el" href="string_8c-source.html#l00138">138</a> of file <a class="el" href="string_8c-source.html">string.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="string.c::_stp_vsprintf"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_vsprintf </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>fmt</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>va_list </td> + <td class="mdname" nowrap> <em>args</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Vsprintf into a String Use this if your function already has a va_list. +<p> +You probably want <a class="el" href="group__string.html#ga3">_stp_sprintf()</a>. +<p> +Definition at line <a class="el" href="string_8c-source.html#l00092">92</a> of file <a class="el" href="string_8c-source.html">string.c</a>. +<p> +References <a class="el" href="string_8c-source.html#l00020">STP_STRING_SIZE</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__sym.html b/runtime/docs/html/group__sym.html index eafa03c2..d5b24087 100644 --- a/runtime/docs/html/group__sym.html +++ b/runtime/docs/html/group__sym.html @@ -4,23 +4,23 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Symbolic Functions</h1>Symbolic Lookup Functions. <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sym.html#ga2">_stp_symbol_sprint</a> (unsigned long address)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sym.html#ga1">_stp_symbol_sprint</a> (String str, unsigned long address)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Print addresses symbolically into a string. <a href="#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sym.html#ga3">_stp_symbol_print</a> (unsigned long address)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Write addresses symbolically into a String. <a href="#ga1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sym.html#ga2">_stp_symbol_print</a> (unsigned long address)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Print addresses symbolically to the trace buffer. <a href="#ga3"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Print addresses symbolically to the print buffer. <a href="#ga2"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Symbolic Lookup Functions. <p> <hr><h2>Function Documentation</h2> -<a class="anchor" name="ga3" doxytag="sym.c::_stp_symbol_print"></a><p> +<a class="anchor" name="ga2" doxytag="sym.c::_stp_symbol_print"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -45,33 +45,42 @@ Symbolic Lookup Functions. <td> <p> -Print addresses symbolically to the trace buffer. +Print addresses symbolically to the print buffer. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>address</em> </td><td>The address to lookup. </td></tr> </table> </dl> -<dl compact><dt><b>Note:</b></dt><dd>Symbolic lookups should not be done within a probe because it is too time-consuming. Use at module exit time. </dd></dl> +<dl compact><dt><b>Note:</b></dt><dd>Symbolic lookups should not normally be done within a probe because it is too time-consuming. Use at module exit time. </dd></dl> <p> -Definition at line <a class="el" href="sym_8c-source.html#l00059">59</a> of file <a class="el" href="sym_8c-source.html">sym.c</a>. +Definition at line <a class="el" href="sym_8c-source.html#l00054">54</a> of file <a class="el" href="sym_8c-source.html">sym.c</a>. <p> -References <a class="el" href="io_8c-source.html#l00043">_stp_print()</a>. </td> +References <a class="el" href="print_8c-source.html#l00099">_stp_printf()</a>. </td> </tr> </table> -<a class="anchor" name="ga2" doxytag="sym.c::_stp_symbol_sprint"></a><p> +<a class="anchor" name="ga1" doxytag="sym.c::_stp_symbol_sprint"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> - <td class="md" nowrap valign="top">char* _stp_symbol_sprint </td> + <td class="md" nowrap valign="top">String _stp_symbol_sprint </td> <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">unsigned long </td> - <td class="mdname1" valign="top" nowrap> <em>address</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap></td> + <td class="md" nowrap valign="top">String </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>unsigned long </td> + <td class="mdname" nowrap> <em>address</em></td> + </tr> + <tr> + <td class="md"></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> </tr> </table> </td> @@ -85,20 +94,20 @@ References <a class="el" href="io_8c-source.html#l00043">_stp_print()</a>. </ <td> <p> -Print addresses symbolically into a string. +Write addresses symbolically into a String. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String </td></tr> <tr><td valign="top"></td><td valign="top"><em>address</em> </td><td>The address to lookup. </td></tr> </table> </dl> -<dl compact><dt><b>Note:</b></dt><dd>Symbolic lookups should not be done within a probe because it is too time-consuming. Use at module exit time. <p> -Uses scbuf. </dd></dl> +<dl compact><dt><b>Note:</b></dt><dd>Symbolic lookups should not normally be done within a probe because it is too time-consuming. Use at module exit time. </dd></dl> <p> -Definition at line <a class="el" href="sym_8c-source.html#l00045">45</a> of file <a class="el" href="sym_8c-source.html">sym.c</a>. +Definition at line <a class="el" href="sym_8c-source.html#l00030">30</a> of file <a class="el" href="sym_8c-source.html">sym.c</a>. <p> -References <a class="el" href="scbuf_8c-source.html#l00034">_stp_sprint()</a>. </td> +References <a class="el" href="string_8c-source.html#l00077">_stp_sprintf()</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/index.html b/runtime/docs/html/index.html index 86c7e175..e51162e4 100644 --- a/runtime/docs/html/index.html +++ b/runtime/docs/html/index.html @@ -1,40 +1,53 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> +<title>SystemTap: SystemTap Runtime</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindexHL" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>SystemTap Runtime Library </h1> +<div class="qindex"><a class="qindexHL" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>SystemTap Runtime </h1> <p> -<h3 align="center">0.1 </h3><h2><a class="anchor" name="intro_sec"> +<h3 align="center">0.2 </h3><h2><a class="anchor" name="intro_sec"> Introduction</a></h2> -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.<h2><a class="anchor" name="design_sec"> +This document describes the implementation of the SystemTap Runtime. It is intended for developers of the SystemTap Language translator or, possibly TapSet authors. These functions are not directly available from the SystemTap Language.<p> +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. It also include I/O code to transmit its output from the kernel to userspace.<p> +In addition to the library, the runtime includes a SystemTap user-space daemon (stpd). Stpd grabs data sent from the I/O code in the runtime and displays it and/or saves it to files. Stpd (or a script invoking it) will handle other issues like inserting and removing modules.<p> +Stpd and the I/O code make use of both relayfs and netlink for communication. For kernels without relayfs builtin, it is provided as a standalone module under the runtime directory.<h2><a class="anchor" name="design_sec"> Design</a></h2> <h3><a class="anchor" name="impl_sec"> Implementation</a></h3> -The library is written in <code>C</code> and is really not a library but a collection of code That can be conditionally included in a modules. It will probably become a library later.<h3><a class="anchor" name="map_sec"> +The library is written in C and is really not a library but a collection of code That can be conditionally included in a modules. It may become a library later, but for now there are some advantages to being able to change the sizes of static items with simple #defines.<h3><a class="anchor" name="map_sec"> Maps (Associative Arrays)</a></h3> 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.<p> Maps are created with <a class="el" href="group__maps.html#ga2">_stp_map_new()</a>. 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.<p> 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.<p> -For example: <div class="fragment"><pre class="fragment"> -<span class="comment">/* create a map with a max of 100 elements */</span> -<a class="code" href="structmap__root.html">MAP</a> mymap = map_new(100, INT64); +For example: <div class="fragment"><pre class="fragment"><span class="comment">/* create a map with a max of 100 elements */</span> +<a class="code" href="group__maps.html#ga1">MAP</a> mymap = map_new(100, INT64); <span class="comment">/* mymap[birth year] = 2000 */</span> map_key_str (mymap, <span class="stringliteral">"birth year"</span>); -map_set_int64 (mymap, 2000); +map_set_int64 (mymap, 2000); </pre></div><p> 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.<h3><a class="anchor" name="list_sec"> Lists</a></h3> -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. Create a list with <a class="el" href="group__lists.html#ga0">_stp_list_new()</a>. Add to it with <a class="el" href="group__lists.html#ga2">_stp_list_add_str()</a> and <a class="el" href="group__lists.html#ga3">_stp_list_add_int64()</a>. Clear it with <a class="el" href="group__lists.html#ga1">_stp_list_clear()</a>.<h2><a class="anchor" name="status_sec"> +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. Create a list with <a class="el" href="group__lists.html#ga0">_stp_list_new()</a>. Add to it with <a class="el" href="group__lists.html#ga2">_stp_list_add_str()</a> and <a class="el" href="group__lists.html#ga4">_stp_list_add_int64()</a>. Clear it with <a class="el" href="group__lists.html#ga1">_stp_list_clear()</a>.<h3><a class="anchor" name="string_sec"> +Strings</a></h3> +One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack. It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with statically allocated space for strings. This is what is implemented in the String module. Strings use preallocated per-cpu buffers and are safe to use (unlike C strings).<h3><a class="anchor" name="io_sec"> +I/O</a></h3> +Generally things are written to a "print buffer" using the internal functions _stp_print_xxx(). <div class="fragment"><pre class="fragment"><a class="code" href="group__print.html#ga11">_stp_print</a> (<span class="stringliteral">"Output is: "</span>); +<a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"pid is %d "</span>, current->pid); +<a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"name is %s"</span>, current->comm); +</pre></div> before the probe returns it must call <a class="el" href="group__print.html#ga2">_stp_print_flush()</a>. This timestamps the accumulated print buffer and sends it to relayfs. When relayfs fills an internal buffer, the user-space daemon is notified data is ready and reads a bug per-cpu chunk, which contains a line like: <div class="fragment"><pre class="fragment"> +[123456.000002] Output is: pid is 1234 name is bash +</pre></div><p> +The user-daemon (stpd) saves this data to a file named something like "stpd_cpu2". When the user hits ^c, a timer expires, or the probe module notifies stpd (through a netlink command channel) that it wants to terminate, stpd does "system(rmmod)" then collects the last output before exiting. As an option, if we don't need bulk per-cpu data, we can put <div class="fragment"><pre class="fragment"><span class="preprocessor">#define STP_NETLINK_ONLY</span> +</pre></div> at the top of the module and all output will go over a netlink channel. In the SystemTap language, we will provide some simple functions to control the buffering policy, which will control the use of netlink and parameters to relayfs and stpd.<h2><a class="anchor" name="status_sec"> Status</a></h2> <ul> <li>Maps are implemented and tested. Histograms are not yet finished. </li> <li>Copy_From_User functions are done. </li> <li>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. </li> -<li>Locking and per-cpu data are not yet implemented to be SMP-safe. This is not yet necessary because the current kprobes implementation single-threads probes for us.</li> +<li>Stack functions need much improvement.</li> </ul> <h2><a class="anchor" name="probe_sec"> Example Probes</a></h2> diff --git a/runtime/docs/html/io_8c-source.html b/runtime/docs/html/io_8c-source.html index 064ef3f8..82721232 100644 --- a/runtime/docs/html/io_8c-source.html +++ b/runtime/docs/html/io_8c-source.html @@ -4,71 +4,115 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>io.c</h1><a href="io_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _IO_C_</span> -00002 <span class="preprocessor"></span><span class="preprocessor">#define _IO_C_</span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>io.c</h1><a href="io_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _IO_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _IO_C_</span> 00003 <span class="preprocessor"></span> -00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00005 <span class="comment">/** @file io.c</span> -00006 <span class="comment"> * @brief I/O functions</span> -00007 <span class="comment"> */</span><span class="comment"></span> -00008 <span class="comment">/** @addtogroup io I/O</span> -00009 <span class="comment"> * I/O functions</span> -00010 <span class="comment"> * @{</span> -00011 <span class="comment"> */</span> -00012 <span class="comment"></span> -00013 <span class="comment">/** Logs Data.</span> -00014 <span class="comment"> * This function is compatible with printk. In fact it currently</span> -00015 <span class="comment"> * sends all output to vprintk, after sending "STP: ". This allows</span> -00016 <span class="comment"> * us to easily detect SystemTap output in the log file. </span> -00017 <span class="comment"> *</span> -00018 <span class="comment"> * @param fmt A variable number of args.</span> -00019 <span class="comment"> * @bug Lines are limited in length by printk buffer. If there is</span> -00020 <span class="comment"> * no newline in the format string, then other syslog output could</span> -00021 <span class="comment"> * get appended to the SystemTap line.</span> -00022 <span class="comment"> * @todo Either deprecate or redefine this as a way to log debug or </span> -00023 <span class="comment"> * status messages, separate from the normal program output.</span> -00024 <span class="comment"> */</span> -<a name="l00025"></a><a class="code" href="group__io.html#ga0">00025</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga0">dlog</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) -00026 { -00027 va_list args; -00028 printk(<span class="stringliteral">"STP: "</span>); -00029 va_start(args, fmt); -00030 vprintk(fmt, args); -00031 va_end(args); -00032 } -00033 <span class="comment"></span> -00034 <span class="comment">/** Prints to the trace buffer.</span> -00035 <span class="comment"> * This function uses the same formatting as printk. It currently</span> -00036 <span class="comment"> * writes to the system log. </span> -00037 <span class="comment"> *</span> -00038 <span class="comment"> * @param fmt A variable number of args.</span> -00039 <span class="comment"> * @todo Needs replaced with something much faster that does not</span> -00040 <span class="comment"> * use the system log.</span> -00041 <span class="comment"> */</span> -00042 -<a name="l00043"></a><a class="code" href="group__io.html#ga1">00043</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga1">_stp_print</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) -00044 { -00045 va_list args; -00046 va_start(args, fmt); -00047 vprintk(fmt, args); -00048 va_end(args); -00049 } -00050 <span class="comment"></span> -00051 <span class="comment">/** Prints to the trace buffer.</span> -00052 <span class="comment"> * This function will write a string to the trace buffer. It currently</span> -00053 <span class="comment"> * writes to the system log. </span> -00054 <span class="comment"> *</span> -00055 <span class="comment"> * @param str String.</span> -00056 <span class="comment"> * @todo Needs replaced with something much faster that does not</span> -00057 <span class="comment"> * use the system log.</span> -00058 <span class="comment"> */</span> -00059 -<a name="l00060"></a><a class="code" href="group__io.html#ga2">00060</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga2">_stp_print_str</a> (<span class="keywordtype">char</span> *str) -00061 { -00062 printk (<span class="stringliteral">"%s"</span>, str); -00063 } -00064 <span class="comment"></span> -00065 <span class="comment">/** @} */</span> -00066 <span class="preprocessor">#endif </span><span class="comment">/* _IO_C_ */</span> +00004 <span class="preprocessor">#include "relay-app.h"</span> +00005 <span class="preprocessor">#include "print.c"</span> +00006 <span class="comment"></span> +00007 <span class="comment">/** @file io.c</span> +00008 <span class="comment"> * @brief I/O functions</span> +00009 <span class="comment"> */</span><span class="comment"></span> +00010 <span class="comment">/** @addtogroup io I/O</span> +00011 <span class="comment"> * I/O functions</span> +00012 <span class="comment"> * @{</span> +00013 <span class="comment"> */</span> +00014 <span class="comment"></span> +00015 <span class="comment">/** private buffer for _stp_log() */</span> +<a name="l00016"></a><a class="code" href="group__io.html#ga9">00016</a> <span class="preprocessor">#define STP_LOG_BUF_LEN 2047</span> +00017 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> _stp_lbuf[NR_CPUS][<a class="code" href="group__io.html#ga9">STP_LOG_BUF_LEN</a> + 1]; +00018 <span class="comment"></span> +00019 <span class="comment">/** Logs Data.</span> +00020 <span class="comment"> * This function prints to the system log if stpd has not connected</span> +00021 <span class="comment"> * yet. Otherwise it sends the message immediately to stpd.</span> +00022 <span class="comment"> * @param fmt A variable number of args.</span> +00023 <span class="comment"> * @note Lines are limited in length by printk buffer. If there is</span> +00024 <span class="comment"> * no newline in the format string, then other syslog output could</span> +00025 <span class="comment"> * get appended to the SystemTap line.</span> +00026 <span class="comment"> * @todo Evaluate if this function is necessary.</span> +00027 <span class="comment"> */</span> +00028 +<a name="l00029"></a><a class="code" href="group__io.html#ga2">00029</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) +00030 { +00031 <span class="keywordtype">int</span> num; +00032 <span class="keywordtype">char</span> *buf = &_stp_lbuf[smp_processor_id()][0]; +00033 va_list args; +00034 va_start(args, fmt); +00035 num = vscnprintf (buf, <a class="code" href="group__io.html#ga9">STP_LOG_BUF_LEN</a>, fmt, args); +00036 va_end(args); +00037 buf[num] = <span class="charliteral">'\0'</span>; +00038 +00039 <span class="keywordflow">if</span> (app.logging) +00040 send_reply (STP_REALTIME_DATA, buf, num + 1, stpd_pid); +00041 <span class="keywordflow">else</span> +00042 printk(<span class="stringliteral">"STP: %s"</span>, buf); +00043 } +00044 +00045 <span class="keyword">static</span> <span class="keywordtype">void</span> stpd_app_started(<span class="keywordtype">void</span>) +00046 { +00047 printk (<span class="stringliteral">"stpd has started.\n"</span>); +00048 } +00049 +00050 <span class="keyword">static</span> <span class="keywordtype">void</span> stpd_app_stopped(<span class="keywordtype">void</span>) +00051 { +00052 printk (<span class="stringliteral">"stpd has stopped.\n"</span>); +00053 } +00054 +00055 <span class="keyword">static</span> <span class="keywordtype">void</span> probe_exit(<span class="keywordtype">void</span>); +00056 +00057 <span class="preprocessor">#include <linux/delay.h></span> +00058 <span class="keyword">static</span> <span class="keywordtype">int</span> stpd_command (<span class="keywordtype">int</span> type, <span class="keywordtype">void</span> *data) +00059 { +00060 <span class="keywordflow">if</span> (type == STP_EXIT) { +00061 printk (<span class="stringliteral">"STP_EXIT received\n"</span>); +00062 probe_exit(); +00063 <span class="preprocessor">#ifndef STP_NETLINK_ONLY</span> +00064 <span class="preprocessor"></span> relay_flush(app.chan); +00065 ssleep(2); <span class="comment">/* FIXME: time for data to be flushed */</span> +00066 <span class="preprocessor">#endif</span> +00067 <span class="preprocessor"></span> send_reply (STP_EXIT, __this_module.name, strlen(__this_module.name) + 1, stpd_pid); +00068 <span class="keywordflow">return</span> 1; +00069 } +00070 <span class="keywordflow">return</span> 0; +00071 } +00072 +00073 <span class="comment">/*</span> +00074 <span class="comment"> * relay-app callbacks</span> +00075 <span class="comment"> */</span> +00076 <span class="keyword">static</span> <span class="keyword">struct </span>relay_app_callbacks stp_callbacks = +00077 { +00078 .app_started = stpd_app_started, +00079 .app_stopped = stpd_app_stopped, +00080 .user_command = stpd_command +00081 }; +00082 <span class="comment"></span> +00083 <span class="comment">/** Opens netlink and relayfs connections to stpd.</span> +00084 <span class="comment"> * This must be called before any I/O is done, probably </span> +00085 <span class="comment"> * at the start of module initialization.</span> +00086 <span class="comment"> */</span> +<a name="l00087"></a><a class="code" href="group__io.html#ga7">00087</a> <span class="keywordtype">int</span> <a class="code" href="group__io.html#ga7">_stp_netlink_open</a>(<span class="keywordtype">void</span>) +00088 { +00089 <span class="keywordflow">if</span> (init_relay_app(<span class="stringliteral">"stpd"</span>, <span class="stringliteral">"cpu"</span>, &stp_callbacks)) { +00090 printk (<span class="stringliteral">"STP: couldn't init relay app\n"</span>); +00091 <span class="keywordflow">return</span> -1; +00092 } +00093 <span class="keywordflow">return</span> 0; +00094 } +00095 <span class="comment"></span> +00096 <span class="comment">/** Closes netlink and relayfs connections to stpd.</span> +00097 <span class="comment"> * This must be called after all I/O is done, probably </span> +00098 <span class="comment"> * at the end of module cleanup.</span> +00099 <span class="comment"> * @returns 0 on success. -1 if there is a problem establishing</span> +00100 <span class="comment"> * a connection.</span> +00101 <span class="comment"> */</span> +00102 +<a name="l00103"></a><a class="code" href="group__io.html#ga8">00103</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga8">_stp_netlink_close</a> (<span class="keywordtype">void</span>) +00104 { +00105 send_reply (STP_DONE, NULL, 0, stpd_pid); +00106 close_relay_app(); +00107 } +00108 <span class="comment"></span> +00109 <span class="comment">/** @} */</span> +00110 <span class="preprocessor">#endif </span><span class="comment">/* _IO_C_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/io_8c.html b/runtime/docs/html/io_8c.html index 3357e2f8..1aca24d7 100644 --- a/runtime/docs/html/io_8c.html +++ b/runtime/docs/html/io_8c.html @@ -4,23 +4,31 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>io.c File Reference</h1>I/O functions. <a href="#_details">More...</a> <p> +<code>#include "relay-app.h"</code><br> +<code>#include "print.c"</code><br> +<code>#include <linux/delay.h></code><br> <p> <a href="io_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="io.c::STP_LOG_BUF_LEN"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga9">STP_LOG_BUF_LEN</a> 2047</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">private buffer for <a class="el" href="group__io.html#ga2">_stp_log()</a> <br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga0">dlog</a> (const char *fmt,...)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga2">_stp_log</a> (const char *fmt,...)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Logs Data. <a href="group__io.html#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga1">_stp_print</a> (const char *fmt,...)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Logs Data. <a href="group__io.html#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga7">_stp_netlink_open</a> (void)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Prints to the trace buffer. <a href="group__io.html#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga2">_stp_print_str</a> (char *str)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens netlink and relayfs connections to stpd. <a href="group__io.html#ga7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__io.html#ga8">_stp_netlink_close</a> (void)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Prints to the trace buffer. <a href="group__io.html#ga2"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Closes netlink and relayfs connections to stpd. <a href="group__io.html#ga8"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> I/O functions. diff --git a/runtime/docs/html/kprobe__where__funct_8c-source.html b/runtime/docs/html/kprobe__where__funct_8c-source.html index 7da50eda..a1d096a5 100644 --- a/runtime/docs/html/kprobe__where__funct_8c-source.html +++ b/runtime/docs/html/kprobe__where__funct_8c-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000004.html">where_func</a></div> <h1>kprobe_where_funct.c</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/* kprobe_where_funct.c</span> @@ -15,76 +15,85 @@ 00006 <span class="preprocessor">#define HASH_TABLE_BITS 8</span> 00007 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1<<HASH_TABLE_BITS)</span> 00008 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span> -00009 -00010 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> -00011 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span> -00012 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> -00013 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> -00014 <span class="preprocessor">#include "<a class="code" href="current_8c.html">current.c</a>"</span> -00015 <span class="preprocessor">#include "sym.c"</span> -00016 -00017 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: where_func"</span>); -00018 MODULE_AUTHOR(<span class="stringliteral">"Will Cohen and Martin Hunt"</span>); -00019 -00020 <span class="keyword">static</span> <span class="keywordtype">char</span> default_name[] = <span class="stringliteral">"schedule"</span>; -00021 <span class="keyword">static</span> <span class="keywordtype">char</span> *funct_name = default_name; -00022 module_param(funct_name, charp, 0); -00023 MODULE_PARM_DESC(funct_name, <span class="stringliteral">"function entry name.\n"</span>); -00024 -00025 <span class="keyword">static</span> <span class="keywordtype">int</span> count_funct = 0; -00026 -00027 <a class="code" href="structmap__root.html">MAP</a> funct_locations; -00028 -00029 <span class="keyword">static</span> <span class="keywordtype">int</span> inst_funct(<span class="keyword">struct</span> kprobe *p, <span class="keyword">struct</span> pt_regs *regs) -00030 { -00031 <span class="keywordtype">long</span> ret_addr = <a class="code" href="group__current.html#ga0">_stp_ret_addr</a>(regs); -00032 ++count_funct; -00033 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(funct_locations, ret_addr); -00034 <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a>(funct_locations, 1); -00035 <span class="keywordflow">return</span> 0; -00036 } -00037 -00038 <span class="comment">/*For each probe you need to allocate a kprobe structure*/</span> -00039 <span class="keyword">static</span> <span class="keyword">struct </span>kprobe kp[] = { -00040 { -00041 .addr = default_name, -00042 .pre_handler = inst_funct, -00043 } -00044 }; -00045 <span class="preprocessor">#define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe))</span> -00046 <span class="preprocessor"></span> -00047 <span class="keywordtype">int</span> init_module(<span class="keywordtype">void</span>) -00048 { -00049 <span class="keywordtype">int</span> ret; -00050 -00051 funct_locations = <a class="code" href="group__maps.html#ga2">_stp_map_new</a>(1000, INT64); -00052 -00053 <span class="keywordflow">if</span> (funct_name) -00054 kp[0].addr = funct_name; -00055 -00056 ret = _stp_register_kprobes (kp, MAX_KPROBES); -00057 -00058 return ret; -00059 } -00060 -00061 <span class="keywordtype">void</span> cleanup_module(<span class="keywordtype">void</span>) -00062 { -00063 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *ptr; +00009 <span class="preprocessor">#define STP_NETLINK_ONLY</span> +00010 <span class="preprocessor"></span><span class="preprocessor">#define STP_NUM_STRINGS 1</span> +00011 <span class="preprocessor"></span> +00012 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> +00013 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> +00014 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> +00015 <span class="preprocessor">#include "<a class="code" href="current_8c.html">current.c</a>"</span> +00016 <span class="preprocessor">#include "sym.c"</span> +00017 +00018 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: where_func"</span>); +00019 MODULE_AUTHOR(<span class="stringliteral">"Will Cohen and Martin Hunt"</span>); +00020 +00021 <span class="keyword">static</span> <span class="keywordtype">char</span> default_name[] = <span class="stringliteral">"schedule"</span>; +00022 <span class="keyword">static</span> <span class="keywordtype">char</span> *funct_name = default_name; +00023 module_param(funct_name, charp, 0); +00024 MODULE_PARM_DESC(funct_name, <span class="stringliteral">"function entry name.\n"</span>); +00025 +00026 <span class="keyword">static</span> <span class="keywordtype">int</span> count_funct = 0; +00027 +00028 <a class="code" href="group__maps.html#ga1">MAP</a> funct_locations; +00029 +00030 <span class="keyword">static</span> <span class="keywordtype">int</span> inst_funct(<span class="keyword">struct</span> kprobe *p, <span class="keyword">struct</span> pt_regs *regs) +00031 { +00032 <span class="keywordtype">long</span> ret_addr = <a class="code" href="group__current.html#ga0">_stp_ret_addr</a>(regs); +00033 ++count_funct; +00034 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(funct_locations, ret_addr); +00035 <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a>(funct_locations, 1); +00036 <span class="keywordflow">return</span> 0; +00037 } +00038 +00039 <span class="comment">/*For each probe you need to allocate a kprobe structure*/</span> +00040 <span class="keyword">static</span> <span class="keyword">struct </span>kprobe kp[] = { +00041 { +00042 .addr = default_name, +00043 .pre_handler = inst_funct, +00044 } +00045 }; +00046 <span class="preprocessor">#define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe))</span> +00047 <span class="preprocessor"></span> +00048 <span class="keywordtype">int</span> init_module(<span class="keywordtype">void</span>) +00049 { +00050 <span class="keywordtype">int</span> ret; +00051 +00052 <span class="keywordflow">if</span> (<a class="code" href="group__io.html#ga7">_stp_netlink_open</a>() < 0) +00053 return -1; +00054 +00055 funct_locations = _stp_map_new(1000, INT64); +00056 +00057 if (funct_name) +00058 kp[0].addr = funct_name; +00059 +00060 ret = _stp_register_kprobes (kp, MAX_KPROBES); +00061 +00062 return ret; +00063 } 00064 -00065 <a class="code" href="probes_8c.html#a3">_stp_unregister_kprobes</a> (kp, MAX_KPROBES); -00066 -00067 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"%s() called %d times.\n"</span>, funct_name, count_funct); -00068 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"NUM\tCaller Addr\tCaller Name\n"</span>, funct_name); -00069 -00070 <span class="comment">/* now walk the hash table and print out all the information */</span> -00071 <a class="code" href="group__maps.html#ga31">foreach</a>(funct_locations, ptr) { -00072 <span class="keywordtype">char</span> *str =<a class="code" href="group__scbuf.html#ga4">_stp_scbuf_clear</a>(); -00073 <a class="code" href="group__sym.html#ga2">_stp_symbol_sprint</a> (<a class="code" href="group__maps.html#ga26">key1int</a>(ptr)); -00074 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"%lld\t0x%p\t(%s)\n"</span>, ptr-><a class="code" href="structmap__node__int64.html#o1">val</a>, <a class="code" href="group__maps.html#ga26">key1int</a>(ptr), str); -00075 } -00076 -00077 <a class="code" href="group__maps.html#ga7">_stp_map_del</a>(funct_locations); -00078 } -00079 -00080 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); +00065 static <span class="keywordtype">void</span> probe_exit (<span class="keywordtype">void</span>) +00066 { +00067 <span class="keyword">struct </span>map_node_int64 *ptr; +00068 +00069 <a class="code" href="probes_8c.html#a4">_stp_unregister_kprobes</a> (kp, MAX_KPROBES); +00070 +00071 <a class="code" href="group__print.html#ga3">_stp_printf</a>(<span class="stringliteral">"%s() called %d times.\n"</span>, funct_name, count_funct); +00072 <a class="code" href="group__print.html#ga3">_stp_printf</a>(<span class="stringliteral">"NUM\tCaller\n"</span>, funct_name); +00073 +00074 <span class="comment">/* now walk the hash table and print out all the information */</span> +00075 <a class="code" href="group__maps.html#ga32">foreach</a>(funct_locations, ptr) { +00076 <a class="code" href="group__print.html#ga3">_stp_printf</a>(<span class="stringliteral">"%lld\t"</span>, ptr->val); +00077 <a class="code" href="group__sym.html#ga2">_stp_symbol_print</a> (<a class="code" href="group__maps.html#ga27">key1int</a>(ptr)); +00078 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00079 } +00080 +00081 <a class="code" href="group__maps.html#ga7">_stp_map_del</a>(funct_locations); +00082 } +00083 +00084 <span class="keywordtype">void</span> cleanup_module(<span class="keywordtype">void</span>) +00085 { +00086 <a class="code" href="group__io.html#ga8">_stp_netlink_close</a>(); +00087 } +00088 +00089 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); </pre></div></body></html> diff --git a/runtime/docs/html/main.html b/runtime/docs/html/main.html deleted file mode 100644 index 59ec4e75..00000000 --- a/runtime/docs/html/main.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - -<!-- Generated by Doxygen 1.3.9.1 --> -<h1>SystemTap Runtime Library </h1> -<p> -<h3 align="center">0.1 </h3><h2><a class="anchor" name="intro_sec"> -Introduction</a></h2> -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. <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 01:43:27 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> -</body> -</html> diff --git a/runtime/docs/html/map_8c-source.html b/runtime/docs/html/map_8c-source.html index 1ff69e73..4dac0d8f 100644 --- a/runtime/docs/html/map_8c-source.html +++ b/runtime/docs/html/map_8c-source.html @@ -4,20 +4,20 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map.c</h1><a href="map_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _MAP_C_</span> -00002 <span class="preprocessor"></span><span class="preprocessor">#define _MAP_C_</span> -00003 <span class="preprocessor"></span> -00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00005 <span class="comment">/** @file map.c</span> -00006 <span class="comment"> * @brief Implements maps (associative arrays) and lists</span> -00007 <span class="comment"> */</span> -00008 -00009 <span class="preprocessor">#include "<a class="code" href="map_8h.html">map.h</a>"</span> -00010 <span class="preprocessor">#include "<a class="code" href="alloc_8c.html">alloc.c</a>"</span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>map.c</h1><a href="map_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _MAP_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _MAP_C_</span> +00003 <span class="preprocessor"></span><span class="comment"></span> +00004 <span class="comment">/** @file map.c</span> +00005 <span class="comment"> * @brief Implements maps (associative arrays) and lists</span> +00006 <span class="comment"> */</span> +00007 +00008 <span class="preprocessor">#include "<a class="code" href="map_8h.html">map.h</a>"</span> +00009 <span class="preprocessor">#include "<a class="code" href="alloc_8c.html">alloc.c</a>"</span> +00010 <span class="preprocessor">#include "<a class="code" href="string_8c.html">string.c</a>"</span> 00011 00012 <span class="keyword">static</span> <span class="keywordtype">int</span> map_sizes[] = { -00013 <span class="keyword">sizeof</span>(<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a>), +00013 <span class="keyword">sizeof</span>(<span class="keyword">struct </span>map_node_int64), 00014 sizeof(struct map_node_stat), 00015 sizeof(struct map_node_str), 00016 0 @@ -61,17 +61,17 @@ 00054 <span class="comment"> * @return A MAP on success or NULL on failure.</span> 00055 <span class="comment"> */</span> 00056 -<a name="l00057"></a><a class="code" href="group__maps.html#ga2">00057</a> <a class="code" href="structmap__root.html">MAP</a> _stp_map_new(<span class="keywordtype">unsigned</span> max_entries, enum valtype type) +<a name="l00057"></a><a class="code" href="group__maps.html#ga2">00057</a> <a class="code" href="group__maps.html#ga1">MAP</a> _stp_map_new(<span class="keywordtype">unsigned</span> max_entries, enum valtype type) 00058 { 00059 size_t size; -00060 <a class="code" href="structmap__root.html">MAP</a> m = (<a class="code" href="structmap__root.html">MAP</a>) <a class="code" href="group__alloc.html#ga3">_stp_valloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code" href="structmap__root.html">map_root</a>)); +00060 <a class="code" href="group__maps.html#ga1">MAP</a> m = (<a class="code" href="group__maps.html#ga1">MAP</a>) <a class="code" href="group__alloc.html#ga3">_stp_valloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_root)); 00061 <span class="keywordflow">if</span> (m == NULL) 00062 <span class="keywordflow">return</span> NULL; 00063 -00064 INIT_LIST_HEAD(&m-><a class="code" href="structmap__root.html#o4">head</a>); +00064 INIT_LIST_HEAD(&m->head); 00065 -00066 m-><a class="code" href="structmap__root.html#o1">maxnum</a> = max_entries; -00067 m-><a class="code" href="structmap__root.html#o0">type</a> = type; +00066 m->maxnum = max_entries; +00067 m->type = type; 00068 <span class="keywordflow">if</span> (type >= END) { 00069 dbug (<span class="stringliteral">"map_new: unknown type %d\n"</span>, type); 00070 <span class="keywordflow">return</span> NULL; @@ -82,37 +82,37 @@ 00075 <span class="keywordtype">int</span> i; 00076 <span class="keyword">struct </span>list_head *e; 00077 -00078 INIT_LIST_HEAD(&m-><a class="code" href="structmap__root.html#o5">pool</a>); +00078 INIT_LIST_HEAD(&m->pool); 00079 size = map_sizes[type]; 00080 tmp = <a class="code" href="group__alloc.html#ga3">_stp_valloc</a>(max_entries * size); 00081 00082 <span class="keywordflow">for</span> (i = max_entries - 1; i >= 0; i--) { 00083 e = i * size + tmp; 00084 dbug (<span class="stringliteral">"e=%lx\n"</span>, (<span class="keywordtype">long</span>)e); -00085 list_add(e, &m-><a class="code" href="structmap__root.html#o5">pool</a>); +00085 list_add(e, &m->pool); 00086 } -00087 m-><a class="code" href="structmap__root.html#o14">membuf</a> = tmp; +00087 m->membuf = tmp; 00088 } 00089 <span class="keywordflow">return</span> m; 00090 } 00091 -00092 <span class="keyword">static</span> <span class="keywordtype">void</span> map_free_strings(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *n) +00092 <span class="keyword">static</span> <span class="keywordtype">void</span> map_free_strings(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keyword">struct</span> map_node *n) 00093 { 00094 <span class="keyword">struct </span>map_node_str *m = (<span class="keyword">struct </span>map_node_str *)n; 00095 dbug (<span class="stringliteral">"n = %lx\n"</span>, (<span class="keywordtype">long</span>)n); -00096 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o0">type</a> == STRING) { -00097 dbug (<span class="stringliteral">"val STRING %lx\n"</span>, (<span class="keywordtype">long</span>)m-><a class="code" href="structmap__node__str.html#o1">str</a>); -00098 <span class="keywordflow">if</span> (m-><a class="code" href="structmap__node__str.html#o1">str</a>) +00096 <span class="keywordflow">if</span> (map->type == STRING) { +00097 dbug (<span class="stringliteral">"val STRING %lx\n"</span>, (<span class="keywordtype">long</span>)m->str); +00098 <span class="keywordflow">if</span> (m->str) 00099 _stp_free(m->str); 00100 } 00101 if (m->n.key1type == STR) { -00102 dbug (<span class="stringliteral">"key1 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="group__maps.html#ga24">key1str</a>(m)); -00103 <span class="keywordflow">if</span> (<a class="code" href="group__maps.html#ga24">key1str</a>(m)) +00102 dbug (<span class="stringliteral">"key1 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="group__maps.html#ga25">key1str</a>(m)); +00103 <span class="keywordflow">if</span> (<a class="code" href="group__maps.html#ga25">key1str</a>(m)) 00104 _stp_free(key1str(m)); 00105 } 00106 if (m->n.key2type == STR) { -00107 dbug (<span class="stringliteral">"key2 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="group__maps.html#ga25">key2str</a>(m)); -00108 <span class="keywordflow">if</span> (<a class="code" href="group__maps.html#ga25">key2str</a>(m)) +00107 dbug (<span class="stringliteral">"key2 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="group__maps.html#ga26">key2str</a>(m)); +00108 <span class="keywordflow">if</span> (<a class="code" href="group__maps.html#ga26">key2str</a>(m)) 00109 _stp_free(key2str(m)); 00110 } 00111 } @@ -122,9 +122,9 @@ 00115 <span class="comment"> * @param map </span> 00116 <span class="comment"> */</span> 00117 -<a name="l00118"></a><a class="code" href="group__maps.html#ga4">00118</a> <span class="keywordtype">void</span> _stp_map_key_del(<a class="code" href="structmap__root.html">MAP</a> map) +<a name="l00118"></a><a class="code" href="group__maps.html#ga4">00118</a> <span class="keywordtype">void</span> _stp_map_key_del(<a class="code" href="group__maps.html#ga1">MAP</a> map) 00119 { -00120 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *m; +00120 <span class="keyword">struct </span>map_node *m; 00121 00122 dbug (<span class="stringliteral">"create=%d key=%lx\n"</span>, map->create, (<span class="keywordtype">long</span>)map->key); 00123 <span class="keywordflow">if</span> (map == NULL) @@ -139,19 +139,19 @@ 00132 <span class="keywordflow">if</span> (map->key == NULL) 00133 <span class="keywordflow">return</span>; 00134 -00135 m = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)map->key; +00135 m = (<span class="keyword">struct </span>map_node *)map->key; 00136 00137 <span class="comment">/* remove node from old hash list */</span> -00138 hlist_del_init(&m-><a class="code" href="structmap__node.html#o1">hnode</a>); +00138 hlist_del_init(&m->hnode); 00139 00140 <span class="comment">/* remove from entry list */</span> -00141 list_del(&m-><a class="code" href="structmap__node.html#o0">lnode</a>); +00141 list_del(&m->lnode); 00142 00143 <span class="comment">/* remove any allocated string storage */</span> -00144 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)map->key); +00144 map_free_strings(map, (<span class="keyword">struct</span> map_node *)map->key); 00145 00146 <span class="keywordflow">if</span> (map->maxnum) -00147 list_add(&m-><a class="code" href="structmap__node.html#o0">lnode</a>, &map->pool); +00147 list_add(&m->lnode, &map->pool); 00148 <span class="keywordflow">else</span> 00149 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(m); 00150 @@ -167,17 +167,17 @@ 00160 <span class="comment"> * @sa foreach</span> 00161 <span class="comment"> */</span> 00162 -<a name="l00163"></a><a class="code" href="group__maps.html#ga5">00163</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="group__maps.html#ga5">_stp_map_start</a>(<a class="code" href="structmap__root.html">MAP</a> map) +<a name="l00163"></a><a class="code" href="group__maps.html#ga5">00163</a> <span class="keyword">struct </span>map_node *<a class="code" href="group__maps.html#ga5">_stp_map_start</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) 00164 { 00165 <span class="keywordflow">if</span> (map == NULL) 00166 <span class="keywordflow">return</span> NULL; 00167 -00168 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o4">head</a>.next); +00168 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map->head.next); 00169 -00170 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) +00170 <span class="keywordflow">if</span> (list_empty(&map->head)) 00171 <span class="keywordflow">return</span> NULL; 00172 -00173 <span class="keywordflow">return</span> (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; +00173 <span class="keywordflow">return</span> (<span class="keyword">struct</span> map_node *)map->head.next; 00174 } 00175 <span class="comment"></span> 00176 <span class="comment">/** Get the next element in a map.</span> @@ -190,18 +190,18 @@ 00183 <span class="comment"> * @sa foreach</span> 00184 <span class="comment"> */</span> 00185 -<a name="l00186"></a><a class="code" href="group__maps.html#ga6">00186</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="group__maps.html#ga6">_stp_map_iter</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *m) +<a name="l00186"></a><a class="code" href="group__maps.html#ga6">00186</a> <span class="keyword">struct </span>map_node *<a class="code" href="group__maps.html#ga6">_stp_map_iter</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keyword">struct</span> map_node *m) 00187 { 00188 <span class="keywordflow">if</span> (map == NULL) 00189 <span class="keywordflow">return</span> NULL; 00190 00191 dbug (<span class="stringliteral">"%lx next=%lx prev=%lx map->head.next=%lx\n"</span>, (<span class="keywordtype">long</span>)m, -00192 (<span class="keywordtype">long</span>)m->lnode.next, (<span class="keywordtype">long</span>)m->lnode.prev, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o4">head</a>.next); +00192 (<span class="keywordtype">long</span>)m->lnode.next, (<span class="keywordtype">long</span>)m->lnode.prev, (<span class="keywordtype">long</span>)map->head.next); 00193 -00194 <span class="keywordflow">if</span> (m->lnode.next == &map-><a class="code" href="structmap__root.html#o4">head</a>) +00194 <span class="keywordflow">if</span> (m->lnode.next == &map->head) 00195 <span class="keywordflow">return</span> NULL; 00196 -00197 <span class="keywordflow">return</span> (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m-><a class="code" href="structmap__node.html#o0">lnode</a>.next; +00197 <span class="keywordflow">return</span> (<span class="keyword">struct</span> map_node *)m->lnode.next; 00198 } 00199 <span class="comment"></span> 00200 <span class="comment">/** Deletes a map.</span> @@ -209,19 +209,19 @@ 00202 <span class="comment"> * @param map</span> 00203 <span class="comment"> */</span> 00204 -<a name="l00205"></a><a class="code" href="group__maps.html#ga7">00205</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga7">_stp_map_del</a>(<a class="code" href="structmap__root.html">MAP</a> map) +<a name="l00205"></a><a class="code" href="group__maps.html#ga7">00205</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga7">_stp_map_del</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) 00206 { 00207 <span class="keywordflow">if</span> (map == NULL) 00208 <span class="keywordflow">return</span>; 00209 -00210 <span class="keywordflow">if</span> (!list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) { -00211 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *ptr = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00212 <span class="keywordflow">while</span> (ptr && ptr != (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)&map-><a class="code" href="structmap__root.html#o4">head</a>) { +00210 <span class="keywordflow">if</span> (!list_empty(&map->head)) { +00211 <span class="keyword">struct </span>map_node *ptr = (<span class="keyword">struct </span>map_node *)map->head.next; +00212 <span class="keywordflow">while</span> (ptr && ptr != (<span class="keyword">struct</span> map_node *)&map->head) { 00213 map_free_strings(map, ptr); -00214 ptr = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)ptr-><a class="code" href="structmap__node.html#o0">lnode</a>.next; +00214 ptr = (<span class="keyword">struct </span>map_node *)ptr->lnode.next; 00215 } 00216 } -00217 <a class="code" href="group__alloc.html#ga5">_stp_vfree</a>(map-><a class="code" href="structmap__root.html#o14">membuf</a>); +00217 <a class="code" href="group__alloc.html#ga5">_stp_vfree</a>(map->membuf); 00218 <a class="code" href="group__alloc.html#ga5">_stp_vfree</a>(map); 00219 } 00220 @@ -237,7 +237,7 @@ 00230 <span class="comment"> * @param key2 second key</span> 00231 <span class="comment"> */</span> 00232 -<a name="l00233"></a><a class="code" href="group__maps.html#ga8">00233</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga8">_stp_map_key_long_long</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">long</span> key1, <span class="keywordtype">long</span> key2) +<a name="l00233"></a><a class="code" href="group__maps.html#ga8">00233</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga8">_stp_map_key_long_long</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">long</span> key1, <span class="keywordtype">long</span> key2) 00234 { 00235 <span class="keywordtype">unsigned</span> hv; 00236 <span class="keyword">struct </span>hlist_head *head; @@ -247,28 +247,28 @@ 00240 <span class="keywordflow">return</span>; 00241 00242 hv = hash_long(key1 ^ key2, HASH_TABLE_BITS); -00243 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +00243 head = &map->hashes[hv]; 00244 00245 dbug (<span class="stringliteral">"hash for %ld,%ld is %d\n"</span>, key1, key2, hv); 00246 00247 hlist_for_each(e, head) { -00248 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00249 (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); -00250 dbug (<span class="stringliteral">"n =%lx key=%ld,%ld\n"</span>, (<span class="keywordtype">long</span>)n, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o0">val</a>, n->key2.<a class="code" href="unionkey__data.html#o0">val</a>); +00248 <span class="keyword">struct </span>map_node *n = +00249 (<span class="keyword">struct </span>map_node *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); +00250 dbug (<span class="stringliteral">"n =%lx key=%ld,%ld\n"</span>, (<span class="keywordtype">long</span>)n, n->key1.val, n->key2.val); 00251 <span class="keywordflow">if</span> (key1 == n->key1.val && key2 == n->key2.val) { -00252 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00253 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00254 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; +00252 map->key = n; +00253 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00254 map->create = 0; 00255 <span class="keywordflow">return</span>; 00256 } 00257 } 00258 -00259 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key1; -00260 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key2; -00261 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = LONG; -00262 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = LONG; -00263 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00264 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; +00259 map->c_key1.val = key1; +00260 map->c_key2.val = key2; +00261 map->c_key1type = LONG; +00262 map->c_key2type = LONG; +00263 map->c_keyhead = head; +00264 map->create = 1; 00265 } 00266 <span class="comment"></span> 00267 <span class="comment">/** Set the map's key to two strings.</span> @@ -280,7 +280,7 @@ 00273 <span class="comment"> * @param key2 second key</span> 00274 <span class="comment"> */</span> 00275 -<a name="l00276"></a><a class="code" href="group__maps.html#ga9">00276</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga9">_stp_map_key_str_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *key1, <span class="keywordtype">char</span> *key2) +<a name="l00276"></a><a class="code" href="group__maps.html#ga9">00276</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga9">_stp_map_key_str_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">char</span> *key1, <span class="keywordtype">char</span> *key2) 00277 { 00278 <span class="keywordtype">unsigned</span> hv; 00279 <span class="keyword">struct </span>hlist_head *head; @@ -290,34 +290,34 @@ 00283 <span class="keywordflow">return</span>; 00284 00285 <span class="keywordflow">if</span> (key1 == NULL) { -00286 map-><a class="code" href="structmap__root.html#o6">key</a> = NULL; +00286 map->key = NULL; 00287 <span class="keywordflow">return</span>; 00288 } 00289 00290 hv = string_hash(key1, key2); -00291 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +00291 head = &map->hashes[hv]; 00292 00293 dbug (<span class="stringliteral">"hash for %s,%s is %d\n"</span>, key1, key2, hv); 00294 00295 hlist_for_each(e, head) { -00296 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00297 (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); -00298 dbug (<span class="stringliteral">"e =%lx key=%s,%s\n"</span>, (<span class="keywordtype">long</span>)e, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>,n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>); -00299 <span class="keywordflow">if</span> (strcmp(key1, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>) == 0 -00300 && (key2 == NULL || strcmp(key2, n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>) == 0)) { -00301 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00302 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00303 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; +00296 <span class="keyword">struct </span>map_node *n = +00297 (<span class="keyword">struct </span>map_node *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); +00298 dbug (<span class="stringliteral">"e =%lx key=%s,%s\n"</span>, (<span class="keywordtype">long</span>)e, n->key1.str,n->key2.str); +00299 <span class="keywordflow">if</span> (strcmp(key1, n->key1.str) == 0 +00300 && (key2 == NULL || strcmp(key2, n->key2.str) == 0)) { +00301 map->key = n; +00302 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00303 map->create = 0; 00304 <span class="keywordflow">return</span>; 00305 } 00306 } 00307 -00308 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key1; -00309 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key2; -00310 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = STR; -00311 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = STR; -00312 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00313 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; +00308 map->c_key1.str = key1; +00309 map->c_key2.str = key2; +00310 map->c_key1type = STR; +00311 map->c_key2type = STR; +00312 map->c_keyhead = head; +00313 map->create = 1; 00314 } 00315 <span class="comment"></span> 00316 <span class="comment">/** Set the map's key to a string and a long.</span> @@ -329,7 +329,7 @@ 00322 <span class="comment"> * @param key2 second key</span> 00323 <span class="comment"> */</span> 00324 -<a name="l00325"></a><a class="code" href="group__maps.html#ga10">00325</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga10">_stp_map_key_str_long</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *key1, <span class="keywordtype">long</span> key2) +<a name="l00325"></a><a class="code" href="group__maps.html#ga10">00325</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga10">_stp_map_key_str_long</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">char</span> *key1, <span class="keywordtype">long</span> key2) 00326 { 00327 <span class="keywordtype">unsigned</span> hv; 00328 <span class="keyword">struct </span>hlist_head *head; @@ -339,33 +339,33 @@ 00332 <span class="keywordflow">return</span>; 00333 00334 <span class="keywordflow">if</span> (key1 == NULL) { -00335 map-><a class="code" href="structmap__root.html#o6">key</a> = NULL; +00335 map->key = NULL; 00336 <span class="keywordflow">return</span>; 00337 } 00338 00339 hv = mixed_hash(key1, key2); -00340 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +00340 head = &map->hashes[hv]; 00341 00342 dbug (<span class="stringliteral">"hash for %s,%ld is %d\n"</span>, key1, key2, hv); 00343 00344 hlist_for_each(e, head) { -00345 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00346 (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); -00347 dbug (<span class="stringliteral">"e =%lx key=%s,%ld\n"</span>, (<span class="keywordtype">long</span>)e, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>,(<span class="keywordtype">long</span>)n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o0">val</a>); -00348 <span class="keywordflow">if</span> (strcmp(key1, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>) == 0 && key2 == n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o0">val</a>) { -00349 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00350 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00351 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; +00345 <span class="keyword">struct </span>map_node *n = +00346 (<span class="keyword">struct </span>map_node *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); +00347 dbug (<span class="stringliteral">"e =%lx key=%s,%ld\n"</span>, (<span class="keywordtype">long</span>)e, n->key1.str,(<span class="keywordtype">long</span>)n->key2.val); +00348 <span class="keywordflow">if</span> (strcmp(key1, n->key1.str) == 0 && key2 == n->key2.val) { +00349 map->key = n; +00350 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00351 map->create = 0; 00352 <span class="keywordflow">return</span>; 00353 } 00354 } 00355 -00356 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key1; -00357 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key2; -00358 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = STR; -00359 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = LONG; -00360 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00361 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; +00356 map->c_key1.str = key1; +00357 map->c_key2.val = key2; +00358 map->c_key1type = STR; +00359 map->c_key2type = LONG; +00360 map->c_keyhead = head; +00361 map->create = 1; 00362 } 00363 <span class="comment"></span> 00364 <span class="comment">/** Set the map's key to a long and a string.</span> @@ -377,7 +377,7 @@ 00370 <span class="comment"> * @param key2 second key</span> 00371 <span class="comment"> */</span> 00372 -<a name="l00373"></a><a class="code" href="group__maps.html#ga11">00373</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga11">_stp_map_key_long_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">long</span> key1, <span class="keywordtype">char</span> *key2) +<a name="l00373"></a><a class="code" href="group__maps.html#ga11">00373</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga11">_stp_map_key_long_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">long</span> key1, <span class="keywordtype">char</span> *key2) 00374 { 00375 <span class="keywordtype">unsigned</span> hv; 00376 <span class="keyword">struct </span>hlist_head *head; @@ -387,27 +387,27 @@ 00380 <span class="keywordflow">return</span>; 00381 00382 hv = mixed_hash(key2, key1); -00383 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +00383 head = &map->hashes[hv]; 00384 dbug (<span class="stringliteral">"hash for %ld,%s is %d\n"</span>, key1, key2, hv); 00385 00386 hlist_for_each(e, head) { -00387 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00388 (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); -00389 dbug (<span class="stringliteral">"e =%lx key=%ld,%s\n"</span>, (<span class="keywordtype">long</span>)e, n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o0">val</a>,n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>); -00390 <span class="keywordflow">if</span> (key1 == n-><a class="code" href="structmap__node.html#o2">key1</a>.<a class="code" href="unionkey__data.html#o0">val</a> && strcmp(key2, n-><a class="code" href="structmap__node.html#o3">key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>) == 0) { -00391 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00392 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00393 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; +00387 <span class="keyword">struct </span>map_node *n = +00388 (<span class="keyword">struct </span>map_node *)((long)e - <span class="keyword">sizeof</span>(<span class="keyword">struct </span>hlist_node)); +00389 dbug (<span class="stringliteral">"e =%lx key=%ld,%s\n"</span>, (<span class="keywordtype">long</span>)e, n->key1.val,n->key2.str); +00390 <span class="keywordflow">if</span> (key1 == n->key1.val && strcmp(key2, n->key2.str) == 0) { +00391 map->key = n; +00392 dbug (<span class="stringliteral">"saving key %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00393 map->create = 0; 00394 <span class="keywordflow">return</span>; 00395 } 00396 } 00397 -00398 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key1; -00399 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key2; -00400 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = LONG; -00401 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = STR; -00402 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00403 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; +00398 map->c_key1.val = key1; +00399 map->c_key2.str = key2; +00400 map->c_key1type = LONG; +00401 map->c_key2type = STR; +00402 map->c_keyhead = head; +00403 map->create = 1; 00404 } 00405 <span class="comment"></span> 00406 <span class="comment">/** Set the map's key to a string.</span> @@ -418,12 +418,12 @@ 00411 <span class="comment"> * @param key</span> 00412 <span class="comment"> */</span> 00413 -<a name="l00414"></a><a class="code" href="group__maps.html#ga12">00414</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *key) +<a name="l00414"></a><a class="code" href="group__maps.html#ga12">00414</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">char</span> *key) 00415 { 00416 <span class="keywordflow">if</span> (map == NULL) 00417 <span class="keywordflow">return</span>; 00418 <a class="code" href="group__maps.html#ga9">_stp_map_key_str_str</a>(map, key, NULL); -00419 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = NONE; +00419 map->c_key2type = NONE; 00420 } 00421 <span class="comment"></span> 00422 <span class="comment">/** Set the map's key to a long.</span> @@ -434,55 +434,55 @@ 00427 <span class="comment"> * @param key </span> 00428 <span class="comment"> */</span> 00429 -<a name="l00430"></a><a class="code" href="group__maps.html#ga13">00430</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">long</span> key) +<a name="l00430"></a><a class="code" href="group__maps.html#ga13">00430</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">long</span> key) 00431 { 00432 <span class="keywordflow">if</span> (map == NULL) 00433 <span class="keywordflow">return</span>; 00434 <a class="code" href="group__maps.html#ga8">_stp_map_key_long_long</a>(map, key, 0); -00435 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = NONE; +00435 map->c_key2type = NONE; 00436 } 00437 00438 <span class="comment">/********************** SET/GET VALUES *********************/</span> 00439 -00440 <span class="keyword">static</span> <span class="keywordtype">void</span> map_copy_keys(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *m) +00440 <span class="keyword">static</span> <span class="keywordtype">void</span> map_copy_keys(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keyword">struct</span> map_node *m) 00441 { -00442 m->key1type = map-><a class="code" href="structmap__root.html#o8">c_key1type</a>; -00443 m->key2type = map-><a class="code" href="structmap__root.html#o9">c_key2type</a>; -00444 <span class="keywordflow">switch</span> (map-><a class="code" href="structmap__root.html#o8">c_key1type</a>) { +00442 m->key1type = map->c_key1type; +00443 m->key2type = map->c_key2type; +00444 <span class="keywordflow">switch</span> (map->c_key1type) { 00445 <span class="keywordflow">case</span> STR: -00446 m->key1.str = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>) + 1); -00447 strcpy(m->key1.str, map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a>); +00446 m->key1.str = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(map->c_key1.str) + 1); +00447 strcpy(m->key1.str, map->c_key1.str); 00448 <span class="keywordflow">break</span>; 00449 <span class="keywordflow">case</span> LONG: -00450 m->key1.val = map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o0">val</a>; +00450 m->key1.val = map->c_key1.val; 00451 <span class="keywordflow">break</span>; 00452 <span class="keywordflow">case</span> NONE: 00453 <span class="comment">/* ERROR */</span> 00454 <span class="keywordflow">break</span>; 00455 } -00456 <span class="keywordflow">switch</span> (map-><a class="code" href="structmap__root.html#o9">c_key2type</a>) { +00456 <span class="keywordflow">switch</span> (map->c_key2type) { 00457 <span class="keywordflow">case</span> STR: -00458 m->key2.<a class="code" href="unionkey__data.html#o1">str</a> = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>) + 1); -00459 strcpy(m->key2.str, map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a>); +00458 m->key2.str = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(map->c_key2.str) + 1); +00459 strcpy(m->key2.str, map->c_key2.str); 00460 <span class="keywordflow">break</span>; 00461 <span class="keywordflow">case</span> LONG: -00462 m->key2.<a class="code" href="unionkey__data.html#o0">val</a> = map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o0">val</a>; +00462 m->key2.val = map->c_key2.val; 00463 <span class="keywordflow">break</span>; 00464 <span class="keywordflow">case</span> NONE: 00465 <span class="keywordflow">break</span>; 00466 } 00467 00468 <span class="comment">/* add node to new hash list */</span> -00469 hlist_add_head(&m->hnode, map-><a class="code" href="structmap__root.html#o10">c_keyhead</a>); +00469 hlist_add_head(&m->hnode, map->c_keyhead); 00470 -00471 map-><a class="code" href="structmap__root.html#o6">key</a> = m; -00472 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00473 map-><a class="code" href="structmap__root.html#o2">num</a>++; +00471 map->key = m; +00472 map->create = 0; +00473 map->num++; 00474 } 00475 -00476 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_map_set_int64(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val, <span class="keywordtype">int</span> add) +00476 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_map_set_int64(<a class="code" href="group__maps.html#ga1">MAP</a> map, int64_t val, <span class="keywordtype">int</span> add) 00477 { -00478 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *m; +00478 <span class="keyword">struct </span>map_node_int64 *m; 00479 00480 <span class="keywordflow">if</span> (map == NULL) 00481 return; @@ -492,38 +492,38 @@ 00485 return; 00486 00487 if (map->maxnum) { -00488 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00489 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { +00488 <span class="keywordflow">if</span> (list_empty(&map->pool)) { +00489 <span class="keywordflow">if</span> (map->no_wrap) { 00490 <span class="comment">/* ERROR. FIXME */</span> 00491 <span class="keywordflow">return</span>; 00492 } -00493 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00494 hlist_del_init(&m-><a class="code" href="structmap__node__int64.html#o0">n</a>.<a class="code" href="structmap__node.html#o1">hnode</a>); -00495 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); +00493 m = (<span class="keyword">struct </span>map_node_int64 *)map->head.next; +00494 hlist_del_init(&m->n.hnode); +00495 map_free_strings(map, (<span class="keyword">struct</span> map_node *)m); 00496 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); 00497 } <span class="keywordflow">else</span> { -00498 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *)map-><a class="code" href="structmap__root.html#o5">pool</a>.next; +00498 m = (<span class="keyword">struct </span>map_node_int64 *)map->pool.next; 00499 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); 00500 } -00501 list_move_tail(&m-><a class="code" href="structmap__node__int64.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); +00501 list_move_tail(&m->n.lnode, &map->head); 00502 } <span class="keywordflow">else</span> { -00503 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *) -00504 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code" href="structmap__node__int64.html">map_node_int64</a>)); +00503 m = (<span class="keyword">struct </span>map_node_int64 *) +00504 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_int64)); 00505 <span class="comment">/* add node to list */</span> -00506 list_add_tail(&m-><a class="code" href="structmap__node__int64.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); +00506 list_add_tail(&m->n.lnode, &map->head); 00507 } 00508 00509 <span class="comment">/* copy the key(s) */</span> -00510 map_copy_keys(map, &m-><a class="code" href="structmap__node__int64.html#o0">n</a>); +00510 map_copy_keys(map, &m->n); 00511 00512 <span class="comment">/* set the value */</span> -00513 m-><a class="code" href="structmap__node__int64.html#o1">val</a> = val; +00513 m->val = val; 00514 } <span class="keywordflow">else</span> { -00515 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) +00515 <span class="keywordflow">if</span> (map->key == NULL) 00516 return; 00517 00518 if (val) { -00519 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *)map-><a class="code" href="structmap__root.html#o6">key</a>; +00519 m = (<span class="keyword">struct </span>map_node_int64 *)map->key; 00520 <span class="keywordflow">if</span> (add) 00521 m->val += val; 00522 else @@ -544,345 +544,377 @@ 00537 <span class="comment"> * @param map</span> 00538 <span class="comment"> * @param val new value</span> 00539 <span class="comment"> * @sa _stp_map_add_int64</span> -00540 <span class="comment"> */</span> -<a name="l00541"></a><a class="code" href="group__maps.html#ga16">00541</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00542 { -00543 __stp_map_set_int64 (map, val, 0); -00544 } -00545 -00546 <span class="comment"></span> -00547 <span class="comment">/** Adds an int64 to the current element's value.</span> -00548 <span class="comment"> * This adds an int64 to the current element's value. The map must have been created</span> -00549 <span class="comment"> * to hold int64s using _stp_map_new()</span> -00550 <span class="comment"> *</span> -00551 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00552 <span class="comment"> * is set for the map, this function does nothing.</span> -00553 <span class="comment"> * @param map</span> -00554 <span class="comment"> * @param val value</span> -00555 <span class="comment"> * @sa _stp_map_set_int64</span> -00556 <span class="comment"> */</span> -00557 -<a name="l00558"></a><a class="code" href="group__maps.html#ga17">00558</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00559 { -00560 __stp_map_set_int64 (map, val, 1); -00561 } -00562 <span class="comment"></span> -00563 <span class="comment">/** Gets the current element's value.</span> -00564 <span class="comment"> * @param map</span> -00565 <span class="comment"> * @returns The value. If the current element is not set or doesn't exist, returns 0.</span> -00566 <span class="comment"> */</span> -00567 -<a name="l00568"></a><a class="code" href="group__maps.html#ga18">00568</a> int64_t <a class="code" href="group__maps.html#ga18">_stp_map_get_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00569 { -00570 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *m; -00571 <span class="keywordflow">if</span> (map == NULL || map-><a class="code" href="structmap__root.html#o7">create</a> || map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00572 <span class="keywordflow">return</span> 0; -00573 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00574 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00575 <span class="keywordflow">return</span> m-><a class="code" href="structmap__node__int64.html#o1">val</a>; -00576 } -00577 <span class="comment"></span> -00578 <span class="comment">/** Set the current element's value to a string.</span> -00579 <span class="comment"> * This sets the current element's value to an string. The map must have been created</span> -00580 <span class="comment"> * to hold int64s using <i>_stp_map_new(xxx, STRING)</i></span> -00581 <span class="comment"> *</span> -00582 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00583 <span class="comment"> * is set for the map, this function does nothing.</span> -00584 <span class="comment"> * @param map</span> -00585 <span class="comment"> * @param val new string</span> -00586 <span class="comment"> */</span> -00587 -<a name="l00588"></a><a class="code" href="group__maps.html#ga19">00588</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *val) -00589 { -00590 <span class="keyword">struct </span>map_node_str *m; -00591 -00592 <span class="keywordflow">if</span> (map == NULL) -00593 <span class="keywordflow">return</span>; -00594 -00595 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00596 <span class="keywordflow">if</span> (val == NULL) -00597 <span class="keywordflow">return</span>; -00598 -00599 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) { -00600 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00601 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { -00602 <span class="comment">/* ERROR. FIXME */</span> -00603 <span class="keywordflow">return</span>; -00604 } -00605 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00606 hlist_del_init(&m-><a class="code" href="structmap__node__str.html#o0">n</a>.<a class="code" href="structmap__node.html#o1">hnode</a>); -00607 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); -00608 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); -00609 } <span class="keywordflow">else</span> { -00610 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o5">pool</a>.next; -00611 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); -00612 } -00613 list_move_tail(&m-><a class="code" href="structmap__node__str.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); -00614 } <span class="keywordflow">else</span> { -00615 m = (<span class="keyword">struct </span>map_node_str *) -00616 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_str)); -00617 <span class="comment">/* add node to list */</span> -00618 list_add_tail(&m-><a class="code" href="structmap__node__str.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); -00619 } -00620 -00621 <span class="comment">/* copy the key(s) */</span> -00622 map_copy_keys(map, &m-><a class="code" href="structmap__node__str.html#o0">n</a>); -00623 -00624 <span class="comment">/* set the value */</span> -00625 m-><a class="code" href="structmap__node__str.html#o1">str</a> = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(val) + 1); -00626 strcpy(m-><a class="code" href="structmap__node__str.html#o1">str</a>, val); -00627 } <span class="keywordflow">else</span> { -00628 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00629 <span class="keywordflow">return</span>; -00630 -00631 <span class="keywordflow">if</span> (val) { -00632 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00633 <span class="keywordflow">if</span> (m-><a class="code" href="structmap__node__str.html#o1">str</a>) -00634 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(m-><a class="code" href="structmap__node__str.html#o1">str</a>); -00635 m-><a class="code" href="structmap__node__str.html#o1">str</a> = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(val) + 1); -00636 strcpy(m-><a class="code" href="structmap__node__str.html#o1">str</a>, val); -00637 } <span class="keywordflow">else</span> { -00638 <span class="comment">/* setting value to 0 is the same as deleting */</span> -00639 <a class="code" href="group__maps.html#ga4">_stp_map_key_del</a>(map); -00640 } -00641 } -00642 } -00643 <span class="comment"></span> -00644 <span class="comment">/** Gets the current element's value.</span> -00645 <span class="comment"> * @param map</span> -00646 <span class="comment"> * @returns A string pointer. If the current element is not set or doesn't exist, returns NULL.</span> -00647 <span class="comment"> */</span> -00648 -<a name="l00649"></a><a class="code" href="group__maps.html#ga20">00649</a> <span class="keywordtype">char</span> *<a class="code" href="group__maps.html#ga20">_stp_map_get_str</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00650 { -00651 <span class="keyword">struct </span>map_node_str *m; -00652 <span class="keywordflow">if</span> (map == NULL || map-><a class="code" href="structmap__root.html#o7">create</a> || map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00653 <span class="keywordflow">return</span> NULL; -00654 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00655 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00656 <span class="keywordflow">return</span> m-><a class="code" href="structmap__node__str.html#o1">str</a>; -00657 } -00658 <span class="comment"></span> -00659 <span class="comment">/** Set the current element's value to a stat.</span> -00660 <span class="comment"> * This sets the current element's value to an stat struct. The map must have been created</span> -00661 <span class="comment"> * to hold stats using <i>_stp_map_new(xxx, STAT)</i>. This function would only be used</span> -00662 <span class="comment"> * if we wanted to set stats to something other than the normal initial values (count = 0,</span> -00663 <span class="comment"> * sum = 0, etc). It may be deleted if it doesn't turn out to be useful.</span> -00664 <span class="comment"> * @sa _stp_map_stat_add </span> -00665 <span class="comment"> *</span> -00666 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00667 <span class="comment"> * is set for the map, this function does nothing.</span> -00668 <span class="comment"> * @param map</span> -00669 <span class="comment"> * @param stats pointer to stats struct.</span> -00670 <span class="comment"> * @todo Histograms don't work yet.</span> -00671 <span class="comment"> */</span> -00672 -<a name="l00673"></a><a class="code" href="group__maps.html#ga21">00673</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga21">_stp_map_set_stat</a>(<a class="code" href="structmap__root.html">MAP</a> map, <a class="code" href="structstat.html">stat</a> * stats) -00674 { -00675 <span class="keyword">struct </span>map_node_stat *m; -00676 -00677 <span class="keywordflow">if</span> (map == NULL) -00678 <span class="keywordflow">return</span>; -00679 dbug (<span class="stringliteral">"set_stat %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00680 -00681 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00682 <span class="keywordflow">if</span> (stats == NULL) -00683 <span class="keywordflow">return</span>; -00684 -00685 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) { -00686 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00687 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { -00688 <span class="comment">/* ERROR. FIXME */</span> -00689 <span class="keywordflow">return</span>; -00690 } -00691 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00692 hlist_del_init(&m-><a class="code" href="structmap__node__stat.html#o0">n</a>.<a class="code" href="structmap__node.html#o1">hnode</a>); -00693 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); -00694 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); -00695 } <span class="keywordflow">else</span> { -00696 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o5">pool</a>.next; -00697 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); -00698 } -00699 list_move_tail(&m-><a class="code" href="structmap__node__stat.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); -00700 } <span class="keywordflow">else</span> { -00701 m = (<span class="keyword">struct </span>map_node_stat *) -00702 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_stat)); -00703 <span class="comment">/* add node to list */</span> -00704 list_add_tail(&m-><a class="code" href="structmap__node__stat.html#o0">n</a>.<a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o4">head</a>); -00705 } -00706 -00707 <span class="comment">/* copy the key(s) */</span> -00708 map_copy_keys(map, &m-><a class="code" href="structmap__node__stat.html#o0">n</a>); -00709 -00710 <span class="comment">/* set the value */</span> -00711 memcpy(&m-><a class="code" href="structmap__node__stat.html#o1">stats</a>, stats, <span class="keyword">sizeof</span>(<a class="code" href="structstat.html">stat</a>)); -00712 } <span class="keywordflow">else</span> { -00713 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00714 <span class="keywordflow">return</span>; -00715 -00716 <span class="keywordflow">if</span> (stats) { -00717 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00718 memcpy(&m-><a class="code" href="structmap__node__stat.html#o1">stats</a>, stats, <span class="keyword">sizeof</span>(<a class="code" href="structstat.html">stat</a>)); -00719 } <span class="keywordflow">else</span> { -00720 <span class="comment">/* setting value to NULL is the same as deleting */</span> -00721 <a class="code" href="group__maps.html#ga4">_stp_map_key_del</a>(map); -00722 } -00723 } -00724 } -00725 <span class="comment"></span> -00726 <span class="comment">/** Gets the current element's value.</span> -00727 <span class="comment"> * @param map</span> -00728 <span class="comment"> * @returns A pointer to the stats struct. If the current element is not set </span> -00729 <span class="comment"> * or doesn't exist, returns NULL.</span> -00730 <span class="comment"> */</span> -00731 -<a name="l00732"></a><a class="code" href="group__maps.html#ga22">00732</a> <a class="code" href="structstat.html">stat</a> *<a class="code" href="group__maps.html#ga22">_stp_map_get_stat</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00733 { -00734 <span class="keyword">struct </span>map_node_stat *m; -00735 <span class="keywordflow">if</span> (map == NULL || map-><a class="code" href="structmap__root.html#o7">create</a> || map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00736 <span class="keywordflow">return</span> NULL; -00737 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00738 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00739 <span class="keywordflow">return</span> &m-><a class="code" href="structmap__node__stat.html#o1">stats</a>; -00740 } -00741 <span class="comment"></span> -00742 <span class="comment">/** Add to the current element's statistics.</span> -00743 <span class="comment"> * Increments the statistics counter by one and the sum by <i>val</i>.</span> -00744 <span class="comment"> * Adjusts minimum, maximum, and histogram.</span> -00745 <span class="comment"> *</span> -00746 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00747 <span class="comment"> * is set for the map, this function does nothing.</span> -00748 <span class="comment"> * @param map</span> -00749 <span class="comment"> * @param val value to add to the statistics</span> -00750 <span class="comment"> * @todo Histograms don't work yet.</span> -00751 <span class="comment"> */</span> -00752 -<a name="l00753"></a><a class="code" href="group__maps.html#ga23">00753</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga23">_stp_map_stat_add</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00754 { -00755 <span class="keyword">struct </span>map_node_stat *m; -00756 <span class="keywordflow">if</span> (map == NULL) -00757 <span class="keywordflow">return</span>; -00758 -00759 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00760 <a class="code" href="structstat.html">stat</a> st = { 1, val, val, val }; -00761 <span class="comment">/* histogram */</span> -00762 <a class="code" href="group__maps.html#ga21">_stp_map_set_stat</a>(map, &st); -00763 <span class="keywordflow">return</span>; -00764 } -00765 -00766 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00767 <span class="keywordflow">return</span>; -00768 -00769 dbug (<span class="stringliteral">"add_stat %lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00770 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00771 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o0">count</a>++; -00772 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o1">sum</a> += val; -00773 <span class="keywordflow">if</span> (val > m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o3">max</a>) -00774 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o3">max</a> = val; -00775 <span class="keywordflow">if</span> (val < m->stats.min) -00776 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o2">min</a> = val; -00777 <span class="comment">/* histogram */</span> -00778 } -00779 <span class="comment"></span> -00780 <span class="comment">/** @} */</span> -00781 -00782 <span class="comment">/********************** List Functions *********************/</span> -00783 <span class="comment"></span> -00784 <span class="comment">/** @addtogroup lists</span> -00785 <span class="comment"> * Lists are special cases of maps.</span> -00786 <span class="comment"> * @b Example:</span> -00787 <span class="comment"> * @include list.c</span> -00788 <span class="comment"> * @{ */</span> -00789 <span class="comment"></span> -00790 <span class="comment">/** Create a new list.</span> -00791 <span class="comment"> * A list is a map that internally has an incrementing long key for each member.</span> -00792 <span class="comment"> * Lists do not wrap if elements are added to exceed their maximum size.</span> -00793 <span class="comment"> * @param max_entries The maximum number of entries allowed. Currently that number will</span> -00794 <span class="comment"> * be preallocated. If max_entries is 0, there will be no maximum and entries</span> -00795 <span class="comment"> * will be allocated dynamically.</span> -00796 <span class="comment"> * @param type Type of values stored in this list. </span> -00797 <span class="comment"> * @return A MAP on success or NULL on failure.</span> -00798 <span class="comment"> * @sa foreach</span> -00799 <span class="comment"> */</span> -00800 -<a name="l00801"></a><a class="code" href="group__lists.html#ga0">00801</a> <a class="code" href="structmap__root.html">MAP</a> <a class="code" href="group__lists.html#ga0">_stp_list_new</a>(<span class="keywordtype">unsigned</span> max_entries, <span class="keyword">enum</span> valtype type) -00802 { -00803 <a class="code" href="structmap__root.html">MAP</a> map = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (max_entries, type); -00804 map-><a class="code" href="structmap__root.html#o3">no_wrap</a> = 1; -00805 <span class="keywordflow">return</span> map; -00806 } +00540 <span class="comment"> * @sa _stp_map_set()</span> +00541 <span class="comment"> */</span> +<a name="l00542"></a><a class="code" href="group__maps.html#ga16">00542</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, int64_t val) +00543 { +00544 __stp_map_set_int64 (map, val, 0); +00545 } +00546 +00547 <span class="comment"></span> +00548 <span class="comment">/** Adds an int64 to the current element's value.</span> +00549 <span class="comment"> * This adds an int64 to the current element's value. The map must have been created</span> +00550 <span class="comment"> * to hold int64s using _stp_map_new()</span> +00551 <span class="comment"> *</span> +00552 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00553 <span class="comment"> * is set for the map, this function does nothing.</span> +00554 <span class="comment"> * @param map</span> +00555 <span class="comment"> * @param val value</span> +00556 <span class="comment"> * @sa _stp_map_set_int64</span> +00557 <span class="comment"> */</span> +00558 +<a name="l00559"></a><a class="code" href="group__maps.html#ga17">00559</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, int64_t val) +00560 { +00561 __stp_map_set_int64 (map, val, 1); +00562 } +00563 <span class="comment"></span> +00564 <span class="comment">/** Gets the current element's value.</span> +00565 <span class="comment"> * @param map</span> +00566 <span class="comment"> * @returns The value. If the current element is not set or doesn't exist, returns 0.</span> +00567 <span class="comment"> */</span> +00568 +<a name="l00569"></a><a class="code" href="group__maps.html#ga18">00569</a> int64_t <a class="code" href="group__maps.html#ga18">_stp_map_get_int64</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) +00570 { +00571 <span class="keyword">struct </span>map_node_int64 *m; +00572 <span class="keywordflow">if</span> (map == NULL || map->create || map->key == NULL) +00573 <span class="keywordflow">return</span> 0; +00574 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00575 m = (<span class="keyword">struct </span>map_node_int64 *)map->key; +00576 <span class="keywordflow">return</span> m->val; +00577 } +00578 <span class="comment"></span> +00579 <span class="comment">/** Set the current element's value to a C string.</span> +00580 <span class="comment"> * This sets the current element's value to an C string. The map must have been created</span> +00581 <span class="comment"> * to hold int64s using <i>_stp_map_new(xxx, STRING)</i></span> +00582 <span class="comment"> *</span> +00583 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00584 <span class="comment"> * is set for the map, this function does nothing.</span> +00585 <span class="comment"> * @param map</span> +00586 <span class="comment"> * @param val new string</span> +00587 <span class="comment"> * @sa _stp_map_set()</span> +00588 <span class="comment"> */</span> +00589 +<a name="l00590"></a><a class="code" href="group__maps.html#ga19">00590</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">char</span> *val) +00591 { +00592 <span class="keyword">struct </span>map_node_str *m; +00593 +00594 <span class="keywordflow">if</span> (map == NULL) +00595 <span class="keywordflow">return</span>; +00596 +00597 <span class="keywordflow">if</span> (map->create) { +00598 <span class="keywordflow">if</span> (val == NULL) +00599 <span class="keywordflow">return</span>; +00600 +00601 <span class="keywordflow">if</span> (map->maxnum) { +00602 <span class="keywordflow">if</span> (list_empty(&map->pool)) { +00603 <span class="keywordflow">if</span> (map->no_wrap) { +00604 <span class="comment">/* ERROR. FIXME */</span> +00605 <span class="keywordflow">return</span>; +00606 } +00607 m = (<span class="keyword">struct </span>map_node_str *)map->head.next; +00608 hlist_del_init(&m->n.hnode); +00609 map_free_strings(map, (<span class="keyword">struct</span> map_node *)m); +00610 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); +00611 } <span class="keywordflow">else</span> { +00612 m = (<span class="keyword">struct </span>map_node_str *)map->pool.next; +00613 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); +00614 } +00615 list_move_tail(&m->n.lnode, &map->head); +00616 } <span class="keywordflow">else</span> { +00617 m = (<span class="keyword">struct </span>map_node_str *) +00618 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_str)); +00619 <span class="comment">/* add node to list */</span> +00620 list_add_tail(&m->n.lnode, &map->head); +00621 } +00622 +00623 <span class="comment">/* copy the key(s) */</span> +00624 map_copy_keys(map, &m->n); +00625 +00626 <span class="comment">/* set the value */</span> +00627 m->str = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(val) + 1); +00628 strcpy(m->str, val); +00629 } <span class="keywordflow">else</span> { +00630 <span class="keywordflow">if</span> (map->key == NULL) +00631 <span class="keywordflow">return</span>; +00632 +00633 <span class="keywordflow">if</span> (val) { +00634 m = (<span class="keyword">struct </span>map_node_str *)map->key; +00635 <span class="keywordflow">if</span> (m->str) +00636 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(m->str); +00637 m->str = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(strlen(val) + 1); +00638 strcpy(m->str, val); +00639 } <span class="keywordflow">else</span> { +00640 <span class="comment">/* setting value to 0 is the same as deleting */</span> +00641 <a class="code" href="group__maps.html#ga4">_stp_map_key_del</a>(map); +00642 } +00643 } +00644 } +00645 <span class="comment"></span> +00646 <span class="comment">/** Set the current element's value to String.</span> +00647 <span class="comment"> * This sets the current element's value to a String. The map must have been created</span> +00648 <span class="comment"> * to hold int64s using <i>_stp_map_new(xxx, STRING)</i></span> +00649 <span class="comment"> *</span> +00650 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00651 <span class="comment"> * is set for the map, this function does nothing.</span> +00652 <span class="comment"> * @param map</span> +00653 <span class="comment"> * @param str String containing new value.</span> +00654 <span class="comment"> * @sa _stp_map_set()</span> +00655 <span class="comment"> */</span> +00656 +<a name="l00657"></a><a class="code" href="group__maps.html#ga20">00657</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga20">_stp_map_set_string</a> (<a class="code" href="group__maps.html#ga1">MAP</a> map, String str) +00658 { +00659 <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a> (map, str->buf); +00660 } +00661 <span class="comment"></span> +00662 <span class="comment">/** Gets the current element's value.</span> +00663 <span class="comment"> * @param map</span> +00664 <span class="comment"> * @returns A string pointer. If the current element is not set or doesn't exist, returns NULL.</span> +00665 <span class="comment"> */</span> +00666 +<a name="l00667"></a><a class="code" href="group__maps.html#ga21">00667</a> <span class="keywordtype">char</span> *<a class="code" href="group__maps.html#ga21">_stp_map_get_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) +00668 { +00669 <span class="keyword">struct </span>map_node_str *m; +00670 <span class="keywordflow">if</span> (map == NULL || map->create || map->key == NULL) +00671 <span class="keywordflow">return</span> NULL; +00672 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00673 m = (<span class="keyword">struct </span>map_node_str *)map->key; +00674 <span class="keywordflow">return</span> m->str; +00675 } +00676 <span class="comment"></span> +00677 <span class="comment">/** Set the current element's value to a stat.</span> +00678 <span class="comment"> * This sets the current element's value to an stat struct. The map must have been created</span> +00679 <span class="comment"> * to hold stats using <i>_stp_map_new(xxx, STAT)</i>. This function would only be used</span> +00680 <span class="comment"> * if we wanted to set stats to something other than the normal initial values (count = 0,</span> +00681 <span class="comment"> * sum = 0, etc). It may be deleted if it doesn't turn out to be useful.</span> +00682 <span class="comment"> * @sa _stp_map_stat_add </span> +00683 <span class="comment"> *</span> +00684 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00685 <span class="comment"> * is set for the map, this function does nothing.</span> +00686 <span class="comment"> * @param map</span> +00687 <span class="comment"> * @param stats pointer to stats struct.</span> +00688 <span class="comment"> * @todo Histograms don't work yet.</span> +00689 <span class="comment"> */</span> +00690 +<a name="l00691"></a><a class="code" href="group__maps.html#ga22">00691</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga22">_stp_map_set_stat</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, stat * stats) +00692 { +00693 <span class="keyword">struct </span>map_node_stat *m; +00694 +00695 <span class="keywordflow">if</span> (map == NULL) +00696 <span class="keywordflow">return</span>; +00697 dbug (<span class="stringliteral">"set_stat %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00698 +00699 <span class="keywordflow">if</span> (map->create) { +00700 <span class="keywordflow">if</span> (stats == NULL) +00701 <span class="keywordflow">return</span>; +00702 +00703 <span class="keywordflow">if</span> (map->maxnum) { +00704 <span class="keywordflow">if</span> (list_empty(&map->pool)) { +00705 <span class="keywordflow">if</span> (map->no_wrap) { +00706 <span class="comment">/* ERROR. FIXME */</span> +00707 <span class="keywordflow">return</span>; +00708 } +00709 m = (<span class="keyword">struct </span>map_node_stat *)map->head.next; +00710 hlist_del_init(&m->n.hnode); +00711 map_free_strings(map, (<span class="keyword">struct</span> map_node *)m); +00712 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); +00713 } <span class="keywordflow">else</span> { +00714 m = (<span class="keyword">struct </span>map_node_stat *)map->pool.next; +00715 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); +00716 } +00717 list_move_tail(&m->n.lnode, &map->head); +00718 } <span class="keywordflow">else</span> { +00719 m = (<span class="keyword">struct </span>map_node_stat *) +00720 <a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_stat)); +00721 <span class="comment">/* add node to list */</span> +00722 list_add_tail(&m->n.lnode, &map->head); +00723 } +00724 +00725 <span class="comment">/* copy the key(s) */</span> +00726 map_copy_keys(map, &m->n); +00727 +00728 <span class="comment">/* set the value */</span> +00729 memcpy(&m->stats, stats, <span class="keyword">sizeof</span>(stat)); +00730 } <span class="keywordflow">else</span> { +00731 <span class="keywordflow">if</span> (map->key == NULL) +00732 <span class="keywordflow">return</span>; +00733 +00734 <span class="keywordflow">if</span> (stats) { +00735 m = (<span class="keyword">struct </span>map_node_stat *)map->key; +00736 memcpy(&m->stats, stats, <span class="keyword">sizeof</span>(stat)); +00737 } <span class="keywordflow">else</span> { +00738 <span class="comment">/* setting value to NULL is the same as deleting */</span> +00739 <a class="code" href="group__maps.html#ga4">_stp_map_key_del</a>(map); +00740 } +00741 } +00742 } +00743 <span class="comment"></span> +00744 <span class="comment">/** Gets the current element's value.</span> +00745 <span class="comment"> * @param map</span> +00746 <span class="comment"> * @returns A pointer to the stats struct. If the current element is not set </span> +00747 <span class="comment"> * or doesn't exist, returns NULL.</span> +00748 <span class="comment"> */</span> +00749 +<a name="l00750"></a><a class="code" href="group__maps.html#ga23">00750</a> stat *<a class="code" href="group__maps.html#ga23">_stp_map_get_stat</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) +00751 { +00752 <span class="keyword">struct </span>map_node_stat *m; +00753 <span class="keywordflow">if</span> (map == NULL || map->create || map->key == NULL) +00754 <span class="keywordflow">return</span> NULL; +00755 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00756 m = (<span class="keyword">struct </span>map_node_stat *)map->key; +00757 <span class="keywordflow">return</span> &m->stats; +00758 } +00759 <span class="comment"></span> +00760 <span class="comment">/** Add to the current element's statistics.</span> +00761 <span class="comment"> * Increments the statistics counter by one and the sum by <i>val</i>.</span> +00762 <span class="comment"> * Adjusts minimum, maximum, and histogram.</span> +00763 <span class="comment"> *</span> +00764 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00765 <span class="comment"> * is set for the map, this function does nothing.</span> +00766 <span class="comment"> * @param map</span> +00767 <span class="comment"> * @param val value to add to the statistics</span> +00768 <span class="comment"> * @todo Histograms don't work yet.</span> +00769 <span class="comment"> */</span> +00770 +<a name="l00771"></a><a class="code" href="group__maps.html#ga24">00771</a> <span class="keywordtype">void</span> <a class="code" href="group__maps.html#ga24">_stp_map_stat_add</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, int64_t val) +00772 { +00773 <span class="keyword">struct </span>map_node_stat *m; +00774 <span class="keywordflow">if</span> (map == NULL) +00775 <span class="keywordflow">return</span>; +00776 +00777 <span class="keywordflow">if</span> (map->create) { +00778 stat st = { 1, val, val, val }; +00779 <span class="comment">/* histogram */</span> +00780 <a class="code" href="group__maps.html#ga22">_stp_map_set_stat</a>(map, &st); +00781 <span class="keywordflow">return</span>; +00782 } +00783 +00784 <span class="keywordflow">if</span> (map->key == NULL) +00785 <span class="keywordflow">return</span>; +00786 +00787 dbug (<span class="stringliteral">"add_stat %lx\n"</span>, (<span class="keywordtype">long</span>)map->key); +00788 m = (<span class="keyword">struct </span>map_node_stat *)map->key; +00789 m->stats.count++; +00790 m->stats.sum += val; +00791 <span class="keywordflow">if</span> (val > m->stats.max) +00792 m->stats.max = val; +00793 <span class="keywordflow">if</span> (val < m->stats.min) +00794 m->stats.min = val; +00795 <span class="comment">/* histogram */</span> +00796 } +00797 <span class="comment"></span> +00798 <span class="comment">/** @} */</span> +00799 +00800 <span class="comment">/********************** List Functions *********************/</span> +00801 <span class="comment"></span> +00802 <span class="comment">/** @addtogroup lists</span> +00803 <span class="comment"> * Lists are special cases of maps.</span> +00804 <span class="comment"> * @b Example:</span> +00805 <span class="comment"> * @include list.c</span> +00806 <span class="comment"> * @{ */</span> 00807 <span class="comment"></span> -00808 <span class="comment">/** Clears a list.</span> -00809 <span class="comment"> * All elements in the list are deleted.</span> -00810 <span class="comment"> * @param map </span> -00811 <span class="comment"> */</span> -00812 -<a name="l00813"></a><a class="code" href="group__lists.html#ga1">00813</a> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga1">_stp_list_clear</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00814 { -00815 <span class="keywordflow">if</span> (map == NULL) -00816 <span class="keywordflow">return</span>; -00817 -00818 <span class="keywordflow">if</span> (!list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) { -00819 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *ptr = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00820 -00821 <span class="keywordflow">while</span> (ptr && ptr != (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)&map-><a class="code" href="structmap__root.html#o4">head</a>) { -00822 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *next = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)ptr-><a class="code" href="structmap__node.html#o0">lnode</a>.next; -00823 -00824 <span class="comment">/* remove node from old hash list */</span> -00825 hlist_del_init(&ptr-><a class="code" href="structmap__node.html#o1">hnode</a>); -00826 -00827 <span class="comment">/* remove from entry list */</span> -00828 list_del(&ptr-><a class="code" href="structmap__node.html#o0">lnode</a>); -00829 -00830 <span class="comment">/* remove any allocated string storage */</span> -00831 map_free_strings(map, ptr); -00832 -00833 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) -00834 list_add(&ptr-><a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o5">pool</a>); -00835 <span class="keywordflow">else</span> -00836 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(ptr); -00837 -00838 map-><a class="code" href="structmap__root.html#o2">num</a>--; -00839 ptr = next; -00840 } -00841 } -00842 -00843 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o2">num</a> != 0) { -00844 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"ERROR: list is supposed to be empty (has %d)\n"</span>, map-><a class="code" href="structmap__root.html#o2">num</a>); -00845 } -00846 } -00847 <span class="comment"></span> -00848 <span class="comment">/** Adds a string to a list.</span> -00849 <span class="comment"> * @param map</span> -00850 <span class="comment"> * @param str</span> -00851 <span class="comment"> */</span> -00852 -<a name="l00853"></a><a class="code" href="group__lists.html#ga2">00853</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *str) -00854 { -00855 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(map, map-><a class="code" href="structmap__root.html#o2">num</a>); -00856 <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a>(map, str); -00857 } -00858 <span class="comment"></span> -00859 <span class="comment">/** Adds an int64 to a list.</span> -00860 <span class="comment"> * @param map</span> -00861 <span class="comment"> * @param val</span> -00862 <span class="comment"> */</span> -00863 -<a name="l00864"></a><a class="code" href="group__lists.html#ga3">00864</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga3">_stp_list_add_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00865 { -00866 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(map, map-><a class="code" href="structmap__root.html#o2">num</a>); -00867 <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a>(map, val); -00868 } -00869 <span class="comment"></span> -00870 <span class="comment">/** Get the number of elements in a list.</span> -00871 <span class="comment"> * @param map</span> -00872 <span class="comment"> * @returns The number of elements in a list.</span> -00873 <span class="comment"> */</span> -00874 -<a name="l00875"></a><a class="code" href="group__lists.html#ga4">00875</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__lists.html#ga4">_stp_list_size</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00876 { -00877 <span class="keywordflow">return</span> map-><a class="code" href="structmap__root.html#o2">num</a>; -00878 }<span class="comment"></span> -00879 <span class="comment">/** @} */</span> -00880 <span class="preprocessor">#endif </span><span class="comment">/* _MAP_C_ */</span> +00808 <span class="comment">/** Create a new list.</span> +00809 <span class="comment"> * A list is a map that internally has an incrementing long key for each member.</span> +00810 <span class="comment"> * Lists do not wrap if elements are added to exceed their maximum size.</span> +00811 <span class="comment"> * @param max_entries The maximum number of entries allowed. Currently that number will</span> +00812 <span class="comment"> * be preallocated. If max_entries is 0, there will be no maximum and entries</span> +00813 <span class="comment"> * will be allocated dynamically.</span> +00814 <span class="comment"> * @param type Type of values stored in this list. </span> +00815 <span class="comment"> * @return A MAP on success or NULL on failure.</span> +00816 <span class="comment"> * @sa foreach</span> +00817 <span class="comment"> */</span> +00818 +<a name="l00819"></a><a class="code" href="group__lists.html#ga0">00819</a> <a class="code" href="group__maps.html#ga1">MAP</a> <a class="code" href="group__lists.html#ga0">_stp_list_new</a>(<span class="keywordtype">unsigned</span> max_entries, <span class="keyword">enum</span> valtype type) +00820 { +00821 <a class="code" href="group__maps.html#ga1">MAP</a> map = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (max_entries, type); +00822 map->no_wrap = 1; +00823 <span class="keywordflow">return</span> map; +00824 } +00825 <span class="comment"></span> +00826 <span class="comment">/** Clears a list.</span> +00827 <span class="comment"> * All elements in the list are deleted.</span> +00828 <span class="comment"> * @param map </span> +00829 <span class="comment"> */</span> +00830 +<a name="l00831"></a><a class="code" href="group__lists.html#ga1">00831</a> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga1">_stp_list_clear</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) +00832 { +00833 <span class="keywordflow">if</span> (map == NULL) +00834 <span class="keywordflow">return</span>; +00835 +00836 <span class="keywordflow">if</span> (!list_empty(&map->head)) { +00837 <span class="keyword">struct </span>map_node *ptr = (<span class="keyword">struct </span>map_node *)map->head.next; +00838 +00839 <span class="keywordflow">while</span> (ptr && ptr != (<span class="keyword">struct</span> map_node *)&map->head) { +00840 <span class="keyword">struct </span>map_node *next = (<span class="keyword">struct </span>map_node *)ptr->lnode.next; +00841 +00842 <span class="comment">/* remove node from old hash list */</span> +00843 hlist_del_init(&ptr->hnode); +00844 +00845 <span class="comment">/* remove from entry list */</span> +00846 list_del(&ptr->lnode); +00847 +00848 <span class="comment">/* remove any allocated string storage */</span> +00849 map_free_strings(map, ptr); +00850 +00851 <span class="keywordflow">if</span> (map->maxnum) +00852 list_add(&ptr->lnode, &map->pool); +00853 <span class="keywordflow">else</span> +00854 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(ptr); +00855 +00856 map->num--; +00857 ptr = next; +00858 } +00859 } +00860 +00861 <span class="keywordflow">if</span> (map->num != 0) { +00862 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"ERROR: list is supposed to be empty (has %d)\n"</span>, map->num); +00863 } +00864 } +00865 <span class="comment"></span> +00866 <span class="comment">/** Adds a C string to a list.</span> +00867 <span class="comment"> * @param map</span> +00868 <span class="comment"> * @param str</span> +00869 <span class="comment"> * @sa _stp_list_add()</span> +00870 <span class="comment"> */</span> +00871 +<a name="l00872"></a><a class="code" href="group__lists.html#ga2">00872</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga2">_stp_list_add_str</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, <span class="keywordtype">char</span> *str) +00873 { +00874 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(map, map->num); +00875 <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a>(map, str); +00876 } +00877 <span class="comment"></span> +00878 <span class="comment">/** Adds a String to a list.</span> +00879 <span class="comment"> * @param map</span> +00880 <span class="comment"> * @param str String to add.</span> +00881 <span class="comment"> * @sa _stp_list_add()</span> +00882 <span class="comment"> */</span> +00883 +<a name="l00884"></a><a class="code" href="group__lists.html#ga3">00884</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga3">_stp_list_add_string</a> (<a class="code" href="group__maps.html#ga1">MAP</a> map, String str) +00885 { +00886 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(map, map->num); +00887 <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a>(map, str->buf); +00888 } +00889 <span class="comment"></span> +00890 <span class="comment">/** Adds an int64 to a list.</span> +00891 <span class="comment"> * @param map</span> +00892 <span class="comment"> * @param val</span> +00893 <span class="comment"> * @sa _stp_list_add()</span> +00894 <span class="comment"> */</span> +00895 +<a name="l00896"></a><a class="code" href="group__lists.html#ga4">00896</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__lists.html#ga4">_stp_list_add_int64</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map, int64_t val) +00897 { +00898 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a>(map, map->num); +00899 <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a>(map, val); +00900 } +00901 <span class="comment"></span> +00902 <span class="comment">/** Get the number of elements in a list.</span> +00903 <span class="comment"> * @param map</span> +00904 <span class="comment"> * @returns The number of elements in a list.</span> +00905 <span class="comment"> */</span> +00906 +<a name="l00907"></a><a class="code" href="group__lists.html#ga5">00907</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__lists.html#ga5">_stp_list_size</a>(<a class="code" href="group__maps.html#ga1">MAP</a> map) +00908 { +00909 <span class="keywordflow">return</span> map->num; +00910 }<span class="comment"></span> +00911 <span class="comment">/** @} */</span> +00912 <span class="preprocessor">#endif </span><span class="comment">/* _MAP_C_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/map_8c.html b/runtime/docs/html/map_8c.html index f9bb262d..5193f3f0 100644 --- a/runtime/docs/html/map_8c.html +++ b/runtime/docs/html/map_8c.html @@ -4,88 +4,95 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>map.c File Reference</h1>Implements maps (associative arrays) and lists. <a href="#_details">More...</a> <p> <code>#include "<a class="el" href="map_8h-source.html">map.h</a>"</code><br> <code>#include "<a class="el" href="alloc_8c-source.html">alloc.c</a>"</code><br> +<code>#include "<a class="el" href="string_8c-source.html">string.c</a>"</code><br> <p> <a href="map_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga2">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga33">valtype</a> type)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga2">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga34">valtype</a> type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new map. <a href="group__maps.html#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga4">_stp_map_key_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga4">_stp_map_key_del</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes the current element. <a href="group__maps.html#ga4"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga5">_stp_map_start</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">map_node * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga5">_stp_map_start</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the first element in a map. <a href="group__maps.html#ga5"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga6">_stp_map_iter</a> (<a class="el" href="structmap__root.html">MAP</a> map, struct <a class="el" href="structmap__node.html">map_node</a> *m)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">map_node * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga6">_stp_map_iter</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, struct map_node *m)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next element in a map. <a href="group__maps.html#ga6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga7">_stp_map_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga7">_stp_map_del</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a map. <a href="group__maps.html#ga7"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga8">_stp_map_key_long_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, long key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga8">_stp_map_key_long_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key1, long key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two longs. <a href="group__maps.html#ga8"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga9">_stp_map_key_str_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, char *key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga9">_stp_map_key_str_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key1, char *key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two strings. <a href="group__maps.html#ga9"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga10">_stp_map_key_str_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, long key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga10">_stp_map_key_str_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key1, long key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string and a long. <a href="group__maps.html#ga10"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga11">_stp_map_key_long_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, char *key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga11">_stp_map_key_long_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key1, char *key2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long and a string. <a href="group__maps.html#ga11"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga12">_stp_map_key_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga12">_stp_map_key_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string. <a href="group__maps.html#ga12"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga13">_stp_map_key_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga13">_stp_map_key_long</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, long key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long. <a href="group__maps.html#ga13"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to an int64. <a href="group__maps.html#ga16"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to the current element's value. <a href="group__maps.html#ga17"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga18">_stp_map_get_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga18">_stp_map_get_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="group__maps.html#ga18"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga19">_stp_map_set_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga19">_stp_map_set_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a string. <a href="group__maps.html#ga19"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga20">_stp_map_get_str</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a C string. <a href="group__maps.html#ga19"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga20">_stp_map_set_string</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, String str)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="group__maps.html#ga20"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga21">_stp_map_set_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map, <a class="el" href="structstat.html">stat</a> *stats)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to String. <a href="group__maps.html#ga20"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga21">_stp_map_get_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="group__maps.html#ga21"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstat.html">stat</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga22">_stp_map_get_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="group__maps.html#ga21"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga22">_stp_map_set_stat</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, stat *stats)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="group__maps.html#ga22"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="group__maps.html#ga22"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">stat * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga23">_stp_map_get_stat</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Add to the current element's statistics. <a href="group__maps.html#ga23"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga0">_stp_list_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga33">valtype</a> type)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="group__maps.html#ga23"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga24">_stp_map_stat_add</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add to the current element's statistics. <a href="group__maps.html#ga24"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__maps.html#ga1">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga0">_stp_list_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga34">valtype</a> type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new list. <a href="group__lists.html#ga0"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga1">_stp_list_clear</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga1">_stp_list_clear</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clears a list. <a href="group__lists.html#ga1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga2">_stp_list_add_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga2">_stp_list_add_str</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, char *str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a C string to a list. <a href="group__lists.html#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga3">_stp_list_add_string</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, String str)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a string to a list. <a href="group__lists.html#ga2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga3">_stp_list_add_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a String to a list. <a href="group__lists.html#ga3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga4">_stp_list_add_int64</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map, int64_t val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to a list. <a href="group__lists.html#ga3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga4">_stp_list_size</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to a list. <a href="group__lists.html#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga5">_stp_list_size</a> (<a class="el" href="group__maps.html#ga1">MAP</a> map)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of elements in a list. <a href="group__lists.html#ga4"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of elements in a list. <a href="group__lists.html#ga5"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Implements maps (associative arrays) and lists. diff --git a/runtime/docs/html/map_8h-source.html b/runtime/docs/html/map_8h-source.html index 94c29074..956ac200 100644 --- a/runtime/docs/html/map_8h-source.html +++ b/runtime/docs/html/map_8h-source.html @@ -4,130 +4,130 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map.h</h1><a href="map_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _MAP_H_</span> -00002 <span class="preprocessor"></span><span class="preprocessor">#define _MAP_H_</span> -00003 <span class="preprocessor"></span><span class="comment">/* -*- linux-c -*- */</span> -00004 <span class="comment"></span> -00005 <span class="comment">/** @file map.h</span> -00006 <span class="comment"> * @brief Header file for maps and lists </span> -00007 <span class="comment"> */</span><span class="comment"></span> -00008 <span class="comment">/** @addtogroup maps </span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>map.h</h1><a href="map_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _MAP_H_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _MAP_H_</span> +00003 <span class="preprocessor"></span><span class="comment"></span> +00004 <span class="comment">/** @file map.h</span> +00005 <span class="comment"> * @brief Header file for maps and lists </span> +00006 <span class="comment"> */</span><span class="comment"></span> +00007 <span class="comment">/** @addtogroup maps </span> +00008 <span class="comment"> * @todo Needs to be made SMP-safe for when the big lock is removed from kprobes.</span> 00009 <span class="comment"> * @{ </span> 00010 <span class="comment"> */</span> 00011 00012 <span class="preprocessor">#include <linux/types.h></span> -00013 <span class="comment"></span> -00014 <span class="comment">/** Statistics are stored in this struct */</span> -<a name="l00015"></a><a class="code" href="structstat.html">00015</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ +00013 +00014 <span class="comment">/* Statistics are stored in this struct */</span> +00015 <span class="keyword">typedef</span> <span class="keyword">struct </span>{ 00016 int64_t count; 00017 int64_t sum; 00018 int64_t min, max; 00019 int64_t histogram[BUCKETS]; -00020 } <a class="code" href="structstat.html">stat</a>; -00021 <span class="comment"></span> -00022 <span class="comment">/** Keys are either longs or char * */</span> -<a name="l00023"></a><a class="code" href="unionkey__data.html">00023</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> { +00020 } stat; +00021 +00022 <span class="comment">/* Keys are either longs or char * */</span> +00023 <span class="keyword">union </span>key_data { 00024 <span class="keywordtype">long</span> val; 00025 <span class="keywordtype">char</span> *str; 00026 }; 00027 <span class="comment"></span> 00028 <span class="comment">/** keys can be longs or strings */</span> -<a name="l00029"></a><a class="code" href="group__maps.html#ga32">00029</a> <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga32">keytype</a> { NONE, LONG, STR } __attribute__ ((packed));<span class="comment"></span> +<a name="l00029"></a><a class="code" href="group__maps.html#ga33">00029</a> <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">keytype</a> { NONE, LONG, STR } __attribute__ ((packed));<span class="comment"></span> 00030 <span class="comment">/** values can be either int64, stats or strings */</span> -<a name="l00031"></a><a class="code" href="group__maps.html#ga33">00031</a> <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">valtype</a> { INT64, STAT, STRING, END }; +<a name="l00031"></a><a class="code" href="group__maps.html#ga34">00031</a> <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga34">valtype</a> { INT64, STAT, STRING, END }; 00032 -00033 <span class="comment"></span> -00034 <span class="comment">/** basic map element */</span> -<a name="l00035"></a><a class="code" href="structmap__node.html">00035</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> {<span class="comment"></span> -00036 <span class="comment"> /** list of other nodes in the map */</span> -<a name="l00037"></a><a class="code" href="structmap__node.html#o0">00037</a> <span class="keyword">struct </span>list_head lnode;<span class="comment"></span> -00038 <span class="comment"> /** list of nodes with the same hash value */</span> -<a name="l00039"></a><a class="code" href="structmap__node.html#o1">00039</a> <span class="keyword">struct </span>hlist_node hnode; -00040 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key1; -00041 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key2; -00042 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga32">keytype</a> key1type; -00043 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga32">keytype</a> key2type; +00033 +00034 <span class="comment">/* basic map element */</span> +00035 <span class="keyword">struct </span>map_node { +00036 <span class="comment">/* list of other nodes in the map */</span> +00037 <span class="keyword">struct </span>list_head lnode; +00038 <span class="comment">/* list of nodes with the same hash value */</span> +00039 <span class="keyword">struct </span>hlist_node hnode; +00040 <span class="keyword">union </span>key_data key1; +00041 <span class="keyword">union </span>key_data key2; +00042 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">keytype</a> key1type; +00043 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">keytype</a> key2type; 00044 }; -00045 <span class="comment"></span> -00046 <span class="comment">/** map element containing int64 */</span> -<a name="l00047"></a><a class="code" href="structmap__node__int64.html">00047</a> <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> { -00048 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; +00045 +00046 <span class="comment">/* map element containing int64 */</span> +00047 <span class="keyword">struct </span>map_node_int64 { +00048 <span class="keyword">struct </span>map_node n; 00049 int64_t val; 00050 }; -00051 <span class="comment"></span> -00052 <span class="comment">/** map element containing string */</span> -<a name="l00053"></a><a class="code" href="structmap__node__str.html">00053</a> <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> { -00054 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; +00051 +00052 <span class="comment">/* map element containing string */</span> +00053 <span class="keyword">struct </span>map_node_str { +00054 <span class="keyword">struct </span>map_node n; 00055 <span class="keywordtype">char</span> *str; 00056 }; -00057 <span class="comment"></span> -00058 <span class="comment">/** map element containing stats */</span> -<a name="l00059"></a><a class="code" href="structmap__node__stat.html">00059</a> <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> { -00060 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; -00061 <a class="code" href="structstat.html">stat</a> stats; +00057 +00058 <span class="comment">/* map element containing stats */</span> +00059 <span class="keyword">struct </span>map_node_stat { +00060 <span class="keyword">struct </span>map_node n; +00061 stat stats; 00062 }; -00063 <span class="comment"></span> -00064 <span class="comment">/** This structure contains all information about a map.</span> +00063 +00064 <span class="comment">/* This structure contains all information about a map.</span> 00065 <span class="comment"> * It is allocated once when _stp_map_new() is called. </span> 00066 <span class="comment"> */</span> -<a name="l00067"></a><a class="code" href="structmap__root.html">00067</a> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> {<span class="comment"></span> -00068 <span class="comment"> /** type of the values stored in the array */</span> -<a name="l00069"></a><a class="code" href="structmap__root.html#o0">00069</a> <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">valtype</a> <a class="code" href="structmap__root.html#o0">type</a>; -00070 <span class="comment"></span> -00071 <span class="comment"> /** maximum number of elements allowed in the array. */</span> -<a name="l00072"></a><a class="code" href="structmap__root.html#o1">00072</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o1">maxnum</a>; -00073 <span class="comment"></span> -00074 <span class="comment"> /** current number of used elements */</span> -<a name="l00075"></a><a class="code" href="structmap__root.html#o2">00075</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o2">num</a>; -00076 <span class="comment"></span> -00077 <span class="comment"> /** when more than maxnum elements, wrap or discard? */</span> -<a name="l00078"></a><a class="code" href="structmap__root.html#o3">00078</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o3">no_wrap</a>; -00079 <span class="comment"></span> -00080 <span class="comment"> /** linked list of current entries */</span> -<a name="l00081"></a><a class="code" href="structmap__root.html#o4">00081</a> <span class="keyword">struct </span>list_head head; -00082 <span class="comment"></span> -00083 <span class="comment"> /** pool of unused entries. Used only when entries are statically allocated</span> +00067 <span class="keyword">struct </span>map_root { +00068 <span class="comment">/* type of the values stored in the array */</span> +00069 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga34">valtype</a> type; +00070 +00071 <span class="comment">/* maximum number of elements allowed in the array. */</span> +00072 <span class="keywordtype">int</span> maxnum; +00073 +00074 <span class="comment">/* current number of used elements */</span> +00075 <span class="keywordtype">int</span> num; +00076 +00077 <span class="comment">/* when more than maxnum elements, wrap or discard? */</span> +00078 <span class="keywordtype">int</span> no_wrap; +00079 +00080 <span class="comment">/* linked list of current entries */</span> +00081 <span class="keyword">struct </span>list_head head; +00082 +00083 <span class="comment">/* pool of unused entries. Used only when entries are statically allocated</span> 00084 <span class="comment"> at startup. */</span> -<a name="l00085"></a><a class="code" href="structmap__root.html#o5">00085</a> <span class="keyword">struct </span>list_head pool; -00086 <span class="comment"></span> -00087 <span class="comment"> /** saved key entry for lookups */</span> -<a name="l00088"></a><a class="code" href="structmap__root.html#o6">00088</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="structmap__root.html#o6">key</a>; +00085 <span class="keyword">struct </span>list_head pool; +00086 +00087 <span class="comment">/* saved key entry for lookups */</span> +00088 <span class="keyword">struct </span>map_node *key; 00089 <span class="comment"></span> 00090 <span class="comment"> /** this is the creation data saved between the key functions and the</span> 00091 <span class="comment"> set/get functions </span> 00092 <span class="comment"> @todo Needs to be per-cpu data for SMP support */</span> -<a name="l00093"></a><a class="code" href="structmap__root.html#o7">00093</a> u_int8_t <a class="code" href="structmap__root.html#o7">create</a>; -00094 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga32">keytype</a> c_key1type; -00095 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga32">keytype</a> c_key2type; +00093 u_int8_t create; +00094 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">keytype</a> c_key1type; +00095 <span class="keyword">enum</span> <a class="code" href="group__maps.html#ga33">keytype</a> c_key2type; 00096 <span class="keyword">struct </span>hlist_head *c_keyhead; -00097 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key1; -00098 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key2; +00097 <span class="keyword">union </span>key_data c_key1; +00098 <span class="keyword">union </span>key_data c_key2; 00099 <span class="comment"></span> 00100 <span class="comment"> /** the hash table for this array */</span> -<a name="l00101"></a><a class="code" href="structmap__root.html#o13">00101</a> <span class="keyword">struct </span>hlist_head hashes[HASH_TABLE_SIZE]; +00101 <span class="keyword">struct </span>hlist_head hashes[HASH_TABLE_SIZE]; 00102 <span class="comment"></span> 00103 <span class="comment"> /** pointer to allocated memory space. Used for freeing memory. */</span> -<a name="l00104"></a><a class="code" href="structmap__root.html#o14">00104</a> <span class="keywordtype">void</span> *<a class="code" href="structmap__root.html#o14">membuf</a>; +00104 <span class="keywordtype">void</span> *membuf; 00105 }; 00106 <span class="comment"></span> 00107 <span class="comment">/** All maps are of this type. */</span> -<a name="l00108"></a><a class="code" href="group__maps.html#ga1">00108</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> *<a class="code" href="structmap__root.html">MAP</a>; +<a name="l00108"></a><a class="code" href="group__maps.html#ga1">00108</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>map_root *<a class="code" href="group__maps.html#ga1">MAP</a>; 00109 <span class="comment"></span> 00110 <span class="comment">/** Extracts string from key1 union */</span> -<a name="l00111"></a><a class="code" href="group__maps.html#ga24">00111</a> <span class="preprocessor">#define key1str(ptr) (ptr->n.key1.str)</span> +<a name="l00111"></a><a class="code" href="group__maps.html#ga25">00111</a> <span class="preprocessor">#define key1str(ptr) (ptr->n.key1.str)</span> 00112 <span class="preprocessor"></span><span class="comment">/** Extracts string from key2 union */</span> -<a name="l00113"></a><a class="code" href="group__maps.html#ga25">00113</a> <span class="preprocessor">#define key2str(ptr) (ptr->n.key2.str)</span> +<a name="l00113"></a><a class="code" href="group__maps.html#ga26">00113</a> <span class="preprocessor">#define key2str(ptr) (ptr->n.key2.str)</span> 00114 <span class="preprocessor"></span><span class="comment">/** Extracts int from key1 union */</span> -<a name="l00115"></a><a class="code" href="group__maps.html#ga26">00115</a> <span class="preprocessor">#define key1int(ptr) (ptr->n.key1.val)</span> +<a name="l00115"></a><a class="code" href="group__maps.html#ga27">00115</a> <span class="preprocessor">#define key1int(ptr) (ptr->n.key1.val)</span> 00116 <span class="preprocessor"></span><span class="comment">/** Extracts int from key2 union */</span> -<a name="l00117"></a><a class="code" href="group__maps.html#ga27">00117</a> <span class="preprocessor">#define key2int(ptr) (ptr->n.key2.val)</span> +<a name="l00117"></a><a class="code" href="group__maps.html#ga28">00117</a> <span class="preprocessor">#define key2int(ptr) (ptr->n.key2.val)</span> 00118 <span class="preprocessor"></span><span class="comment"></span> 00119 <span class="comment">/** Macro to call the proper _stp_map_key functions based on the</span> 00120 <span class="comment"> * types of the arguments. </span> 00121 <span class="comment"> * @note May cause compiler warning on some GCCs </span> 00122 <span class="comment"> */</span> -<a name="l00123"></a><a class="code" href="group__maps.html#ga28">00123</a> <span class="preprocessor">#define _stp_map_key2(map, key1, key2) \</span> +<a name="l00123"></a><a class="code" href="group__maps.html#ga29">00123</a> <span class="preprocessor">#define _stp_map_key2(map, key1, key2) \</span> 00124 <span class="preprocessor"> ({ \</span> 00125 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key1), char[])) \</span> 00126 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> @@ -145,7 +145,7 @@ 00138 <span class="comment"> * type of the argument. </span> 00139 <span class="comment"> * @note May cause compiler warning on some GCCs </span> 00140 <span class="comment"> */</span> -<a name="l00141"></a><a class="code" href="group__maps.html#ga29">00141</a> <span class="preprocessor">#define _stp_map_key(map, key) \</span> +<a name="l00141"></a><a class="code" href="group__maps.html#ga30">00141</a> <span class="preprocessor">#define _stp_map_key(map, key) \</span> 00142 <span class="preprocessor"> ({ \</span> 00143 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key), char[])) \</span> 00144 <span class="preprocessor"> _stp_map_key_str (map, (char *)(key)); \</span> @@ -157,41 +157,45 @@ 00150 <span class="comment"> * type of the argument. </span> 00151 <span class="comment"> * @note May cause compiler warning on some GCCs </span> 00152 <span class="comment"> */</span> -<a name="l00153"></a><a class="code" href="group__maps.html#ga30">00153</a> <span class="preprocessor">#define _stp_map_set(map, val) \</span> +<a name="l00153"></a><a class="code" href="group__maps.html#ga31">00153</a> <span class="preprocessor">#define _stp_map_set(map, val) \</span> 00154 <span class="preprocessor"> ({ \</span> -00155 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> +00155 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> 00156 <span class="preprocessor"> _stp_map_set_str (map, (char *)(val)); \</span> -00157 <span class="preprocessor"> else \</span> -00158 <span class="preprocessor"> _stp_map_set_int64 (map, (int64_t)(val)); \</span> -00159 <span class="preprocessor"> })</span> -00160 <span class="preprocessor"></span><span class="comment"></span> -00161 <span class="comment">/** Loop through all elements of a map or list.</span> -00162 <span class="comment"> * @param map </span> -00163 <span class="comment"> * @param ptr pointer to a map_node_stat, map_node_int64 or map_node_str</span> -00164 <span class="comment"> *</span> -00165 <span class="comment"> * @b Example:</span> -00166 <span class="comment"> * @include foreach.c</span> -00167 <span class="comment"> */</span> -00168 -<a name="l00169"></a><a class="code" href="group__maps.html#ga31">00169</a> <span class="preprocessor">#define foreach(map, ptr) \</span> -00170 <span class="preprocessor"> for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \</span> -00171 <span class="preprocessor"> ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))</span> -00172 <span class="preprocessor"></span><span class="comment"></span> -00173 <span class="comment">/** @} */</span> -00174 <span class="comment"></span> -00175 <span class="comment">/** @ingroup lists</span> -00176 <span class="comment"> * @brief Macro to call the proper _stp_list_add function based on the</span> -00177 <span class="comment"> * types of the argument. </span> -00178 <span class="comment"> *</span> -00179 <span class="comment"> * @note May cause compiler warning on some GCCs </span> -00180 <span class="comment"> */</span> -<a name="l00181"></a><a class="code" href="group__lists.html#ga5">00181</a> <span class="preprocessor">#define _stp_list_add(map, val) \</span> -00182 <span class="preprocessor"> ({ \</span> -00183 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> -00184 <span class="preprocessor"> _stp_list_add_str (map, (char *)(val)); \</span> -00185 <span class="preprocessor"> else \</span> -00186 <span class="preprocessor"> _stp_list_add_int64 (map, (int64_t)(val)); \</span> -00187 <span class="preprocessor"> })</span> -00188 <span class="preprocessor"></span> -00189 <span class="preprocessor">#endif </span><span class="comment">/* _MAP_H_ */</span> +00157 <span class="preprocessor"> else if (__builtin_types_compatible_p (typeof (val), String)) \</span> +00158 <span class="preprocessor"> _stp_map_set_string (map, (String)(val)); \</span> +00159 <span class="preprocessor"> else \</span> +00160 <span class="preprocessor"> _stp_map_set_int64 (map, (int64_t)(val)); \</span> +00161 <span class="preprocessor"> })</span> +00162 <span class="preprocessor"></span><span class="comment"></span> +00163 <span class="comment">/** Loop through all elements of a map or list.</span> +00164 <span class="comment"> * @param map </span> +00165 <span class="comment"> * @param ptr pointer to a map_node_stat, map_node_int64 or map_node_str</span> +00166 <span class="comment"> *</span> +00167 <span class="comment"> * @b Example:</span> +00168 <span class="comment"> * @include foreach.c</span> +00169 <span class="comment"> */</span> +00170 +<a name="l00171"></a><a class="code" href="group__maps.html#ga32">00171</a> <span class="preprocessor">#define foreach(map, ptr) \</span> +00172 <span class="preprocessor"> for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \</span> +00173 <span class="preprocessor"> ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))</span> +00174 <span class="preprocessor"></span><span class="comment"></span> +00175 <span class="comment">/** @} */</span> +00176 <span class="comment"></span> +00177 <span class="comment">/** @ingroup lists</span> +00178 <span class="comment"> * @brief Macro to call the proper _stp_list_add function based on the</span> +00179 <span class="comment"> * types of the argument. </span> +00180 <span class="comment"> *</span> +00181 <span class="comment"> * @note May cause compiler warning on some GCCs </span> +00182 <span class="comment"> */</span> +<a name="l00183"></a><a class="code" href="group__lists.html#ga6">00183</a> <span class="preprocessor">#define _stp_list_add(map, val) \</span> +00184 <span class="preprocessor"> ({ \</span> +00185 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> +00186 <span class="preprocessor"> _stp_list_add_str (map, (char *)(val)); \</span> +00187 <span class="preprocessor"> else if (__builtin_types_compatible_p (typeof (val), String)) \</span> +00188 <span class="preprocessor"> _stp_list_add_string (map, (String)(val)); \</span> +00189 <span class="preprocessor"> else \</span> +00190 <span class="preprocessor"> _stp_list_add_int64 (map, (int64_t)(val)); \</span> +00191 <span class="preprocessor"> })</span> +00192 <span class="preprocessor"></span> +00193 <span class="preprocessor">#endif </span><span class="comment">/* _MAP_H_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/map_8h.html b/runtime/docs/html/map_8h.html index 8bede3a0..23b5430b 100644 --- a/runtime/docs/html/map_8h.html +++ b/runtime/docs/html/map_8h.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>map.h File Reference</h1>Header file for maps and lists. <a href="#_details">More...</a> <p> <code>#include <linux/types.h></code><br> @@ -13,50 +13,50 @@ <a href="map_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="map.h::key1str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga24">key1str</a>(ptr) (ptr->n.key1.str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="map.h::key1str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga25">key1str</a>(ptr) (ptr->n.key1.str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key1 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="map.h::key2str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga25">key2str</a>(ptr) (ptr->n.key2.str)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="map.h::key2str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga26">key2str</a>(ptr) (ptr->n.key2.str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key2 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="map.h::key1int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga26">key1int</a>(ptr) (ptr->n.key1.val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="map.h::key1int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga27">key1int</a>(ptr) (ptr->n.key1.val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key1 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="map.h::key2int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga27">key2int</a>(ptr) (ptr->n.key2.val)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="map.h::key2int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga28">key2int</a>(ptr) (ptr->n.key2.val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key2 union. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga28">_stp_map_key2</a>(map, key1, key2)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga29">_stp_map_key2</a>(map, key1, key2)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key functions based on the types of the arguments. <a href="group__maps.html#ga28"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga29">_stp_map_key</a>(map, key)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key functions based on the types of the arguments. <a href="group__maps.html#ga29"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga30">_stp_map_key</a>(map, key)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key function based on the type of the argument. <a href="group__maps.html#ga29"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga30">_stp_map_set</a>(map, val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key function based on the type of the argument. <a href="group__maps.html#ga30"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga31">_stp_map_set</a>(map, val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_set function based on the type of the argument. <a href="group__maps.html#ga30"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga31">foreach</a>(map, ptr)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_set function based on the type of the argument. <a href="group__maps.html#ga31"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga32">foreach</a>(map, ptr)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Loop through all elements of a map or list. <a href="group__maps.html#ga31"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga5">_stp_list_add</a>(map, val)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Loop through all elements of a map or list. <a href="group__maps.html#ga32"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lists.html#ga6">_stp_list_add</a>(map, val)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_list_add function based on the types of the argument. <a href="group__lists.html#ga5"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_list_add function based on the types of the argument. <a href="group__lists.html#ga6"></a><br></td></tr> <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="map.h::MAP"></a> -typedef <a class="el" href="structmap__root.html">map_root</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga1">MAP</a></td></tr> +typedef map_root * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga1">MAP</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">All maps are of this type. <br></td></tr> <tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga32">keytype</a> { <b>NONE</b>, +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga33">keytype</a> { <b>NONE</b>, <b>LONG</b>, <b>STR</b> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga33">valtype</a> { <b>INT64</b>, +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga34">valtype</a> { <b>INT64</b>, <b>STAT</b>, <b>STRING</b>, <b>END</b> @@ -65,7 +65,7 @@ typedef <a class="el" href="structmap__root.html">map_root</a> * </td><td c <tr><td class="mdescLeft"> </td><td class="mdescRight">values can be either int64, stats or strings <br></td></tr> <tr><td colspan="2"><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="map.h::packed"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga0">packed</a></td></tr> +enum <a class="el" href="group__maps.html#ga33">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga0">packed</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> </table> diff --git a/runtime/docs/html/modules.html b/runtime/docs/html/modules.html index 32f1541b..1c46a1f7 100644 --- a/runtime/docs/html/modules.html +++ b/runtime/docs/html/modules.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindexHL" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindexHL" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>SystemTap Modules</h1>Here is a list of all modules:<ul> <li><a class="el" href="group__alloc.html">Memory Functions</a> <li><a class="el" href="group__copy.html">Functions to copy from user space.</a> @@ -12,8 +12,9 @@ <li><a class="el" href="group__io.html">I/O</a> <li><a class="el" href="group__maps.html">Maps</a> <li><a class="el" href="group__lists.html">Lists</a> -<li><a class="el" href="group__scbuf.html">Scratch Buffer</a> +<li><a class="el" href="group__print.html">Print Buffer</a> <li><a class="el" href="group__stack.html">Stack Tracing Functions</a> +<li><a class="el" href="group__string.html">String Functions</a> <li><a class="el" href="group__sym.html">Symbolic Functions</a> </ul> </body></html> diff --git a/runtime/docs/html/pages.html b/runtime/docs/html/pages.html index bca54ad4..e1ceb057 100644 --- a/runtime/docs/html/pages.html +++ b/runtime/docs/html/pages.html @@ -4,11 +4,13 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindexHL" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindexHL" href="pages.html">Related Pages</a></div> <h1>SystemTap Related Pages</h1>Here is a list of all related documentation pages:<ul> <li><a class="el" href="todo.html">Todo List</a> <li><a class="el" href="bug.html">Bug List</a> +<li><a class="el" href="deprecated.html">Deprecated List</a> + </ul> </body></html> diff --git a/runtime/docs/html/print_8c-source.html b/runtime/docs/html/print_8c-source.html new file mode 100644 index 00000000..c020fff3 --- /dev/null +++ b/runtime/docs/html/print_8c-source.html @@ -0,0 +1,208 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: print.c Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>print.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _PRINT_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _PRINT_C_</span> +00003 <span class="preprocessor"></span> +00004 <span class="preprocessor">#include <linux/config.h></span> +00005 +00006 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span> +00007 <span class="comment"></span> +00008 <span class="comment">/** @file print.c</span> +00009 <span class="comment"> * @addtogroup print Print Buffer</span> +00010 <span class="comment"> * Print Buffer Functions.</span> +00011 <span class="comment"> * The print buffer is for collecting output to send to the user daemon.</span> +00012 <span class="comment"> * This is a per-cpu static buffer. The buffer is sent when</span> +00013 <span class="comment"> * _stp_print_flush() is called.</span> +00014 <span class="comment"> *</span> +00015 <span class="comment"> * The reason to do this is to allow multiple small prints to be combined then</span> +00016 <span class="comment"> * timestamped and sent together to stpd. It could flush automatically on newlines,</span> +00017 <span class="comment"> * but what about stack traces which span many lines? So try this and see how it works for us.</span> +00018 <span class="comment"> * @{</span> +00019 <span class="comment"> */</span> +00020 <span class="comment"></span> +00021 <span class="comment">/** Size of buffer, not including terminating NULL */</span> +<a name="l00022"></a><a class="code" href="group__print.html#ga8">00022</a> <span class="preprocessor">#define STP_PRINT_BUF_LEN 8000</span> +00023 <span class="preprocessor"></span> +00024 <span class="keyword">static</span> <span class="keywordtype">int</span> _stp_pbuf_len[NR_CPUS]; +00025 +00026 <span class="preprocessor">#ifdef STP_NETLINK_ONLY</span> +00027 <span class="preprocessor"></span><span class="preprocessor">#define STP_PRINT_BUF_START 0</span> +00028 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> _stp_pbuf[NR_CPUS][<a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> + 1]; +00029 +00030 <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga2">_stp_print_flush</a> (<span class="keywordtype">void</span>) +00031 { +00032 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00033 <span class="keywordtype">char</span> *buf = &_stp_pbuf[cpu][0]; +00034 <span class="keywordtype">int</span> len = _stp_pbuf_len[cpu]; +00035 +00036 <span class="keywordflow">if</span> (len == 0) +00037 <span class="keywordflow">return</span>; +00038 +00039 <span class="keywordflow">if</span> ( app.logging == 0) { +00040 _stp_pbuf_len[cpu] = 0; +00041 <span class="keywordflow">return</span>; +00042 } +00043 +00044 <span class="comment">/* enforce newline at end */</span> +00045 <span class="keywordflow">if</span> (buf[len - 1] != <span class="charliteral">'\n'</span>) { +00046 buf[len++] = <span class="charliteral">'\n'</span>; +00047 buf[len] = <span class="charliteral">'\0'</span>; +00048 } +00049 +00050 send_reply (STP_REALTIME_DATA, buf, len + 1, stpd_pid); +00051 _stp_pbuf_len[cpu] = 0; +00052 } +00053 +00054 <span class="preprocessor">#else </span><span class="comment">/* ! STP_NETLINK_ONLY */</span> +00055 <span class="comment">/* size of timestamp, in bytes, including space */</span> +00056 <span class="preprocessor">#define TIMESTAMP_SIZE 19</span> +00057 <span class="preprocessor"></span><span class="preprocessor">#define STP_PRINT_BUF_START (TIMESTAMP_SIZE + 1)</span> +00058 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> _stp_pbuf[NR_CPUS][<a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> + STP_PRINT_BUF_START + 1]; +00059 <span class="comment"></span> +00060 <span class="comment">/** Send the print buffer now.</span> +00061 <span class="comment"> * Output accumulates in the print buffer until this is called.</span> +00062 <span class="comment"> * Size is limited by length of print buffer, #STP_PRINT_BUF_LEN.</span> +00063 <span class="comment"> */</span> +00064 +<a name="l00065"></a><a class="code" href="group__print.html#ga2">00065</a> <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga2">_stp_print_flush</a> (<span class="keywordtype">void</span>) +00066 { +00067 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00068 <span class="keywordtype">char</span> *buf = &_stp_pbuf[cpu][0]; +00069 <span class="keywordtype">char</span> *ptr = buf + STP_PRINT_BUF_START; +00070 <span class="keyword">struct </span>timeval tv; +00071 +00072 <span class="keywordflow">if</span> (_stp_pbuf_len[cpu] == 0) +00073 <span class="keywordflow">return</span>; +00074 +00075 <span class="comment">/* enforce newline at end */</span> +00076 <span class="keywordflow">if</span> (ptr[_stp_pbuf_len[cpu]-1] != <span class="charliteral">'\n'</span>) { +00077 ptr[_stp_pbuf_len[cpu]++] = <span class="charliteral">'\n'</span>; +00078 ptr[_stp_pbuf_len[cpu]] = <span class="charliteral">'\0'</span>; +00079 } +00080 +00081 do_gettimeofday(&tv); +00082 scnprintf (buf, TIMESTAMP_SIZE+1, <span class="stringliteral">"[%li.%06li] "</span>, tv.tv_sec, tv.tv_usec); +00083 buf[TIMESTAMP_SIZE] = <span class="charliteral">' '</span>; +00084 relayapp_write(buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 2); +00085 _stp_pbuf_len[cpu] = 0; +00086 } +00087 <span class="preprocessor">#endif </span><span class="comment">/* STP_NETLINK_ONLY */</span> +00088 <span class="comment"></span> +00089 <span class="comment">/** Print into the print buffer.</span> +00090 <span class="comment"> * Like printf, except output goes to the print buffer.</span> +00091 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> +00092 <span class="comment"> * Size is limited by length of print buffer, #STP_PRINT_BUF_LEN.</span> +00093 <span class="comment"> * </span> +00094 <span class="comment"> * @param fmt A printf-style format string followed by a </span> +00095 <span class="comment"> * variable number of args.</span> +00096 <span class="comment"> * @sa _stp_print_flush()</span> +00097 <span class="comment"> */</span> +00098 +<a name="l00099"></a><a class="code" href="group__print.html#ga3">00099</a> <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) +00100 { +00101 <span class="keywordtype">int</span> num; +00102 va_list args; +00103 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00104 <span class="keywordtype">char</span> *buf = &_stp_pbuf[cpu][STP_PRINT_BUF_START] + _stp_pbuf_len[cpu]; +00105 va_start(args, fmt); +00106 num = vscnprintf(buf, <a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> - _stp_pbuf_len[cpu], fmt, args); +00107 va_end(args); +00108 <span class="keywordflow">if</span> (num > 0) +00109 _stp_pbuf_len[cpu] += num; +00110 } +00111 <span class="comment"></span> +00112 <span class="comment">/** Print into the print buffer.</span> +00113 <span class="comment"> * Use this if your function already has a va_list.</span> +00114 <span class="comment"> * You probably want _stp_printf().</span> +00115 <span class="comment"> */</span> +00116 +<a name="l00117"></a><a class="code" href="group__print.html#ga4">00117</a> <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga4">_stp_vprintf</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, va_list args) +00118 { +00119 <span class="keywordtype">int</span> num; +00120 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00121 <span class="keywordtype">char</span> *buf = &_stp_pbuf[cpu][STP_PRINT_BUF_START] + _stp_pbuf_len[cpu]; +00122 num = vscnprintf(buf, <a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> -_stp_pbuf_len[cpu], fmt, args); +00123 <span class="keywordflow">if</span> (num > 0) +00124 _stp_pbuf_len[cpu] += num; +00125 } +00126 <span class="comment"></span> +00127 <span class="comment">/** Write a C string into the print buffer.</span> +00128 <span class="comment"> * Copies a string into a print buffer.</span> +00129 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> +00130 <span class="comment"> * Size is limited by length of print buffer, #STP_PRINT_BUF_LEN.</span> +00131 <span class="comment"> * This is more efficient than using _stp_printf() if you don't</span> +00132 <span class="comment"> * need fancy formatting.</span> +00133 <span class="comment"> *</span> +00134 <span class="comment"> * @param str A C string.</span> +00135 <span class="comment"> * @sa _stp_print</span> +00136 <span class="comment"> */</span> +00137 +<a name="l00138"></a><a class="code" href="group__print.html#ga5">00138</a> <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga5">_stp_print_cstr</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *str) +00139 { +00140 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00141 <span class="keywordtype">char</span> *buf = &_stp_pbuf[cpu][STP_PRINT_BUF_START] + _stp_pbuf_len[cpu]; +00142 <span class="keywordtype">int</span> num = strlen (str); +00143 <span class="keywordflow">if</span> (num > <a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> - _stp_pbuf_len[cpu]) +00144 num = <a class="code" href="group__print.html#ga8">STP_PRINT_BUF_LEN</a> - _stp_pbuf_len[cpu]; +00145 strncpy (buf, str, num+1); +00146 _stp_pbuf_len[cpu] += num; +00147 } +00148 <span class="comment"></span> +00149 <span class="comment">/** Clear the scratch buffer.</span> +00150 <span class="comment"> * This function should be called before anything is written to </span> +00151 <span class="comment"> * the scratch buffer. Output will accumulate in the buffer</span> +00152 <span class="comment"> * until this function is called again. </span> +00153 <span class="comment"> * @returns A pointer to the buffer.</span> +00154 <span class="comment"> */</span> +00155 +<a name="l00156"></a><a class="code" href="group__print.html#ga6">00156</a> <span class="keywordtype">char</span> *<a class="code" href="group__print.html#ga6">_stp_print_clear</a> (<span class="keywordtype">void</span>) +00157 { +00158 <span class="keywordtype">int</span> cpu = smp_processor_id(); +00159 _stp_pbuf_len[cpu] = 0; +00160 <span class="keywordflow">return</span> &_stp_pbuf[cpu][STP_PRINT_BUF_START]; +00161 } +00162 +00163 <span class="preprocessor">#include "<a class="code" href="string_8c.html">string.c</a>"</span> +00164 <span class="comment"></span> +00165 <span class="comment">/** Write a String into the print buffer.</span> +00166 <span class="comment"> * Copies a String into a print buffer.</span> +00167 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> +00168 <span class="comment"> * Size is limited by length of print buffer, #STP_PRINT_BUF_LEN.</span> +00169 <span class="comment"> * This is more efficient than using _stp_printf() if you don't</span> +00170 <span class="comment"> * need fancy formatting.</span> +00171 <span class="comment"> *</span> +00172 <span class="comment"> * @param str A String.</span> +00173 <span class="comment"> * @sa _stp_print</span> +00174 <span class="comment"> */</span> +00175 +<a name="l00176"></a><a class="code" href="group__print.html#ga7">00176</a> <span class="keywordtype">void</span> <a class="code" href="group__print.html#ga7">_stp_print_string</a> (String str) +00177 { +00178 <span class="keywordflow">if</span> (str->len) +00179 <a class="code" href="group__print.html#ga5">_stp_print_cstr</a> (str->buf); +00180 } +00181 <span class="comment"></span> +00182 <span class="comment">/** Write a String or C string into the print buffer.</span> +00183 <span class="comment"> * This macro selects the proper function to call.</span> +00184 <span class="comment"> * @param str A String or C string (char *)</span> +00185 <span class="comment"> * @sa _stp_print_cstr _stp_print_string</span> +00186 <span class="comment"> */</span> +00187 +<a name="l00188"></a><a class="code" href="group__print.html#ga11">00188</a> <span class="preprocessor">#define _stp_print(str) \</span> +00189 <span class="preprocessor"> ({ \</span> +00190 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (str), char[])) { \</span> +00191 <span class="preprocessor"> char *x = (char *)str; \</span> +00192 <span class="preprocessor"> _stp_print_cstr(x); \</span> +00193 <span class="preprocessor"> } else { \</span> +00194 <span class="preprocessor"> String x = (String)str; \</span> +00195 <span class="preprocessor"> _stp_print_string(x); \</span> +00196 <span class="preprocessor"> } \</span> +00197 <span class="preprocessor"> })</span> +00198 <span class="preprocessor"></span><span class="comment"></span> +00199 <span class="comment">/** @} */</span> +00200 <span class="preprocessor">#endif </span><span class="comment">/* _PRINT_C_ */</span> +</pre></div></body></html> diff --git a/runtime/docs/html/probes.html b/runtime/docs/html/probes.html deleted file mode 100644 index b25bf2c7..00000000 --- a/runtime/docs/html/probes.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: Example Probes</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1><a class="anchor" name="probes">Example Probes</a></h1><hr size="1"><address style="align: right;"><small> -Generated on Mon Mar 21 23:24:22 2005 for SystemTap.</small></body> -</html> diff --git a/runtime/docs/html/probes_2README-source.html b/runtime/docs/html/probes_2README-source.html index 572047bc..ee82281f 100644 --- a/runtime/docs/html/probes_2README-source.html +++ b/runtime/docs/html/probes_2README-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a></div> <h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @dir probes</span> diff --git a/runtime/docs/html/probes_2shellsnoop_2README-source.html b/runtime/docs/html/probes_2shellsnoop_2README-source.html index f629ded8..e7384ecb 100644 --- a/runtime/docs/html/probes_2shellsnoop_2README-source.html +++ b/runtime/docs/html/probes_2shellsnoop_2README-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000001.html">shellsnoop</a></div> <h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @dir shellsnoop</span> @@ -34,7 +34,7 @@ 00025 <span class="keywordflow">if</span> (!strcmp(current->comm,<span class="stringliteral">"bash"</span>) || !strcmp(current->comm,<span class="stringliteral">"sh"</span>) || !strcmp(current->comm, <span class="stringliteral">"zsh"</span>) 00026 || !strcmp(current->comm, <span class="stringliteral">"tcsh"</span>) || !strcmp(current->comm, <span class="stringliteral">"pdksh"</span>)) 00027 { -00028 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); +00028 dlog (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); 00029 @pids[current->pid] = 1; 00030 00031 <span class="comment">/* print out argv, ignoring argv[0] */</span> @@ -74,7 +74,7 @@ 00065 else len = 64; 00066 if (len = dtr_strncpy_from_user(str, buf, len)) { 00067 str[len] = 0; -00068 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tW %s\n"</span>, current->pid, current->parent->pid, current->comm, str); +00068 dlog (<span class="stringliteral">"%d\t%d\t%s\tW %s\n"</span>, current->pid, current->parent->pid, current->comm, str); 00069 } 00070 } 00071 } diff --git a/runtime/docs/html/probes_2tasklet_2README-source.html b/runtime/docs/html/probes_2tasklet_2README-source.html index 7d09aa4e..d49f0a1f 100644 --- a/runtime/docs/html/probes_2tasklet_2README-source.html +++ b/runtime/docs/html/probes_2tasklet_2README-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000002.html">tasklet</a></div> <h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @dir tasklet</span> diff --git a/runtime/docs/html/probes_2test4_2README-source.html b/runtime/docs/html/probes_2test4_2README-source.html index 69aa4539..20ebcf80 100644 --- a/runtime/docs/html/probes_2test4_2README-source.html +++ b/runtime/docs/html/probes_2test4_2README-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000003.html">test4</a></div> <h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @dir test4</span> diff --git a/runtime/docs/html/probes_2where__func_2README-source.html b/runtime/docs/html/probes_2where__func_2README-source.html index 6f9699ad..eb81beda 100644 --- a/runtime/docs/html/probes_2where__func_2README-source.html +++ b/runtime/docs/html/probes_2where__func_2README-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000004.html">where_func</a></div> <h1>README</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/** @dir where_func</span> diff --git a/runtime/docs/html/probes_8c-source.html b/runtime/docs/html/probes_8c-source.html index ab2b831b..6084bad3 100644 --- a/runtime/docs/html/probes_8c-source.html +++ b/runtime/docs/html/probes_8c-source.html @@ -4,107 +4,110 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>probes.c</h1><a href="probes_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file probes.c</span> -00003 <span class="comment"> * @brief Functions to assist loading and unloading groups of probes.</span> -00004 <span class="comment"> */</span> -00005 <span class="comment"></span> -00006 <span class="comment">/** Lookup name.</span> -00007 <span class="comment"> * This simply calls the kernel function kallsyms_lookup_name().</span> -00008 <span class="comment"> * That function is not exported, so this workaround is required.</span> -00009 <span class="comment"> * See the kernel source, kernel/kallsyms.c for more information.</span> -00010 <span class="comment"> */</span> -00011 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> long (*_stp_lookup_name)(<span class="keywordtype">char</span> *name)=(<span class="keywordtype">void</span> *)KALLSYMS_LOOKUP_NAME; -00012 <span class="comment"></span> -00013 <span class="comment">/** Unregister a group of jprobes.</span> -00014 <span class="comment"> * @param probes Pointer to an array of struct jprobe.</span> -00015 <span class="comment"> * @param num_probes Number of probes in the array.</span> -00016 <span class="comment"> */</span> -00017 -<a name="l00018"></a><a class="code" href="probes_8c.html#a1">00018</a> <span class="keywordtype">void</span> <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (<span class="keyword">struct</span> jprobe *probes, <span class="keywordtype">int</span> num_probes) -00019 { -00020 <span class="keywordtype">int</span> i; -00021 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) -00022 unregister_jprobe(&probes[i]); -00023 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"All jprobes removed\n"</span>); -00024 } -00025 <span class="comment"></span> -00026 <span class="comment">/** Register a group of jprobes.</span> -00027 <span class="comment"> * @param probes Pointer to an array of struct jprobe.</span> -00028 <span class="comment"> * @param num_probes Number of probes in the array.</span> -00029 <span class="comment"> * @return 0 on success.</span> -00030 <span class="comment"> */</span> -00031 -<a name="l00032"></a><a class="code" href="probes_8c.html#a2">00032</a> <span class="keywordtype">int</span> <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (<span class="keyword">struct</span> jprobe *probes, <span class="keywordtype">int</span> num_probes) -00033 { -00034 <span class="keywordtype">int</span> i, ret ; -00035 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; -00036 -00037 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) { -00038 addr =_stp_lookup_name((<span class="keywordtype">char</span> *)probes[i].kp.addr); -00039 <span class="keywordflow">if</span> (addr == 0) { -00040 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, -00041 (<span class="keywordtype">char</span> *)probes[i].kp.addr); -00042 ret = -1; <span class="comment">/* FIXME */</span> -00043 <span class="keywordflow">goto</span> out; -00044 } -00045 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"inserting jprobe at %s (%p)\n"</span>, probes[i].kp.addr, addr); -00046 probes[i].kp.addr = (kprobe_opcode_t *)addr; -00047 ret = register_jprobe(&probes[i]); -00048 <span class="keywordflow">if</span> (ret) -00049 <span class="keywordflow">goto</span> out; -00050 } -00051 <span class="keywordflow">return</span> 0; -00052 out: -00053 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); -00054 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a>(probes, i); -00055 <span class="keywordflow">return</span> ret; -00056 } -00057 <span class="comment"></span> -00058 <span class="comment">/** Unregister a group of kprobes.</span> -00059 <span class="comment"> * @param probes Pointer to an array of struct kprobe.</span> -00060 <span class="comment"> * @param num_probes Number of probes in the array.</span> -00061 <span class="comment"> */</span> -00062 -<a name="l00063"></a><a class="code" href="probes_8c.html#a3">00063</a> <span class="keywordtype">void</span> <a class="code" href="probes_8c.html#a3">_stp_unregister_kprobes</a> (<span class="keyword">struct</span> kprobe *probes, <span class="keywordtype">int</span> num_probes) -00064 { -00065 <span class="keywordtype">int</span> i; -00066 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) -00067 unregister_kprobe(&probes[i]); -00068 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"All kprobes removed\n"</span>); -00069 } -00070 <span class="comment"></span> -00071 <span class="comment">/** Register a group of kprobes.</span> -00072 <span class="comment"> * @param probes Pointer to an array of struct kprobe.</span> -00073 <span class="comment"> * @param num_probes Number of probes in the array.</span> -00074 <span class="comment"> * @return 0 on success.</span> -00075 <span class="comment"> */</span> -00076 -<a name="l00077"></a><a class="code" href="probes_8c.html#a4">00077</a> <span class="keywordtype">int</span> <a class="code" href="probes_8c.html#a4">_stp_register_kprobes</a> (<span class="keyword">struct</span> kprobe *probes, <span class="keywordtype">int</span> num_probes) -00078 { -00079 <span class="keywordtype">int</span> i, ret ; -00080 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; -00081 -00082 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) { -00083 addr =_stp_lookup_name((<span class="keywordtype">char</span> *)probes[i].addr); -00084 <span class="keywordflow">if</span> (addr == 0) { -00085 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, -00086 (<span class="keywordtype">char</span> *)probes[i].addr); -00087 ret = -1; <span class="comment">/* FIXME */</span> -00088 <span class="keywordflow">goto</span> out; -00089 } -00090 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"inserting kprobe at %s (%p)\n"</span>, probes[i].addr, addr); -00091 probes[i].addr = (kprobe_opcode_t *)addr; -00092 ret = register_kprobe(&probes[i]); -00093 <span class="keywordflow">if</span> (ret) -00094 <span class="keywordflow">goto</span> out; -00095 } -00096 <span class="keywordflow">return</span> 0; -00097 out: -00098 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); -00099 <a class="code" href="probes_8c.html#a3">_stp_unregister_kprobes</a>(probes, i); -00100 <span class="keywordflow">return</span> ret; -00101 } -00102 +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>probes.c</h1><a href="probes_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _PROBES_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _PROBES_C</span> +00003 <span class="preprocessor"></span><span class="comment"></span> +00004 <span class="comment">/** @file probes.c</span> +00005 <span class="comment"> * @brief Functions to assist loading and unloading groups of probes.</span> +00006 <span class="comment"> */</span> +00007 <span class="comment"></span> +00008 <span class="comment">/** Lookup name.</span> +00009 <span class="comment"> * This simply calls the kernel function kallsyms_lookup_name().</span> +00010 <span class="comment"> * That function is not exported, so this workaround is required.</span> +00011 <span class="comment"> * See the kernel source, kernel/kallsyms.c for more information.</span> +00012 <span class="comment"> */</span> +00013 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> long (*_stp_lookup_name)(<span class="keywordtype">char</span> *name)=(<span class="keywordtype">void</span> *)KALLSYMS_LOOKUP_NAME; +00014 <span class="comment"></span> +00015 <span class="comment">/** Unregister a group of jprobes.</span> +00016 <span class="comment"> * @param probes Pointer to an array of struct jprobe.</span> +00017 <span class="comment"> * @param num_probes Number of probes in the array.</span> +00018 <span class="comment"> */</span> +00019 +<a name="l00020"></a><a class="code" href="probes_8c.html#a2">00020</a> <span class="keywordtype">void</span> <a class="code" href="probes_8c.html#a2">_stp_unregister_jprobes</a> (<span class="keyword">struct</span> jprobe *probes, <span class="keywordtype">int</span> num_probes) +00021 { +00022 <span class="keywordtype">int</span> i; +00023 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) +00024 unregister_jprobe(&probes[i]); +00025 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"All jprobes removed\n"</span>); +00026 } +00027 <span class="comment"></span> +00028 <span class="comment">/** Register a group of jprobes.</span> +00029 <span class="comment"> * @param probes Pointer to an array of struct jprobe.</span> +00030 <span class="comment"> * @param num_probes Number of probes in the array.</span> +00031 <span class="comment"> * @return 0 on success.</span> +00032 <span class="comment"> */</span> +00033 +<a name="l00034"></a><a class="code" href="probes_8c.html#a3">00034</a> <span class="keywordtype">int</span> <a class="code" href="probes_8c.html#a3">_stp_register_jprobes</a> (<span class="keyword">struct</span> jprobe *probes, <span class="keywordtype">int</span> num_probes) +00035 { +00036 <span class="keywordtype">int</span> i, ret ; +00037 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; +00038 +00039 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) { +00040 addr =_stp_lookup_name((<span class="keywordtype">char</span> *)probes[i].kp.addr); +00041 <span class="keywordflow">if</span> (addr == 0) { +00042 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, +00043 (<span class="keywordtype">char</span> *)probes[i].kp.addr); +00044 ret = -1; <span class="comment">/* FIXME */</span> +00045 <span class="keywordflow">goto</span> out; +00046 } +00047 <a class="code" href="group__io.html#ga2">_stp_log</a>(<span class="stringliteral">"inserting jprobe at %s (%p)\n"</span>, probes[i].kp.addr, addr); +00048 probes[i].kp.addr = (kprobe_opcode_t *)addr; +00049 ret = register_jprobe(&probes[i]); +00050 <span class="keywordflow">if</span> (ret) +00051 <span class="keywordflow">goto</span> out; +00052 } +00053 <span class="keywordflow">return</span> 0; +00054 out: +00055 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); +00056 <a class="code" href="probes_8c.html#a2">_stp_unregister_jprobes</a>(probes, i); +00057 <span class="keywordflow">return</span> ret; +00058 } +00059 <span class="comment"></span> +00060 <span class="comment">/** Unregister a group of kprobes.</span> +00061 <span class="comment"> * @param probes Pointer to an array of struct kprobe.</span> +00062 <span class="comment"> * @param num_probes Number of probes in the array.</span> +00063 <span class="comment"> */</span> +00064 +<a name="l00065"></a><a class="code" href="probes_8c.html#a4">00065</a> <span class="keywordtype">void</span> <a class="code" href="probes_8c.html#a4">_stp_unregister_kprobes</a> (<span class="keyword">struct</span> kprobe *probes, <span class="keywordtype">int</span> num_probes) +00066 { +00067 <span class="keywordtype">int</span> i; +00068 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) +00069 unregister_kprobe(&probes[i]); +00070 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"All kprobes removed\n"</span>); +00071 } +00072 <span class="comment"></span> +00073 <span class="comment">/** Register a group of kprobes.</span> +00074 <span class="comment"> * @param probes Pointer to an array of struct kprobe.</span> +00075 <span class="comment"> * @param num_probes Number of probes in the array.</span> +00076 <span class="comment"> * @return 0 on success.</span> +00077 <span class="comment"> */</span> +00078 +<a name="l00079"></a><a class="code" href="probes_8c.html#a5">00079</a> <span class="keywordtype">int</span> <a class="code" href="probes_8c.html#a5">_stp_register_kprobes</a> (<span class="keyword">struct</span> kprobe *probes, <span class="keywordtype">int</span> num_probes) +00080 { +00081 <span class="keywordtype">int</span> i, ret ; +00082 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; +00083 +00084 <span class="keywordflow">for</span> (i = 0; i < num_probes; i++) { +00085 addr =_stp_lookup_name((<span class="keywordtype">char</span> *)probes[i].addr); +00086 <span class="keywordflow">if</span> (addr == 0) { +00087 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, +00088 (<span class="keywordtype">char</span> *)probes[i].addr); +00089 ret = -1; <span class="comment">/* FIXME */</span> +00090 <span class="keywordflow">goto</span> out; +00091 } +00092 <a class="code" href="group__io.html#ga2">_stp_log</a>(<span class="stringliteral">"inserting kprobe at %s (%p)\n"</span>, probes[i].addr, addr); +00093 probes[i].addr = (kprobe_opcode_t *)addr; +00094 ret = register_kprobe(&probes[i]); +00095 <span class="keywordflow">if</span> (ret) +00096 <span class="keywordflow">goto</span> out; +00097 } +00098 <span class="keywordflow">return</span> 0; +00099 out: +00100 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); +00101 <a class="code" href="probes_8c.html#a4">_stp_unregister_kprobes</a>(probes, i); +00102 <span class="keywordflow">return</span> ret; +00103 } +00104 +00105 <span class="preprocessor">#endif </span><span class="comment">/* _PROBES_C */</span> </pre></div></body></html> diff --git a/runtime/docs/html/probes_8c.html b/runtime/docs/html/probes_8c.html index 5bdbeb43..a43b04af 100644 --- a/runtime/docs/html/probes_8c.html +++ b/runtime/docs/html/probes_8c.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>probes.c File Reference</h1>Functions to assist loading and unloading groups of probes. <a href="#_details">More...</a> <p> @@ -12,18 +12,18 @@ <a href="probes_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (struct jprobe *probes, int num_probes)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a2">_stp_unregister_jprobes</a> (struct jprobe *probes, int num_probes)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Unregister a group of jprobes. <a href="#a1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a2">_stp_register_jprobes</a> (struct jprobe *probes, int num_probes)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Unregister a group of jprobes. <a href="#a2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a3">_stp_register_jprobes</a> (struct jprobe *probes, int num_probes)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a group of jprobes. <a href="#a2"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a3">_stp_unregister_kprobes</a> (struct kprobe *probes, int num_probes)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a group of jprobes. <a href="#a3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a4">_stp_unregister_kprobes</a> (struct kprobe *probes, int num_probes)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Unregister a group of kprobes. <a href="#a3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a4">_stp_register_kprobes</a> (struct kprobe *probes, int num_probes)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Unregister a group of kprobes. <a href="#a4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a5">_stp_register_kprobes</a> (struct kprobe *probes, int num_probes)</td></tr> -<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a group of kprobes. <a href="#a4"></a><br></td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a group of kprobes. <a href="#a5"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Functions to assist loading and unloading groups of probes. @@ -31,7 +31,7 @@ Functions to assist loading and unloading groups of probes. <p> Definition in file <a class="el" href="probes_8c-source.html">probes.c</a>.<hr><h2>Function Documentation</h2> -<a class="anchor" name="a2" doxytag="probes.c::_stp_register_jprobes"></a><p> +<a class="anchor" name="a3" doxytag="probes.c::_stp_register_jprobes"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -76,12 +76,12 @@ Register a group of jprobes. <dl compact><dt><b>Returns:</b></dt><dd>0 on success. </dd></dl> <p> -Definition at line <a class="el" href="probes_8c-source.html#l00032">32</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. +Definition at line <a class="el" href="probes_8c-source.html#l00034">34</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. <p> -References <a class="el" href="probes_8c-source.html#l00018">_stp_unregister_jprobes()</a>, and <a class="el" href="io_8c-source.html#l00025">dlog()</a>. </td> +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>, and <a class="el" href="probes_8c-source.html#l00020">_stp_unregister_jprobes()</a>. </td> </tr> </table> -<a class="anchor" name="a4" doxytag="probes.c::_stp_register_kprobes"></a><p> +<a class="anchor" name="a5" doxytag="probes.c::_stp_register_kprobes"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -126,12 +126,12 @@ Register a group of kprobes. <dl compact><dt><b>Returns:</b></dt><dd>0 on success. </dd></dl> <p> -Definition at line <a class="el" href="probes_8c-source.html#l00077">77</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. +Definition at line <a class="el" href="probes_8c-source.html#l00079">79</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. <p> -References <a class="el" href="probes_8c-source.html#l00063">_stp_unregister_kprobes()</a>, and <a class="el" href="io_8c-source.html#l00025">dlog()</a>. </td> +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>, and <a class="el" href="probes_8c-source.html#l00065">_stp_unregister_kprobes()</a>. </td> </tr> </table> -<a class="anchor" name="a1" doxytag="probes.c::_stp_unregister_jprobes"></a><p> +<a class="anchor" name="a2" doxytag="probes.c::_stp_unregister_jprobes"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -175,14 +175,14 @@ Unregister a group of jprobes. </dl> <p> -Definition at line <a class="el" href="probes_8c-source.html#l00018">18</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. +Definition at line <a class="el" href="probes_8c-source.html#l00020">20</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. <p> -References <a class="el" href="io_8c-source.html#l00025">dlog()</a>. +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>. <p> -Referenced by <a class="el" href="probes_8c-source.html#l00032">_stp_register_jprobes()</a>. </td> +Referenced by <a class="el" href="probes_8c-source.html#l00034">_stp_register_jprobes()</a>. </td> </tr> </table> -<a class="anchor" name="a3" doxytag="probes.c::_stp_unregister_kprobes"></a><p> +<a class="anchor" name="a4" doxytag="probes.c::_stp_unregister_kprobes"></a><p> <table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> @@ -226,11 +226,11 @@ Unregister a group of kprobes. </dl> <p> -Definition at line <a class="el" href="probes_8c-source.html#l00063">63</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. +Definition at line <a class="el" href="probes_8c-source.html#l00065">65</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. <p> -References <a class="el" href="io_8c-source.html#l00025">dlog()</a>. +References <a class="el" href="io_8c-source.html#l00029">_stp_log()</a>. <p> -Referenced by <a class="el" href="probes_8c-source.html#l00077">_stp_register_kprobes()</a>. </td> +Referenced by <a class="el" href="probes_8c-source.html#l00079">_stp_register_kprobes()</a>. </td> </tr> </table> </body></html> diff --git a/runtime/docs/html/relay-app_8h-source.html b/runtime/docs/html/relay-app_8h-source.html new file mode 100644 index 00000000..16feefe0 --- /dev/null +++ b/runtime/docs/html/relay-app_8h-source.html @@ -0,0 +1,542 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: relay-app.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>relay-app.h</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span> +00002 <span class="comment"> * relay-app.h - kernel 'library' functions for typical relayfs applications</span> +00003 <span class="comment"> *</span> +00004 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span> +00005 <span class="comment"> * it under the terms of the GNU General Public License as published by</span> +00006 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span> +00007 <span class="comment"> * (at your option) any later version.</span> +00008 <span class="comment"> *</span> +00009 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> +00010 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> +00011 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> +00012 <span class="comment"> * GNU General Public License for more details.</span> +00013 <span class="comment"> *</span> +00014 <span class="comment"> * You should have received a copy of the GNU General Public License</span> +00015 <span class="comment"> * along with this program; if not, write to the Free Software</span> +00016 <span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span> +00017 <span class="comment"> *</span> +00018 <span class="comment"> * Copyright (C) IBM Corporation, 2005</span> +00019 <span class="comment"> *</span> +00020 <span class="comment"> * 2005-Feb Created by Tom Zanussi <zanussi@us.ibm.com></span> +00021 <span class="comment"> *</span> +00022 <span class="comment"> * This header file encapsulates the details of channel setup and</span> +00023 <span class="comment"> * teardown and communication between the kernel and user parts of a</span> +00024 <span class="comment"> * typical and common type of relayfs application, which is that</span> +00025 <span class="comment"> * kernel logging is kicked off when a userspace data collection</span> +00026 <span class="comment"> * application starts and stopped when the collection app exits, and</span> +00027 <span class="comment"> * data is automatically logged to disk in-between. Channels are</span> +00028 <span class="comment"> * created when the collection app is started and destroyed when it</span> +00029 <span class="comment"> * exits, not when the kernel module is inserted, so different channel</span> +00030 <span class="comment"> * buffer sizes can be specified for each separate run via</span> +00031 <span class="comment"> * command-line options for instance.</span> +00032 <span class="comment"> *</span> +00033 <span class="comment"> * Writing to the channel is done using 2 macros, relayapp_write() and</span> +00034 <span class="comment"> * _relayapp_write(), which are just wrappers around relay_write() and</span> +00035 <span class="comment"> * _relay_write() but without the channel param. You can safely call</span> +00036 <span class="comment"> * these at any time - if there's no channel yet, they'll just be</span> +00037 <span class="comment"> * ignored.</span> +00038 <span class="comment"> *</span> +00039 <span class="comment"> * To create a relay-app application, do the following:</span> +00040 <span class="comment"> *</span> +00041 <span class="comment"> * In your kernel module:</span> +00042 <span class="comment"> *</span> +00043 <span class="comment"> * - #include "relay-app.h"</span> +00044 <span class="comment"> *</span> +00045 <span class="comment"> * - Call init_relay_app() in your module_init function, with the</span> +00046 <span class="comment"> * names of the directory to create relayfs files in and the base name</span> +00047 <span class="comment"> * of the per-cpu relayfs files e.g. to have /mnt/relay/myapp/cpuXXX</span> +00048 <span class="comment"> * created call init_relay_app("myapp", "cpu", callbacks).</span> +00049 <span class="comment"> *</span> +00050 <span class="comment"> * NOTE: The callbacks are entirely optional - pass NULL if you</span> +00051 <span class="comment"> * don't want to define any. If you want to define some but not</span> +00052 <span class="comment"> * others, just set the ones you want, and ignore or NULL out the</span> +00053 <span class="comment"> * others.</span> +00054 <span class="comment"> *</span> +00055 <span class="comment"> * NOTE: This won't actually create the relayfs files - that will</span> +00056 <span class="comment"> * happen when the userspace application starts (i.e. you can supply</span> +00057 <span class="comment"> * the buffer sizes on the application command-line for each new run</span> +00058 <span class="comment"> * of your program).</span> +00059 <span class="comment"> *</span> +00060 <span class="comment"> * NOTE: If you pass in NULL for the directory name, the relay files</span> +00061 <span class="comment"> * will be created in the root directory of the relayfs filesystem.</span> +00062 <span class="comment"> *</span> +00063 <span class="comment"> * - Call close_relay_app() in your module_exit function - this cleans</span> +00064 <span class="comment"> * up the control channel and the relay files from the previous run,</span> +00065 <span class="comment"> * if any.</span> +00066 <span class="comment"> *</span> +00067 <span class="comment"> * - relay-apps use a control channel to communicate initialization</span> +00068 <span class="comment"> * and status information between the kernel module and user space</span> +00069 <span class="comment"> * program. This is hidden beneath the API so you normally don't need</span> +00070 <span class="comment"> * to know anything about it, but if you want you can also use it to</span> +00071 <span class="comment"> * send user-defined commands from your user space application. To do</span> +00072 <span class="comment"> * this, you need to define a definition for the user_command()</span> +00073 <span class="comment"> * callback and in the callback sort out and handle handle the</span> +00074 <span class="comment"> * commands you send from user space (via send_request()). The</span> +00075 <span class="comment"> * callback must return 1 if the command was handled, or 0 if not</span> +00076 <span class="comment"> * (which will result in a send_error in the user space program,</span> +00077 <span class="comment"> * alerting you to the fact that you're sending something bogus).</span> +00078 <span class="comment"> *</span> +00079 <span class="comment"> * NOTE: Currently commands can only be sent before the user space</span> +00080 <span class="comment"> * application enters relay_app_main_loop() i.e. for initialization</span> +00081 <span class="comment"> * purposes only.</span> +00082 <span class="comment"> *</span> +00083 <span class="comment"> * - the app_started() and app_stopped() callbacks provide an</span> +00084 <span class="comment"> * opportunity for your kernel module to perform app-specific</span> +00085 <span class="comment"> * initialization and cleanup, if desired. They are purely</span> +00086 <span class="comment"> * informational. app_started() is called when the user space</span> +00087 <span class="comment"> * application has started and app_stopped() is called when the user</span> +00088 <span class="comment"> * space application has stopped.</span> +00089 <span class="comment"> *</span> +00090 <span class="comment"> * In your user space application do the following:</span> +00091 <span class="comment"> *</span> +00092 <span class="comment"> * - Call init_relay_app() with the names of the relayfs file base</span> +00093 <span class="comment"> * name and the base filename of the output files that will be</span> +00094 <span class="comment"> * created, as well as the sub-buffer size and count for the current</span> +00095 <span class="comment"> * run (which can be passed in on the command-line if you want). This</span> +00096 <span class="comment"> * will create the channel and set up the ouptut files and buffer</span> +00097 <span class="comment"> * mappings. e.g. to set up reading from the relayfs files specified in the</span> +00098 <span class="comment"> * above example and write them to a set of per-cpu output files named</span> +00099 <span class="comment"> * myoutputXXX:</span> +00100 <span class="comment"> * </span> +00101 <span class="comment"> * init_relay_app("/mnt/relay/myapp/cpu", "myoutput",</span> +00102 <span class="comment"> * subbuf_size_opt, n_subbufs_opt, 1);</span> +00103 <span class="comment"> *</span> +00104 <span class="comment"> * (the last parameter just specifies whether or not to print out a</span> +00105 <span class="comment"> * summary of the number of buffers processed, and the maximum backlog</span> +00106 <span class="comment"> * of sub-buffers encountered e.g. if you have 4 sub-buffers, a</span> +00107 <span class="comment"> * maximum backlog of 3 would mean that you came close to having a</span> +00108 <span class="comment"> * full buffer, so you might want to use more or bigger sub-buffers</span> +00109 <span class="comment"> * next time. Of course, if the buffers actually filled up, the</span> +00110 <span class="comment"> * maximum backlog would be 4 and you'd have lost data).</span> +00111 <span class="comment"> *</span> +00112 <span class="comment"> * - Call relay_app_main_loop(). This will set up an infinite loop</span> +00113 <span class="comment"> * (press Control-C to break out and finalize the data) which</span> +00114 <span class="comment"> * automatically reads the data from the relayfs buffers as it becomes</span> +00115 <span class="comment"> * available and and writes it out to per-cpu output files.</span> +00116 <span class="comment"> *</span> +00117 <span class="comment"> * NOTE: The control channel is implemented as a netlink socket.</span> +00118 <span class="comment"> * relay-app defaults to using NETLINK_USERSOCK for all</span> +00119 <span class="comment"> * applications, which means that you can't have more than 1</span> +00120 <span class="comment"> * relay-app in use at a time, unless you use different netlink</span> +00121 <span class="comment"> * 'units' for each one. If you want to have more than one</span> +00122 <span class="comment"> * relay-app in use at a time, you can specify a different netlink</span> +00123 <span class="comment"> * 'unit' by using the _init_relay_app() versions of the</span> +00124 <span class="comment"> * init_relay_app() functions, on both the kernel and user sides,</span> +00125 <span class="comment"> * which are the same as the init_relay_app() functions but add a</span> +00126 <span class="comment"> * netlink unit param. See netlink.h for the currently unused</span> +00127 <span class="comment"> * numbers.</span> +00128 <span class="comment"> */</span> +00129 +00130 <span class="preprocessor">#include <linux/inet.h></span> +00131 <span class="preprocessor">#include <linux/ip.h></span> +00132 <span class="preprocessor">#include <linux/netlink.h></span> +00133 <span class="preprocessor">#include <linux/relayfs_fs.h></span> +00134 +00135 <span class="comment">/* relay-app pseudo-API */</span> +00136 +00137 <span class="comment">/*</span> +00138 <span class="comment"> * relay-app callbacks</span> +00139 <span class="comment"> */</span> +00140 <span class="keyword">struct </span>relay_app_callbacks +00141 { +00142 <span class="comment">/*</span> +00143 <span class="comment"> * user_command - app-specific command callback</span> +00144 <span class="comment"> * @command: user-defined command id</span> +00145 <span class="comment"> * @data: user-defined data associated with the command</span> +00146 <span class="comment"> *</span> +00147 <span class="comment"> * Return value: 1 if this callback handled it, 0 if not</span> +00148 <span class="comment"> *</span> +00149 <span class="comment"> * define this callback to handle user-defined commands sent</span> +00150 <span class="comment"> * from the user space application via send_request()</span> +00151 <span class="comment"> *</span> +00152 <span class="comment"> * NOTE: user commands must be >= RELAY_APP_USERCMD_START</span> +00153 <span class="comment"> */</span> +00154 int (*user_command) (<span class="keywordtype">int</span> command, <span class="keywordtype">void</span> *data); +00155 +00156 <span class="comment">/*</span> +00157 <span class="comment"> * app_started - the user-space application has started</span> +00158 <span class="comment"> *</span> +00159 <span class="comment"> * Do app-specific initializations now, if desired</span> +00160 <span class="comment"> */</span> +00161 void (*app_started) (void); +00162 +00163 <span class="comment">/*</span> +00164 <span class="comment"> * app_stopped - the user-space application has stopped</span> +00165 <span class="comment"> *</span> +00166 <span class="comment"> * Do app-specific cleanup now, if desired</span> +00167 <span class="comment"> */</span> +00168 void (*app_stopped) (void); +00169 }; +00170 +00171 <span class="comment">/*</span> +00172 <span class="comment"> * relay-app API functions</span> +00173 <span class="comment"> */</span> +00174 <span class="keyword">static</span> <span class="keywordtype">int</span> init_relay_app(<span class="keyword">const</span> <span class="keywordtype">char</span> *dirname, +00175 <span class="keyword">const</span> <span class="keywordtype">char</span> *file_basename, +00176 <span class="keyword">struct</span> relay_app_callbacks *callbacks); +00177 <span class="keyword">static</span> <span class="keywordtype">void</span> close_relay_app(<span class="keywordtype">void</span>); +00178 +00179 <span class="comment">/*</span> +00180 <span class="comment"> * relay-app write wrapper macros - use these instead of directly</span> +00181 <span class="comment"> * using relay_write() and _relay_write() relayfs functions.</span> +00182 <span class="comment"> */</span> +00183 <span class="preprocessor">#define relayapp_write(data, len) \</span> +00184 <span class="preprocessor"> if (app.logging) relay_write(app.chan, data, len)</span> +00185 <span class="preprocessor"></span> +00186 <span class="preprocessor">#define _relayapp_write(data, len) \</span> +00187 <span class="preprocessor"> if (app.logging) _relay_write(app.chan, data, len)</span> +00188 <span class="preprocessor"></span> +00189 <span class="comment">/* relay-app control channel command values */</span> +00190 <span class="keyword">enum</span> +00191 { +00192 RELAY_APP_BUF_INFO = 1, +00193 RELAY_APP_SUBBUFS_CONSUMED, +00194 RELAY_APP_START, +00195 RELAY_APP_STOP, +00196 RELAY_APP_CHAN_CREATE, +00197 RELAY_APP_CHAN_DESTROY, +00198 RELAY_APP_USERCMD_START = 32 +00199 }; +00200 +00201 <span class="comment">/* SystemTap extensions */</span> +00202 <span class="keyword">enum</span> +00203 { +00204 STP_REALTIME_DATA = RELAY_APP_USERCMD_START, +00205 STP_EXIT, +00206 STP_DONE +00207 }; +00208 +00209 <span class="comment">/* internal stuff below here */</span> +00210 +00211 <span class="comment">/* netlink control channel */</span> +00212 <span class="keyword">static</span> <span class="keyword">struct </span>sock *control; +00213 <span class="keyword">static</span> <span class="keywordtype">int</span> seq; +00214 <span class="keyword">static</span> <span class="keywordtype">int</span> stpd_pid = 0; +00215 +00216 <span class="comment">/* info for this application */</span> +00217 <span class="keyword">static</span> <span class="keyword">struct </span>relay_app +00218 { +00219 <span class="keywordtype">char</span> dirname[1024]; +00220 <span class="keywordtype">char</span> file_basename[1024]; +00221 <span class="keyword">struct </span>relay_app_callbacks *cb; +00222 <span class="keyword">struct </span>rchan *chan; +00223 <span class="keyword">struct </span>dentry *dir; +00224 <span class="keywordtype">int</span> logging; +00225 <span class="keywordtype">int</span> mappings; +00226 } app; +00227 +00228 <span class="comment">/*</span> +00229 <span class="comment"> * subbuf_start() relayfs callback.</span> +00230 <span class="comment"> */</span> +00231 <span class="keyword">static</span> <span class="keywordtype">int</span> relay_app_subbuf_start(<span class="keyword">struct</span> rchan_buf *buf, +00232 <span class="keywordtype">void</span> *subbuf, +00233 <span class="keywordtype">unsigned</span> prev_subbuf_idx, +00234 <span class="keywordtype">void</span> *prev_subbuf) +00235 { +00236 <span class="keywordtype">unsigned</span> padding = buf->padding[prev_subbuf_idx]; +00237 <span class="keywordflow">if</span> (prev_subbuf) +00238 *((<span class="keywordtype">unsigned</span> *)prev_subbuf) = padding; +00239 +00240 <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(padding); <span class="comment">/* reserve space for padding */</span> +00241 } +00242 +00243 <span class="comment">/*</span> +00244 <span class="comment"> * buf_full() relayfs callback.</span> +00245 <span class="comment"> */</span> +00246 <span class="keyword">static</span> <span class="keywordtype">void</span> relay_app_buf_full(<span class="keyword">struct</span> rchan_buf *buf, +00247 <span class="keywordtype">unsigned</span> subbuf_idx, +00248 <span class="keywordtype">void</span> *subbuf) +00249 { +00250 <span class="keywordtype">unsigned</span> padding = buf->padding[subbuf_idx]; +00251 *((<span class="keywordtype">unsigned</span> *)subbuf) = padding; +00252 } +00253 +00254 <span class="keyword">static</span> <span class="keywordtype">void</span> relay_app_buf_mapped(<span class="keyword">struct</span> rchan_buf *buf, <span class="keyword">struct</span> file *filp) +00255 { +00256 <span class="keywordflow">if</span> (app.cb && app.cb->app_started && !app.mappings++) +00257 app.cb->app_started(); +00258 } +00259 +00260 static <span class="keywordtype">void</span> relay_app_buf_unmapped(struct rchan_buf *buf, struct file *filp) +00261 { +00262 <span class="keywordflow">if</span> (app.cb && app.cb->app_started && !--app.mappings) +00263 app.cb->app_stopped(); +00264 } +00265 +00266 static struct rchan_callbacks app_rchan_callbacks = +00267 { +00268 .subbuf_start = relay_app_subbuf_start, +00269 .buf_full = relay_app_buf_full, +00270 .buf_mapped = relay_app_buf_mapped, +00271 .buf_unmapped = relay_app_buf_unmapped +00272 }; +00273 <span class="comment"></span> +00274 <span class="comment">/**</span> +00275 <span class="comment"> * create_app_chan - creates channel /mnt/relay/dirname/filebaseXXX</span> +00276 <span class="comment"> *</span> +00277 <span class="comment"> * Returns channel on success, NULL otherwise.</span> +00278 <span class="comment"> */</span> +00279 <span class="keyword">static</span> <span class="keyword">struct </span>rchan *create_app_chan(<span class="keywordtype">unsigned</span> subbuf_size, +00280 <span class="keywordtype">unsigned</span> n_subbufs) +00281 { +00282 <span class="keyword">struct </span>rchan *chan; +00283 +00284 <span class="keywordflow">if</span> (strlen(app.dirname)) { +00285 app.dir = relayfs_create_dir(app.dirname, NULL); +00286 <span class="keywordflow">if</span> (!app.dir) { +00287 printk(<span class="stringliteral">"Couldn't create relayfs app directory %s.\n"</span>, app.dirname); +00288 <span class="keywordflow">return</span> NULL; +00289 } +00290 } +00291 +00292 chan = relay_open(app.file_basename, app.dir, subbuf_size, +00293 n_subbufs, 0, &app_rchan_callbacks); +00294 +00295 <span class="keywordflow">if</span> (!chan) { +00296 printk(<span class="stringliteral">"relay app channel creation failed\n"</span>); +00297 <span class="keywordflow">if</span> (app.dir) +00298 relayfs_remove_dir(app.dir); +00299 return NULL; +00300 } +00301 +00302 return chan; +00303 } +00304 <span class="comment"></span> +00305 <span class="comment">/**</span> +00306 <span class="comment"> * destroy_app_chan - destroys channel /mnt/relay/dirname/filebaseXXX</span> +00307 <span class="comment"> */</span> +00308 static <span class="keywordtype">void</span> destroy_app_chan(struct rchan *chan) +00309 { +00310 <span class="keywordflow">if</span> (chan) +00311 relay_close(chan); +00312 if (app.dir) +00313 relayfs_remove_dir(app.dir); +00314 +00315 app.chan = NULL; +00316 app.dir = NULL; +00317 } +00318 +00319 <span class="comment">/* netlink control channel communication with userspace */</span> +00320 +00321 struct buf_info +00322 { +00323 <span class="keywordtype">int</span> cpu; +00324 <span class="keywordtype">unsigned</span> produced; +00325 <span class="keywordtype">unsigned</span> consumed; +00326 }; +00327 +00328 <span class="keyword">struct </span>consumed_info +00329 { +00330 <span class="keywordtype">int</span> cpu; +00331 <span class="keywordtype">unsigned</span> consumed; +00332 }; +00333 +00334 <span class="keyword">struct </span>channel_create_info +00335 { +00336 <span class="keywordtype">unsigned</span> subbuf_size; +00337 <span class="keywordtype">unsigned</span> n_subbufs; +00338 }; +00339 +00340 <span class="comment">/*</span> +00341 <span class="comment"> * send_reply - send reply to userspace over netlink control channel</span> +00342 <span class="comment"> */</span> +00343 <span class="keyword">static</span> <span class="keywordtype">int</span> send_reply(<span class="keywordtype">int</span> type, <span class="keywordtype">void</span> *reply, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> pid) +00344 { +00345 <span class="keyword">struct </span>sk_buff *skb; +00346 <span class="keyword">struct </span>nlmsghdr *nlh; +00347 <span class="keywordtype">void</span> *data; +00348 <span class="keywordtype">int</span> size; +00349 <span class="keywordtype">int</span> err; +00350 +00351 size = NLMSG_SPACE(len); +00352 skb = alloc_skb(size, GFP_ATOMIC); +00353 <span class="keywordflow">if</span> (!skb) +00354 return -1; +00355 nlh = NLMSG_PUT(skb, pid, seq++, type, size - sizeof(*nlh)); +00356 nlh->nlmsg_flags = 0; +00357 data = NLMSG_DATA(nlh); +00358 memcpy(data, reply, len); +00359 err = netlink_unicast(control, skb, pid, MSG_DONTWAIT); +00360 +00361 return 0; +00362 +00363 nlmsg_failure: +00364 if (skb) +00365 kfree_skb(skb); +00366 +00367 return -1; +00368 } +00369 +00370 static <span class="keywordtype">void</span> handle_buf_info(struct buf_info *in, <span class="keywordtype">int</span> pid) +00371 { +00372 <span class="keyword">struct </span>buf_info out; +00373 +00374 <span class="keywordflow">if</span> (!app.chan) +00375 return; +00376 +00377 out.cpu = in->cpu; +00378 out.produced = atomic_read(&app.chan->buf[in->cpu]->subbufs_produced); +00379 out.consumed = atomic_read(&app.chan->buf[in->cpu]->subbufs_consumed); +00380 +00381 send_reply(RELAY_APP_BUF_INFO, &out, sizeof(out), pid); +00382 } +00383 +00384 static inline <span class="keywordtype">void</span> handle_subbufs_consumed(struct consumed_info *info) +00385 { +00386 <span class="keywordflow">if</span> (!app.chan) +00387 return; +00388 +00389 relay_subbufs_consumed(app.chan, info->cpu, info->consumed); +00390 } +00391 +00392 static inline <span class="keywordtype">void</span> handle_create(struct channel_create_info *info) +00393 { +00394 destroy_app_chan(app.chan); +00395 app.chan = create_app_chan(info->subbuf_size, info->n_subbufs); +00396 <span class="keywordflow">if</span>(!app.chan) +00397 <span class="keywordflow">return</span>; +00398 app.mappings = 0; +00399 } +00400 +00401 <span class="comment">/*</span> +00402 <span class="comment"> * msg_rcv_skb - dispatch userspace requests from netlink control channel</span> +00403 <span class="comment"> */</span> +00404 <span class="keyword">static</span> <span class="keywordtype">void</span> msg_rcv_skb(<span class="keyword">struct</span> sk_buff *skb) +00405 { +00406 <span class="keyword">struct </span>nlmsghdr *nlh = NULL; +00407 <span class="keywordtype">int</span> pid, flags; +00408 <span class="keywordtype">int</span> nlmsglen, skblen; +00409 <span class="keywordtype">void</span> *data; +00410 +00411 skblen = skb->len; +00412 +00413 <span class="keywordflow">if</span> (skblen < <span class="keyword">sizeof</span> (*nlh)) +00414 return; +00415 +00416 nlh = (struct nlmsghdr *)skb->data; +00417 nlmsglen = nlh->nlmsg_len; +00418 +00419 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen) +00420 return; +00421 +00422 stpd_pid = pid = nlh->nlmsg_pid; +00423 flags = nlh->nlmsg_flags; +00424 +00425 if (pid <= 0 || !(flags & NLM_F_REQUEST)) { +00426 netlink_ack(skb, nlh, -EINVAL); +00427 <span class="keywordflow">return</span>; +00428 } +00429 +00430 <span class="keywordflow">if</span> (flags & MSG_TRUNC) { +00431 netlink_ack(skb, nlh, -ECOMM); +00432 <span class="keywordflow">return</span>; +00433 } +00434 +00435 data = NLMSG_DATA(nlh); +00436 +00437 <span class="keywordflow">switch</span> (nlh->nlmsg_type) { +00438 <span class="keywordflow">case</span> RELAY_APP_CHAN_CREATE: +00439 handle_create(data); +00440 <span class="keywordflow">break</span>; +00441 <span class="keywordflow">case</span> RELAY_APP_CHAN_DESTROY: +00442 destroy_app_chan(app.chan); +00443 <span class="keywordflow">break</span>; +00444 <span class="keywordflow">case</span> RELAY_APP_START: +00445 app.logging = 1; +00446 <span class="keywordflow">break</span>; +00447 <span class="keywordflow">case</span> RELAY_APP_STOP: +00448 app.logging = 0; +00449 relay_flush(app.chan); +00450 <span class="keywordflow">break</span>; +00451 <span class="keywordflow">case</span> RELAY_APP_BUF_INFO: +00452 handle_buf_info(data, pid); +00453 <span class="keywordflow">break</span>; +00454 <span class="keywordflow">case</span> RELAY_APP_SUBBUFS_CONSUMED: +00455 handle_subbufs_consumed(data); +00456 <span class="keywordflow">break</span>; +00457 <span class="keywordflow">default</span>: +00458 <span class="keywordflow">if</span> (!app.cb || !app.cb->user_command || +00459 !app.cb->user_command(nlh->nlmsg_type, data)) +00460 netlink_ack(skb, nlh, -EINVAL); +00461 <span class="keywordflow">return</span>; +00462 } +00463 +00464 <span class="keywordflow">if</span> (flags & NLM_F_ACK) +00465 netlink_ack(skb, nlh, 0); +00466 } +00467 +00468 <span class="comment">/*</span> +00469 <span class="comment"> * msg_rcv - handle netlink control channel requests</span> +00470 <span class="comment"> */</span> +00471 static <span class="keywordtype">void</span> msg_rcv(struct sock *sk, <span class="keywordtype">int</span> len) +00472 { +00473 <span class="keyword">struct </span>sk_buff *skb; +00474 +00475 <span class="keywordflow">while</span> ((skb = skb_dequeue(&sk->sk_receive_queue))) { +00476 msg_rcv_skb(skb); +00477 kfree_skb(skb); +00478 } +00479 } +00480 +00481 <span class="comment">/*</span> +00482 <span class="comment"> * _init_relay_app - adds netlink 'unit' if other than NETLINK_USERSOCK wanted</span> +00483 <span class="comment"> */</span> +00484 <span class="keyword">static</span> <span class="keywordtype">int</span> _init_relay_app(<span class="keyword">const</span> <span class="keywordtype">char</span> *dirname, +00485 <span class="keyword">const</span> <span class="keywordtype">char</span> *file_basename, +00486 <span class="keyword">struct</span> relay_app_callbacks *callbacks, +00487 <span class="keywordtype">int</span> unit) +00488 { +00489 <span class="keywordflow">if</span> (!file_basename) +00490 return -1; +00491 +00492 if (dirname) +00493 strncpy(app.dirname, dirname, 1024); +00494 strncpy(app.file_basename, file_basename, 1024); +00495 app.cb = callbacks; +00496 +00497 control = netlink_kernel_create(unit, msg_rcv); +00498 if (!control) { +00499 printk(<span class="stringliteral">"Couldn't create control channel\n"</span>); +00500 <span class="keywordflow">return</span> -1; +00501 } +00502 +00503 <span class="keywordflow">return</span> 0; +00504 } +00505 <span class="comment"></span> +00506 <span class="comment">/**</span> +00507 <span class="comment"> * init_relay_app - initialize /mnt/relay/dirname/file_basenameXXX</span> +00508 <span class="comment"> * @dirname: the directory to contain relayfs files for this app</span> +00509 <span class="comment"> * @file_basename: the base filename of the relayfs files for this app</span> +00510 <span class="comment"> * @callbacks: the relay_app_callbacks implemented for this app</span> +00511 <span class="comment"> *</span> +00512 <span class="comment"> * Returns 0 on success, -1 otherwise.</span> +00513 <span class="comment"> *</span> +00514 <span class="comment"> * NOTE: this doesn't create the relayfs files. That happens via the</span> +00515 <span class="comment"> * control channel protocol.</span> +00516 <span class="comment"> */</span> +00517 <span class="keyword">static</span> <span class="keywordtype">int</span> init_relay_app(<span class="keyword">const</span> <span class="keywordtype">char</span> *dirname, +00518 <span class="keyword">const</span> <span class="keywordtype">char</span> *file_basename, +00519 <span class="keyword">struct</span> relay_app_callbacks *callbacks) +00520 { +00521 <span class="keywordflow">return</span> _init_relay_app(dirname, file_basename, callbacks, NETLINK_USERSOCK); +00522 } +00523 <span class="comment"></span> +00524 <span class="comment">/**</span> +00525 <span class="comment"> * close_relay_app - close netlink socket and destroy channel if it exists</span> +00526 <span class="comment"> *</span> +00527 <span class="comment"> * Returns 0 on success, -1 otherwise.</span> +00528 <span class="comment"> */</span> +00529 <span class="keyword">static</span> <span class="keywordtype">void</span> close_relay_app(<span class="keywordtype">void</span>) +00530 { +00531 <span class="keywordflow">if</span> (control) +00532 sock_release(control->sk_socket); +00533 destroy_app_chan(app.chan); +00534 } +</pre></div></body></html> diff --git a/runtime/docs/html/runtime_8h-source.html b/runtime/docs/html/runtime_8h-source.html index a0f00a36..76c74dec 100644 --- a/runtime/docs/html/runtime_8h-source.html +++ b/runtime/docs/html/runtime_8h-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>runtime.h</h1><a href="runtime_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _RUNTIME_H_</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define _RUNTIME_H_</span> 00003 <span class="preprocessor"></span><span class="comment">/** @file runtime.h</span> @@ -28,5 +28,7 @@ 00021 00022 <span class="preprocessor">#define dbug(args...) ;</span> 00023 <span class="preprocessor"></span> -00024 <span class="preprocessor">#endif </span><span class="comment">/* _RUNTIME_H_ */</span> +00024 <span class="preprocessor">#include "print.c"</span> +00025 +00026 <span class="preprocessor">#endif </span><span class="comment">/* _RUNTIME_H_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/runtime_8h.html b/runtime/docs/html/runtime_8h.html index 450661ad..a11057b4 100644 --- a/runtime/docs/html/runtime_8h.html +++ b/runtime/docs/html/runtime_8h.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>runtime.h File Reference</h1>Main include file for runtime functions. <a href="#_details">More...</a> <p> <code>#include <linux/module.h></code><br> @@ -21,6 +21,7 @@ <code>#include <linux/hardirq.h></code><br> <code>#include <asm/uaccess.h></code><br> <code>#include <linux/kallsyms.h></code><br> +<code>#include "print.c"</code><br> <p> <a href="runtime_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> diff --git a/runtime/docs/html/scbuf_8c-source.html b/runtime/docs/html/scbuf_8c-source.html deleted file mode 100644 index ffdfaac7..00000000 --- a/runtime/docs/html/scbuf_8c-source.html +++ /dev/null @@ -1,103 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: scbuf.c Source File</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>scbuf.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _SCBUF_C_ </span><span class="comment">/* -*- linux-c -*- */</span> -00002 <span class="preprocessor">#define _SCBUF_C_</span> -00003 <span class="preprocessor"></span> -00004 <span class="preprocessor">#include <linux/config.h></span> -00005 <span class="comment"></span> -00006 <span class="comment">/** @file scbuf.c</span> -00007 <span class="comment"> * @addtogroup scbuf Scratch Buffer</span> -00008 <span class="comment"> * Scratch Buffer Functions.</span> -00009 <span class="comment"> * The scratch buffer is for collecting output before storing in a map,</span> -00010 <span class="comment"> * printing, etc. This is a per-cpu static buffer. It is necessary because </span> -00011 <span class="comment"> * of the limited stack space available in the kernel.</span> -00012 <span class="comment"> * @todo Need careful review of these to insure safety.</span> -00013 <span class="comment"> * @{</span> -00014 <span class="comment"> */</span> -00015 <span class="comment"></span> -00016 <span class="comment">/** Maximum size of buffer, not including terminating NULL */</span> -<a name="l00017"></a><a class="code" href="group__scbuf.html#ga6">00017</a> <span class="preprocessor">#define STP_BUF_LEN 8191</span> -00018 <span class="preprocessor"></span><span class="comment"></span> -00019 <span class="comment">/** Scratch buffer for printing, building strings, etc */</span> -00020 <span class="keyword">static</span> <span class="keywordtype">char</span> _stp_scbuf[NR_CPUS][<a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a>+1]; -00021 <span class="keyword">static</span> <span class="keywordtype">int</span> _stp_scbuf_len[NR_CPUS]; -00022 <span class="comment"></span> -00023 <span class="comment">/** Sprint into the scratch buffer.</span> -00024 <span class="comment"> * Like printf, except output goes into a global scratch buffer</span> -00025 <span class="comment"> * which will contain the null-terminated output.</span> -00026 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> -00027 <span class="comment"> * Size is limited by length of scratch buffer, STP_BUF_LEN.</span> -00028 <span class="comment"> *</span> -00029 <span class="comment"> * @param fmt A printf-style format string followed by a </span> -00030 <span class="comment"> * variable number of args.</span> -00031 <span class="comment"> * @sa _stp_scbuf_clear</span> -00032 <span class="comment"> */</span> -00033 -<a name="l00034"></a><a class="code" href="group__scbuf.html#ga2">00034</a> <span class="keywordtype">void</span> <a class="code" href="group__scbuf.html#ga2">_stp_sprint</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) -00035 { -00036 <span class="keywordtype">int</span> num; -00037 va_list args; -00038 <span class="keywordtype">int</span> cpu = smp_processor_id(); -00039 <span class="keywordtype">char</span> *buf = _stp_scbuf[cpu] + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len[cpu]; -00040 va_start(args, fmt); -00041 num = vscnprintf(buf, _stp_scbuf_len[cpu], fmt, args); -00042 va_end(args); -00043 <span class="keywordflow">if</span> (num > 0) -00044 _stp_scbuf_len[cpu] -= num; -00045 } -00046 <span class="comment"></span> -00047 <span class="comment">/** Write a string into the scratch buffer.</span> -00048 <span class="comment"> * Copies a string into a global scratch buffer.</span> -00049 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> -00050 <span class="comment"> * Size is limited by length of scratch buffer, STP_BUF_LEN.</span> -00051 <span class="comment"> * This is more efficient than using _stp_sprint().</span> -00052 <span class="comment"> *</span> -00053 <span class="comment"> * @param str A string.</span> -00054 <span class="comment"> */</span> -00055 -<a name="l00056"></a><a class="code" href="group__scbuf.html#ga3">00056</a> <span class="keywordtype">void</span> <a class="code" href="group__scbuf.html#ga3">_stp_sprint_str</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *str) -00057 { -00058 <span class="keywordtype">int</span> cpu = smp_processor_id(); -00059 <span class="keywordtype">char</span> *buf = _stp_scbuf[cpu] + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len[cpu]; -00060 <span class="keywordtype">int</span> num = strlen (str); -00061 <span class="keywordflow">if</span> (num > _stp_scbuf_len[cpu]) -00062 num = _stp_scbuf_len[cpu]; -00063 strncpy (buf, str, num); -00064 _stp_scbuf_len[cpu] -= num; -00065 } -00066 <span class="comment"></span> -00067 <span class="comment">/** Clear the scratch buffer.</span> -00068 <span class="comment"> * This function should be called before anything is written to </span> -00069 <span class="comment"> * the scratch buffer. Output will accumulate in the buffer</span> -00070 <span class="comment"> * until this function is called again. </span> -00071 <span class="comment"> * @returns A pointer to the buffer.</span> -00072 <span class="comment"> */</span> -00073 -<a name="l00074"></a><a class="code" href="group__scbuf.html#ga4">00074</a> <span class="keywordtype">char</span> *<a class="code" href="group__scbuf.html#ga4">_stp_scbuf_clear</a> (<span class="keywordtype">void</span>) -00075 { -00076 <span class="keywordtype">int</span> cpu = smp_processor_id(); -00077 _stp_scbuf_len[cpu] = <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a>; -00078 *_stp_scbuf[cpu] = 0; -00079 <span class="keywordflow">return</span> _stp_scbuf[cpu]; -00080 } -00081 <span class="comment"></span> -00082 <span class="comment">/** Get the current top of the scratch buffer.</span> -00083 <span class="comment"> * This returns the address of the location where</span> -00084 <span class="comment"> * data will be written next in the scratch buffer.</span> -00085 <span class="comment"> * @returns A pointer</span> -00086 <span class="comment"> */</span> -00087 -00088 <span class="keyword">static</span> <span class="keywordtype">char</span> *_stp_scbuf_cur (<span class="keywordtype">void</span>) -00089 { -00090 <span class="keywordtype">int</span> cpu = smp_processor_id(); -00091 <span class="keywordflow">return</span> _stp_scbuf[cpu] + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len[cpu]; -00092 } -00093 <span class="comment"></span> -00094 <span class="comment">/** @} */</span> -00095 <span class="preprocessor">#endif </span><span class="comment">/* _SCBUF_C_ */</span> -</pre></div></body></html> diff --git a/runtime/docs/html/shellsnoop_2dtr_8c-source.html b/runtime/docs/html/shellsnoop_2dtr_8c-source.html index 7391b8ce..bbc55f7e 100644 --- a/runtime/docs/html/shellsnoop_2dtr_8c-source.html +++ b/runtime/docs/html/shellsnoop_2dtr_8c-source.html @@ -4,91 +4,91 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000001.html">shellsnoop</a></div> <h1>dtr.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#define HASH_TABLE_BITS 8</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1<<HASH_TABLE_BITS)</span> 00003 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span> 00004 -00005 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> -00006 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span> -00007 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> -00008 <span class="preprocessor">#include "<a class="code" href="copy_8c.html">copy.c</a>"</span> -00009 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> -00010 -00011 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: shellsnoop"</span>); -00012 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); -00013 -00014 <a class="code" href="structmap__root.html">MAP</a> pids, arglist ; +00005 <span class="preprocessor">#define STP_NETLINK_ONLY</span> +00006 <span class="preprocessor"></span><span class="preprocessor">#define STP_NUM_STRINGS 1</span> +00007 <span class="preprocessor"></span> +00008 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> +00009 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> +00010 <span class="preprocessor">#include "<a class="code" href="copy_8c.html">copy.c</a>"</span> +00011 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> +00012 +00013 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: shellsnoop"</span>); +00014 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); 00015 -00016 <span class="keywordtype">int</span> inst_do_execve (<span class="keywordtype">char</span> * filename, <span class="keywordtype">char</span> __user *__user *argv, <span class="keywordtype">char</span> __user *__user *envp, <span class="keyword">struct</span> pt_regs * regs) -00017 { -00018 <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> *ptr; -00019 -00020 <span class="comment">/* watch shells only */</span> -00021 <span class="comment">/* FIXME: detect more shells, like csh, tcsh, zsh */</span> -00022 -00023 <span class="keywordflow">if</span> (!strcmp(current->comm,<span class="stringliteral">"bash"</span>) || !strcmp(current->comm,<span class="stringliteral">"sh"</span>) || !strcmp(current->comm, <span class="stringliteral">"zsh"</span>) -00024 || !strcmp(current->comm, <span class="stringliteral">"tcsh"</span>) || !strcmp(current->comm, <span class="stringliteral">"pdksh"</span>)) -00025 { -00026 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); -00027 -00028 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); -00029 <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a> (pids, 1); -00030 -00031 <a class="code" href="group__lists.html#ga1">_stp_list_clear</a> (arglist); -00032 <a class="code" href="group__copy.html#ga2">_stp_copy_argv_from_user</a> (arglist, argv); -00033 <a class="code" href="group__maps.html#ga31">foreach</a> (arglist, ptr) -00034 printk ("%s ", ptr->str); -00035 printk ("\n"); -00036 } -00037 jprobe_return(); -00038 return 0; -00039 } -00040 -00041 struct file * inst_filp_open (const <span class="keywordtype">char</span> * filename, <span class="keywordtype">int</span> flags, <span class="keywordtype">int</span> mode) -00042 { -00043 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); -00044 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) -00045 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tO %s\n"</span>, current->pid, current->parent->pid, current->comm, filename); -00046 -00047 jprobe_return(); -00048 <span class="keywordflow">return</span> 0; -00049 } +00016 <a class="code" href="group__maps.html#ga1">MAP</a> pids, arglist ; +00017 +00018 <span class="keywordtype">int</span> inst_do_execve (<span class="keywordtype">char</span> * filename, <span class="keywordtype">char</span> __user *__user *argv, <span class="keywordtype">char</span> __user *__user *envp, <span class="keyword">struct</span> pt_regs * regs) +00019 { +00020 <span class="keyword">struct </span>map_node_str *ptr; +00021 +00022 <span class="comment">/* watch shells only */</span> +00023 <span class="comment">/* FIXME: detect more shells, like csh, tcsh, zsh */</span> +00024 +00025 <span class="keywordflow">if</span> (!strcmp(current->comm,<span class="stringliteral">"bash"</span>) || !strcmp(current->comm,<span class="stringliteral">"sh"</span>) || !strcmp(current->comm, <span class="stringliteral">"zsh"</span>) +00026 || !strcmp(current->comm, <span class="stringliteral">"tcsh"</span>) || !strcmp(current->comm, <span class="stringliteral">"pdksh"</span>)) +00027 { +00028 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); +00029 +00030 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); +00031 <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a> (pids, 1); +00032 +00033 <a class="code" href="group__lists.html#ga1">_stp_list_clear</a> (arglist); +00034 <a class="code" href="group__copy.html#ga3">_stp_copy_argv_from_user</a> (arglist, argv); +00035 +00036 <a class="code" href="group__maps.html#ga32">foreach</a> (arglist, ptr) +00037 _stp_printf ("%s ", ptr->str); +00038 +00039 _stp_print_flush(); +00040 } +00041 jprobe_return(); +00042 return 0; +00043 } +00044 +00045 struct file * inst_filp_open (const <span class="keywordtype">char</span> * filename, <span class="keywordtype">int</span> flags, <span class="keywordtype">int</span> mode) +00046 { +00047 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); +00048 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) +00049 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%d\t%d\t%s\tO %s"</span>, current->pid, current->parent->pid, current->comm, filename); 00050 -00051 asmlinkage ssize_t inst_sys_read (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keywordtype">char</span> __user * buf, size_t count) -00052 { -00053 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); -00054 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) -00055 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tR %d\n"</span>, current->pid, current->parent->pid, current->comm, fd); -00056 -00057 jprobe_return(); -00058 <span class="keywordflow">return</span> 0; -00059 } -00060 -00061 asmlinkage ssize_t inst_sys_write (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">char</span> __user * buf, size_t count) -00062 { -00063 size_t len; -00064 <span class="keywordtype">char</span> str[256]; -00065 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); -00066 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) -00067 { -00068 <span class="keywordflow">if</span> (count < 64) -00069 len = count; -00070 else -00071 len = 64; -00072 len = _stp_strncpy_from_user(str, buf, len); -00073 if (len < 0) len = 0; -00074 str[len] = 0; -00075 dlog ("%d\t%d\t%s\tW %s\n", current->pid, current->parent->pid, current->comm, str); +00051 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00052 jprobe_return(); +00053 <span class="keywordflow">return</span> 0; +00054 } +00055 +00056 asmlinkage ssize_t inst_sys_read (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keywordtype">char</span> __user * buf, size_t count) +00057 { +00058 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); +00059 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) +00060 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%d\t%d\t%s\tR %d"</span>, current->pid, current->parent->pid, current->comm, fd); +00061 +00062 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00063 jprobe_return(); +00064 <span class="keywordflow">return</span> 0; +00065 } +00066 +00067 asmlinkage ssize_t inst_sys_write (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">char</span> __user * buf, size_t count) +00068 { +00069 <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (pids, current->pid); +00070 <span class="keywordflow">if</span> (_stp_map_get_int64 (pids)) +00071 { +00072 String str = <a class="code" href="group__string.html#ga2">_stp_string_init</a> (0); +00073 <a class="code" href="group__copy.html#ga1">_stp_string_from_user</a>(str, buf, count); +00074 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%d\t%d\t%s\tW %s"</span>, current->pid, current->parent->pid, current->comm, str->buf); +00075 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); 00076 } 00077 00078 jprobe_return(); -00079 return 0; +00079 <span class="keywordflow">return</span> 0; 00080 } 00081 -00082 static struct jprobe dtr_probes[] = { +00082 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe dtr_probes[] = { 00083 { 00084 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"do_execve"</span>, 00085 .entry = (kprobe_opcode_t *) inst_do_execve @@ -104,7 +104,7 @@ 00095 { 00096 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>, 00097 .entry = (kprobe_opcode_t *) inst_sys_write -00098 }, +00098 }, 00099 }; 00100 00101 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span> @@ -113,24 +113,36 @@ 00104 { 00105 <span class="keywordtype">int</span> ret; 00106 -00107 pids = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (10000, INT64); -00108 arglist = <a class="code" href="group__lists.html#ga0">_stp_list_new</a> (10, STRING); +00107 <span class="keywordflow">if</span> (<a class="code" href="group__io.html#ga7">_stp_netlink_open</a>() < 0) +00108 return -1; 00109 -00110 ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00111 -00112 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); -00113 <span class="keywordflow">return</span> ret; -00114 } -00115 -00116 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) -00117 { -00118 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00119 <a class="code" href="group__maps.html#ga7">_stp_map_del</a> (pids); -00120 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"EXIT\n"</span>); -00121 } +00110 pids = _stp_map_new (10000, INT64); +00111 arglist = _stp_list_new (10, STRING); +00112 +00113 ret = _stp_register_jprobes (dtr_probes, MAX_DTR_ROUTINE); +00114 +00115 _stp_log("instrumentation is enabled... %s\n", __this_module.name); +00116 return ret; +00117 } +00118 +00119 static <span class="keywordtype">void</span> probe_exit (<span class="keywordtype">void</span>) +00120 { +00121 <a class="code" href="probes_8c.html#a2">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); 00122 -00123 module_init(init_dtr); -00124 module_exit(cleanup_dtr); -00125 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); -00126 +00123 <a class="code" href="group__print.html#ga11">_stp_print</a> (<span class="stringliteral">"In probe_exit now."</span>); +00124 <a class="code" href="group__maps.html#ga7">_stp_map_del</a> (pids); +00125 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00126 } +00127 +00128 +00129 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) +00130 { +00131 <a class="code" href="group__io.html#ga8">_stp_netlink_close</a>(); +00132 +00133 } +00134 +00135 module_init(init_dtr); +00136 module_exit(cleanup_dtr); +00137 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); +00138 </pre></div></body></html> diff --git a/runtime/docs/html/stack_8c-source.html b/runtime/docs/html/stack_8c-source.html index 552f51cc..eda90dc4 100644 --- a/runtime/docs/html/stack_8c-source.html +++ b/runtime/docs/html/stack_8c-source.html @@ -4,10 +4,10 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>stack.c</h1><a href="stack_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _STACK_C_</span> -00002 <span class="preprocessor"></span><span class="preprocessor">#define _STACK_C_</span> -00003 <span class="preprocessor"></span><span class="comment">/* -*- linux-c -*- */</span> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>stack.c</h1><a href="stack_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _STACK_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _STACK_C_</span> +00003 <span class="preprocessor"></span> 00004 <span class="comment"></span> 00005 <span class="comment">/** @file stack.c</span> 00006 <span class="comment"> * @brief Stack Tracing Functions</span> @@ -27,148 +27,162 @@ 00020 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; 00021 00022 <span class="keywordflow">if</span> (verbose) -00023 _stp_print ("trace for %d (%s)\n", current->pid, current->comm); +00023 _stp_printf ("trace for %d (%s)\n", current->pid, current->comm); 00024 00025 while (((<span class="keywordtype">long</span>) stack & (THREAD_SIZE-1)) != 0) { 00026 addr = *stack++; 00027 <span class="keywordflow">if</span> (_stp_kta(addr)) { -00028 <span class="keywordflow">if</span> (verbose) -00029 _stp_symbol_print (addr); -00030 else -00031 _stp_print ("0x%lx ", addr); -00032 } -00033 } -00034 _stp_print_str ("\n"); -00035 } -00036 +00028 <span class="keywordflow">if</span> (verbose) { +00029 <a class="code" href="group__sym.html#ga2">_stp_symbol_print</a> (addr); +00030 <a class="code" href="group__print.html#ga11">_stp_print</a> (<span class="stringliteral">"\n"</span>); +00031 } <span class="keywordflow">else</span> +00032 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"0x%lx "</span>, addr); +00033 } +00034 } +00035 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00036 } 00037 -00038 static <span class="keywordtype">char</span> *__stp_stack_sprint (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) -00039 { -00040 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; -00041 <span class="keywordtype">char</span> *ptr = _stp_scbuf_cur(); +00038 +00039 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_stack_sprint (String str, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00040 { +00041 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; 00042 <span class="keywordflow">while</span> (((<span class="keywordtype">long</span>) stack & (THREAD_SIZE-1)) != 0) { 00043 addr = *stack++; 00044 <span class="keywordflow">if</span> (_stp_kta(addr)) { 00045 <span class="keywordflow">if</span> (verbose) -00046 _stp_symbol_sprint (addr); +00046 _stp_symbol_sprint (str, addr); 00047 else -00048 _stp_sprint ("0x%lx ", addr); +00048 _stp_sprintf (str, "0x%lx ", addr); 00049 } 00050 } -00051 return ptr; -00052 } -00053 -00054 #else <span class="comment">/* i386 */</span> -00055 -00056 static inline <span class="keywordtype">int</span> valid_stack_ptr (struct thread_info *tinfo, <span class="keywordtype">void</span> *p) -00057 { -00058 <span class="keywordflow">return</span> p > (<span class="keywordtype">void</span> *)tinfo && -00059 p < (<span class="keywordtype">void</span> *)tinfo + THREAD_SIZE - 3; -00060 } -00061 -00062 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _stp_print_context_stack ( -00063 <span class="keyword">struct</span> thread_info *tinfo, -00064 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, -00065 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp ) -00066 { -00067 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; -00068 -00069 <span class="preprocessor">#ifdef CONFIG_FRAME_POINTER</span> -00070 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, (<span class="keywordtype">void</span> *)ebp)) { -00071 addr = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)(ebp + 4); -00072 <a class="code" href="group__sym.html#ga3">_stp_symbol_print</a> (addr); -00073 <a class="code" href="group__io.html#ga2">_stp_print_str</a>(<span class="stringliteral">"\n"</span>); -00074 ebp = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)ebp; -00075 } -00076 <span class="preprocessor">#else</span> -00077 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, stack)) { -00078 addr = *stack++; -00079 <span class="keywordflow">if</span> (_stp_kta (addr)) { -00080 <a class="code" href="group__sym.html#ga3">_stp_symbol_print</a> (addr); -00081 <a class="code" href="group__io.html#ga2">_stp_print_str</a> (<span class="stringliteral">"\n"</span>); -00082 } -00083 } -00084 <span class="preprocessor">#endif</span> -00085 <span class="preprocessor"></span> <span class="keywordflow">return</span> ebp; +00051 } +00052 +00053 #else <span class="comment">/* i386 */</span> +00054 +00055 static inline <span class="keywordtype">int</span> valid_stack_ptr (struct thread_info *tinfo, <span class="keywordtype">void</span> *p) +00056 { +00057 <span class="keywordflow">return</span> p > (<span class="keywordtype">void</span> *)tinfo && +00058 p < (<span class="keywordtype">void</span> *)tinfo + THREAD_SIZE - 3; +00059 } +00060 +00061 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _stp_print_context_stack ( +00062 <span class="keyword">struct</span> thread_info *tinfo, +00063 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, +00064 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp ) +00065 { +00066 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; +00067 +00068 <span class="preprocessor">#ifdef CONFIG_FRAME_POINTER</span> +00069 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, (<span class="keywordtype">void</span> *)ebp)) { +00070 addr = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)(ebp + 4); +00071 <a class="code" href="group__sym.html#ga2">_stp_symbol_print</a> (addr); +00072 <a class="code" href="group__print.html#ga5">_stp_print_cstr</a>(<span class="stringliteral">"\n"</span>); +00073 ebp = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)ebp; +00074 } +00075 <span class="preprocessor">#else</span> +00076 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, stack)) { +00077 addr = *stack++; +00078 <span class="keywordflow">if</span> (_stp_kta (addr)) { +00079 <a class="code" href="group__sym.html#ga2">_stp_symbol_print</a> (addr); +00080 <a class="code" href="group__print.html#ga5">_stp_print_cstr</a> (<span class="stringliteral">"\n"</span>); +00081 } +00082 } +00083 <span class="preprocessor">#endif</span> +00084 <span class="preprocessor"></span> <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00085 <span class="keywordflow">return</span> ebp; 00086 } 00087 00088 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _stp_sprint_context_stack ( -00089 <span class="keyword">struct</span> thread_info *tinfo, -00090 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, -00091 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp ) -00092 { -00093 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; -00094 -00095 <span class="preprocessor">#ifdef CONFIG_FRAME_POINTER</span> -00096 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, (<span class="keywordtype">void</span> *)ebp)) { -00097 addr = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)(ebp + 4); -00098 <a class="code" href="group__sym.html#ga2">_stp_symbol_sprint</a> (addr); -00099 <a class="code" href="group__scbuf.html#ga3">_stp_sprint_str</a>(<span class="stringliteral">"\n"</span>); -00100 ebp = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)ebp; -00101 } -00102 <span class="preprocessor">#else</span> -00103 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, stack)) { -00104 addr = *stack++; -00105 <span class="keywordflow">if</span> (_stp_kta (addr)) { -00106 <a class="code" href="group__sym.html#ga2">_stp_symbol_sprint</a> (addr); -00107 <a class="code" href="group__scbuf.html#ga3">_stp_sprint_str</a> (<span class="stringliteral">"\n"</span>); -00108 } -00109 } -00110 <span class="preprocessor">#endif</span> -00111 <span class="preprocessor"></span> <span class="keywordflow">return</span> ebp; -00112 } -00113 -00114 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_stack_print (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) -00115 { -00116 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp; -00117 -00118 <span class="comment">/* Grab ebp right from our regs */</span> -00119 <span class="keyword">asm</span> (<span class="stringliteral">"movl %%ebp, %0"</span> : <span class="stringliteral">"=r"</span> (ebp) : ); -00120 -00121 <span class="keywordflow">while</span> (stack) { -00122 <span class="keyword">struct </span>thread_info *context = (<span class="keyword">struct </span>thread_info *) -00123 ((<span class="keywordtype">unsigned</span> long)stack & (~(THREAD_SIZE - 1))); -00124 ebp = _stp_print_context_stack (context, stack, ebp); -00125 stack = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*)context->previous_esp; -00126 } -00127 } -00128 -00129 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_stack_sprint (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) -00130 { -00131 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp; -00132 -00133 <span class="comment">/* Grab ebp right from our regs */</span> -00134 <span class="keyword">asm</span> (<span class="stringliteral">"movl %%ebp, %0"</span> : <span class="stringliteral">"=r"</span> (ebp) : ); -00135 -00136 <span class="keywordflow">while</span> (stack) { -00137 <span class="keyword">struct </span>thread_info *context = (<span class="keyword">struct </span>thread_info *) -00138 ((<span class="keywordtype">unsigned</span> long)stack & (~(THREAD_SIZE - 1))); -00139 ebp = _stp_sprint_context_stack (context, stack, ebp); -00140 stack = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*)context->previous_esp; -00141 } -00142 } -00143 -00144 <span class="preprocessor">#endif </span><span class="comment">/* i386 */</span> -00145 <span class="comment"></span> -00146 <span class="comment">/** Print stack dump.</span> -00147 <span class="comment"> * Prints a stack dump to the trace buffer.</span> -00148 <span class="comment"> * @param verbose Verbosity:</span> -00149 <span class="comment"> */</span> -00150 -<a name="l00151"></a><a class="code" href="group__stack.html#ga6">00151</a> <span class="keywordtype">void</span> <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (<span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) -00152 { -00153 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; -00154 <span class="keywordflow">return</span> __stp_stack_print (&stack, verbose, levels); -00155 } -00156 -00157 <span class="keywordtype">char</span> *_stp_stack_sprint (<span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) -00158 { -00159 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; -00160 <span class="keywordtype">char</span> *ptr = _stp_scbuf_cur(); -00161 __stp_stack_sprint (&stack, verbose, levels); -00162 <span class="keywordflow">return</span> ptr; -00163 } -00164 <span class="comment"></span> -00165 <span class="comment">/** @} */</span> -00166 <span class="preprocessor">#endif </span><span class="comment">/* _STACK_C_ */</span> +00089 String str, +00090 <span class="keyword">struct</span> thread_info *tinfo, +00091 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, +00092 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp ) +00093 { +00094 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr; +00095 +00096 <span class="preprocessor">#ifdef CONFIG_FRAME_POINTER</span> +00097 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, (<span class="keywordtype">void</span> *)ebp)) { +00098 addr = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)(ebp + 4); +00099 <a class="code" href="group__sym.html#ga1">_stp_symbol_sprint</a> (str, addr); +00100 <a class="code" href="group__string.html#ga9">_stp_string_cat</a> (<span class="stringliteral">"\n"</span>); +00101 ebp = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)ebp; +00102 } +00103 <span class="preprocessor">#else</span> +00104 <span class="preprocessor"></span> <span class="keywordflow">while</span> (valid_stack_ptr(tinfo, stack)) { +00105 addr = *stack++; +00106 <span class="keywordflow">if</span> (_stp_kta (addr)) { +00107 <a class="code" href="group__sym.html#ga1">_stp_symbol_sprint</a> (addr); +00108 <a class="code" href="group__string.html#ga9">_stp_string_cat</a> (<span class="stringliteral">"\n"</span>); +00109 } +00110 } +00111 <span class="preprocessor">#endif</span> +00112 <span class="preprocessor"></span> <span class="keywordflow">return</span> ebp; +00113 } +00114 +00115 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_stack_print (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00116 { +00117 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp; +00118 +00119 <span class="comment">/* Grab ebp right from our regs */</span> +00120 <span class="keyword">asm</span> (<span class="stringliteral">"movl %%ebp, %0"</span> : <span class="stringliteral">"=r"</span> (ebp) : ); +00121 +00122 <span class="keywordflow">while</span> (stack) { +00123 <span class="keyword">struct </span>thread_info *context = (<span class="keyword">struct </span>thread_info *) +00124 ((<span class="keywordtype">unsigned</span> long)stack & (~(THREAD_SIZE - 1))); +00125 ebp = _stp_print_context_stack (context, stack, ebp); +00126 stack = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*)context->previous_esp; +00127 } +00128 } +00129 +00130 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_stack_sprint (String str, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *stack, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00131 { +00132 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ebp; +00133 +00134 <span class="comment">/* Grab ebp right from our regs */</span> +00135 <span class="keyword">asm</span> (<span class="stringliteral">"movl %%ebp, %0"</span> : <span class="stringliteral">"=r"</span> (ebp) : ); +00136 +00137 <span class="keywordflow">while</span> (stack) { +00138 <span class="keyword">struct </span>thread_info *context = (<span class="keyword">struct </span>thread_info *) +00139 ((<span class="keywordtype">unsigned</span> long)stack & (~(THREAD_SIZE - 1))); +00140 ebp = _stp_sprint_context_stack (str, context, stack, ebp); +00141 stack = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*)context->previous_esp; +00142 } +00143 } +00144 +00145 <span class="preprocessor">#endif </span><span class="comment">/* i386 */</span> +00146 <span class="comment"></span> +00147 <span class="comment">/** Print stack dump.</span> +00148 <span class="comment"> * Prints a stack dump to the print buffer.</span> +00149 <span class="comment"> * @param verbose Verbosity</span> +00150 <span class="comment"> * @param levels Number of levels to trace.</span> +00151 <span class="comment"> * @todo Implement verbosity and levels parameters.</span> +00152 <span class="comment"> * @bug levels parameter is not functional</span> +00153 <span class="comment"> */</span> +00154 +<a name="l00155"></a><a class="code" href="group__stack.html#ga6">00155</a> <span class="keywordtype">void</span> <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (<span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00156 { +00157 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; +00158 __stp_stack_print (&stack, verbose, levels); +00159 } +00160 <span class="comment"></span> +00161 <span class="comment">/** Writes stack dump to a String</span> +00162 <span class="comment"> *</span> +00163 <span class="comment"> * @param str String</span> +00164 <span class="comment"> * @param verbose Verbosity</span> +00165 <span class="comment"> * @param levels Number of levels to trace.</span> +00166 <span class="comment"> * @returns Same String as was input.</span> +00167 <span class="comment"> * @todo Implement verbosity and levels parameters.</span> +00168 <span class="comment"> * @bug levels parameter is not functional</span> +00169 <span class="comment"> */</span> +00170 +<a name="l00171"></a><a class="code" href="group__stack.html#ga7">00171</a> String <a class="code" href="group__stack.html#ga7">_stp_stack_sprint</a> (String str, <span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00172 { +00173 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; +00174 __stp_stack_sprint (str, &stack, verbose, levels); +00175 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"sss: str=%s\n"</span>, str->buf); +00176 <span class="keywordflow">return</span> str; +00177 } +00178 <span class="comment"></span> +00179 <span class="comment">/** @} */</span> +00180 <span class="preprocessor">#endif </span><span class="comment">/* _STACK_C_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/stack_8c.html b/runtime/docs/html/stack_8c.html index 093cc186..4c769ce8 100644 --- a/runtime/docs/html/stack_8c.html +++ b/runtime/docs/html/stack_8c.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>stack.c File Reference</h1>Stack Tracing Functions. <a href="#_details">More...</a> <p> <code>#include "sym.c"</code><br> @@ -16,9 +16,9 @@ <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__stack.html#ga6">_stp_stack_print</a> (int verbose, int levels)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Print stack dump. <a href="group__stack.html#ga6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="stack.c::_stp_stack_sprint"></a> -char * </td><td class="memItemRight" valign="bottom"><b>_stp_stack_sprint</b> (int verbose, int levels)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="group__stack.html#ga7">_stp_stack_sprint</a> (String str, int verbose, int levels)</td></tr> +<tr><td class="mdescLeft"> </td><td class="mdescRight">Writes stack dump to a String. <a href="group__stack.html#ga7"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Stack Tracing Functions. diff --git a/runtime/docs/html/stp__tasklet_8c-source.html b/runtime/docs/html/stp__tasklet_8c-source.html index 1156b265..16fdfdf7 100644 --- a/runtime/docs/html/stp__tasklet_8c-source.html +++ b/runtime/docs/html/stp__tasklet_8c-source.html @@ -4,7 +4,7 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000002.html">tasklet</a></div> <h1>stp_tasklet.c</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/* Framework for putting a jprobe in a tasklet. */</span> @@ -15,44 +15,55 @@ 00006 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1<<HASH_TABLE_BITS)</span> 00007 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span> 00008 -00009 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> -00010 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span> -00011 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> -00012 -00013 MODULE_DESCRIPTION(<span class="stringliteral">"test jprobes of tasklets"</span>); -00014 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); -00015 -00016 <span class="keywordtype">void</span> inst__rcu_process_callbacks(<span class="keyword">struct</span> rcu_ctrlblk *rcp, -00017 <span class="keyword">struct</span> rcu_state *rsp, <span class="keyword">struct</span> rcu_data *rdp) -00018 { -00019 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"interrupt=%d\n"</span>, in_interrupt()); -00020 jprobe_return(); -00021 } -00022 -00023 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe stp_probes[] = { -00024 { -00025 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"__rcu_process_callbacks"</span>, -00026 .entry = (kprobe_opcode_t *) inst__rcu_process_callbacks -00027 }, -00028 }; -00029 <span class="preprocessor">#define MAX_STP_PROBES (sizeof(stp_probes)/sizeof(struct jprobe))</span> -00030 <span class="preprocessor"></span> -00031 -00032 <span class="keyword">static</span> <span class="keywordtype">int</span> init_stp(<span class="keywordtype">void</span>) -00033 { -00034 <span class="keywordtype">int</span> ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (stp_probes, MAX_STP_PROBES); -00035 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); -00036 <span class="keywordflow">return</span> ret; -00037 } -00038 -00039 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_stp(<span class="keywordtype">void</span>) -00040 { -00041 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (stp_probes, MAX_STP_PROBES); -00042 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"EXIT\n"</span>); +00009 <span class="preprocessor">#define STP_NETLINK_ONLY</span> +00010 <span class="preprocessor"></span><span class="preprocessor">#define STP_NUM_STRINGS 1</span> +00011 <span class="preprocessor"></span> +00012 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> +00013 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> +00014 +00015 MODULE_DESCRIPTION(<span class="stringliteral">"test jprobes of tasklets"</span>); +00016 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); +00017 +00018 <span class="keywordtype">void</span> inst__rcu_process_callbacks(<span class="keyword">struct</span> rcu_ctrlblk *rcp, +00019 <span class="keyword">struct</span> rcu_state *rsp, <span class="keyword">struct</span> rcu_data *rdp) +00020 { +00021 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"interrupt=%d\n"</span>, in_interrupt()); +00022 jprobe_return(); +00023 } +00024 +00025 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe stp_probes[] = { +00026 { +00027 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"__rcu_process_callbacks"</span>, +00028 .entry = (kprobe_opcode_t *) inst__rcu_process_callbacks +00029 }, +00030 }; +00031 <span class="preprocessor">#define MAX_STP_PROBES (sizeof(stp_probes)/sizeof(struct jprobe))</span> +00032 <span class="preprocessor"></span> +00033 +00034 <span class="keyword">static</span> <span class="keywordtype">int</span> init_stp(<span class="keywordtype">void</span>) +00035 { +00036 <span class="keywordtype">int</span> ret; +00037 +00038 <span class="keywordflow">if</span> (<a class="code" href="group__io.html#ga7">_stp_netlink_open</a>() < 0) +00039 return -1; +00040 ret = _stp_register_jprobes (stp_probes, MAX_STP_PROBES); +00041 _stp_log ("instrumentation is enabled...\n"); +00042 return ret; 00043 } 00044 -00045 module_init(init_stp); -00046 module_exit(cleanup_stp); -00047 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); -00048 +00045 static <span class="keywordtype">void</span> probe_exit (<span class="keywordtype">void</span>) +00046 { +00047 <a class="code" href="probes_8c.html#a2">_stp_unregister_jprobes</a> (stp_probes, MAX_STP_PROBES); +00048 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"EXIT\n"</span>); +00049 +00050 } +00051 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_stp(<span class="keywordtype">void</span>) +00052 { +00053 <a class="code" href="group__io.html#ga8">_stp_netlink_close</a>(); +00054 } +00055 +00056 module_init(init_stp); +00057 module_exit(cleanup_stp); +00058 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); +00059 </pre></div></body></html> diff --git a/runtime/docs/html/string_8c-source.html b/runtime/docs/html/string_8c-source.html new file mode 100644 index 00000000..462913e3 --- /dev/null +++ b/runtime/docs/html/string_8c-source.html @@ -0,0 +1,170 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: string.c Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>string.c</h1><a href="string_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _STRING_C_ </span><span class="comment">/* -*- linux-c -*- */</span> +00002 <span class="preprocessor">#define _STRING_C_</span> +00003 <span class="preprocessor"></span> +00004 <span class="preprocessor">#include <linux/config.h></span> +00005 <span class="comment"></span> +00006 <span class="comment">/** @file string.c</span> +00007 <span class="comment"> * @brief Implements String type.</span> +00008 <span class="comment"> */</span><span class="comment"></span> +00009 <span class="comment">/** @addtogroup string String Functions</span> +00010 <span class="comment"> *</span> +00011 <span class="comment"> * One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack.</span> +00012 <span class="comment"> * It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with </span> +00013 <span class="comment"> * statically allocated space for strings. This is what is implemented in the String module. Strings use</span> +00014 <span class="comment"> * preallocated per-cpu buffers and are safe to use (unlike C strings).</span> +00015 <span class="comment"> * @{</span> +00016 <span class="comment"> */</span> +00017 <span class="comment"></span> +00018 <span class="comment">/** Maximum string size allowed in Strings */</span> +00019 <span class="preprocessor">#ifndef STP_STRING_SIZE</span> +<a name="l00020"></a><a class="code" href="group__string.html#ga8">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define STP_STRING_SIZE 2048</span> +00021 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +00022 <span class="preprocessor"></span> +00023 <span class="keyword">struct </span>string { +00024 <span class="keywordtype">short</span> len; +00025 <span class="keywordtype">short</span> global; +00026 <span class="keywordtype">char</span> buf[<a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a>]; +00027 }; +00028 +00029 <span class="keyword">static</span> <span class="keyword">struct </span>string _stp_string[STP_NUM_STRINGS][NR_CPUS]; +00030 +00031 <span class="keyword">typedef</span> <span class="keyword">struct </span>string *String; +00032 <span class="comment"></span> +00033 <span class="comment">/** Initialize a String for our use.</span> +00034 <span class="comment"> * This grabs one of the global Strings for our use.</span> +00035 <span class="comment"> *</span> +00036 <span class="comment"> * @param num Number of the preallocated String to use. </span> +00037 <span class="comment"> * #STP_NUM_STRINGS are statically allocated for our use. The</span> +00038 <span class="comment"> * translator (or author) should be sure to grab a free one.</span> +00039 <span class="comment"> * @todo Global (and static) Strings not implemented yet. </span> +00040 <span class="comment"> */</span> +00041 +<a name="l00042"></a><a class="code" href="group__string.html#ga2">00042</a> String <a class="code" href="group__string.html#ga2">_stp_string_init</a> (<span class="keywordtype">int</span> num) +00043 { +00044 <span class="keywordtype">int</span> global = 0; +00045 String str; +00046 +00047 <span class="keywordflow">if</span> (num < 0) { +00048 num = -num; +00049 global = 1; +00050 } +00051 +00052 <span class="keywordflow">if</span> (num >= STP_NUM_STRINGS) { +00053 <a class="code" href="group__io.html#ga2">_stp_log</a> (<span class="stringliteral">"_stp_string_init internal error: requested string exceeded allocated number"</span>); +00054 <span class="keywordflow">return</span> NULL; +00055 } +00056 +00057 <span class="keywordflow">if</span> (global) +00058 str = &_stp_string[num][0]; +00059 <span class="keywordflow">else</span> +00060 str = &_stp_string[num][smp_processor_id()]; +00061 +00062 str->global = global; +00063 str->len = 0; +00064 <span class="keywordflow">return</span> str; +00065 } +00066 +00067 <span class="comment"></span> +00068 <span class="comment">/** Sprintf into a String.</span> +00069 <span class="comment"> * Like printf, except output goes into a String.</span> +00070 <span class="comment"> * Safe because overflowing the buffer is not allowed.</span> +00071 <span class="comment"> * Size is limited by length of String, #STP_STRING_SIZE.</span> +00072 <span class="comment"> *</span> +00073 <span class="comment"> * @param str String</span> +00074 <span class="comment"> * @param fmt A printf-style format string followed by a </span> +00075 <span class="comment"> * variable number of args.</span> +00076 <span class="comment"> */</span> +<a name="l00077"></a><a class="code" href="group__string.html#ga3">00077</a> <span class="keywordtype">void</span> <a class="code" href="group__string.html#ga3">_stp_sprintf</a> (String str, <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) +00078 { +00079 <span class="keywordtype">int</span> num; +00080 va_list args; +00081 va_start(args, fmt); +00082 num = vscnprintf(str->buf + str->len, <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str->len - 1, fmt, args); +00083 va_end(args); +00084 <span class="keywordflow">if</span> (num > 0) +00085 str->len += num; +00086 } +00087 <span class="comment"></span> +00088 <span class="comment">/** Vsprintf into a String</span> +00089 <span class="comment"> * Use this if your function already has a va_list.</span> +00090 <span class="comment"> * You probably want _stp_sprintf().</span> +00091 <span class="comment"> */</span> +<a name="l00092"></a><a class="code" href="group__string.html#ga4">00092</a> <span class="keywordtype">void</span> <a class="code" href="group__string.html#ga4">_stp_vsprintf</a> (String str, <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, va_list args) +00093 { +00094 <span class="keywordtype">int</span> num; +00095 num = vscnprintf(str->buf + str->len, <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str->len - 1, fmt, args); +00096 <span class="keywordflow">if</span> (num > 0) +00097 str->len += num; +00098 } +00099 <span class="comment"></span> +00100 <span class="comment">/** ConCATenate (append) a C string to a String.</span> +00101 <span class="comment"> * Like strcat().</span> +00102 <span class="comment"> * @param str1 String</span> +00103 <span class="comment"> * @param str2 C string (char *)</span> +00104 <span class="comment"> * @sa _stp_string_cat</span> +00105 <span class="comment"> */</span> +<a name="l00106"></a><a class="code" href="group__string.html#ga5">00106</a> <span class="keywordtype">void</span> <a class="code" href="group__string.html#ga5">_stp_string_cat_cstr</a> (String str1, <span class="keyword">const</span> <span class="keywordtype">char</span> *str2) +00107 { +00108 <span class="keywordtype">int</span> num = strlen (str2); +00109 <span class="keywordflow">if</span> (num > <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str1->len - 1) +00110 num = <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str1->len - 1; +00111 strncpy (str1->buf + str1->len, str2, num+1); +00112 str1->len += num; +00113 } +00114 <span class="comment"></span> +00115 <span class="comment">/** ConCATenate (append) a String to a String.</span> +00116 <span class="comment"> * Like strcat().</span> +00117 <span class="comment"> * @param str1 String</span> +00118 <span class="comment"> * @param str2 String</span> +00119 <span class="comment"> * @sa _stp_string_cat</span> +00120 <span class="comment"> */</span> +<a name="l00121"></a><a class="code" href="group__string.html#ga6">00121</a> <span class="keywordtype">void</span> <a class="code" href="group__string.html#ga6">_stp_string_cat_string</a> (String str1, String str2) +00122 { +00123 <span class="keywordtype">int</span> num = str2->len; +00124 <span class="keywordflow">if</span> (num > <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str1->len - 1) +00125 num = <a class="code" href="group__string.html#ga8">STP_STRING_SIZE</a> - str1->len - 1; +00126 strncpy (str1->buf + str1->len, str2->buf, num); +00127 str1->len += num; +00128 } +00129 <span class="comment"></span> +00130 <span class="comment">/** Get a pointer to String's buffer</span> +00131 <span class="comment"> * For rare cases when a C string is needed and you have a String.</span> +00132 <span class="comment"> * One example is when you want to print a String with _stp_printf().</span> +00133 <span class="comment"> * @param str String</span> +00134 <span class="comment"> * @returns A C string (char *)</span> +00135 <span class="comment"> * @note Readonly. Don't write to this pointer or it will mess up</span> +00136 <span class="comment"> * the internal String state and probably mess up your output or crash something.</span> +00137 <span class="comment"> */</span> +<a name="l00138"></a><a class="code" href="group__string.html#ga7">00138</a> <span class="keywordtype">char</span> * <a class="code" href="group__string.html#ga7">_stp_string_ptr</a> (String str) +00139 { +00140 <span class="keywordflow">return</span> str->buf; +00141 } +00142 +00143 <span class="comment"></span> +00144 <span class="comment">/** ConCATenate (append) a String or C string to a String.</span> +00145 <span class="comment"> * This macro selects the proper function to call.</span> +00146 <span class="comment"> * @param str1 A String</span> +00147 <span class="comment"> * @param str2 A String or C string (char *)</span> +00148 <span class="comment"> * @sa _stp_string_cat_cstr _stp_string_cat_string</span> +00149 <span class="comment"> */</span> +<a name="l00150"></a><a class="code" href="group__string.html#ga9">00150</a> <span class="preprocessor">#define _stp_string_cat(str1, str2) \</span> +00151 <span class="preprocessor"> ({ \</span> +00152 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (str2), char[])) { \</span> +00153 <span class="preprocessor"> char *x = (char *)str2; \</span> +00154 <span class="preprocessor"> _str_string_cat_cstr(str1,x); \</span> +00155 <span class="preprocessor"> } else { \</span> +00156 <span class="preprocessor"> String x = (String)str2; \</span> +00157 <span class="preprocessor"> _str_string_cat_string(str1,x); \</span> +00158 <span class="preprocessor"> } \</span> +00159 <span class="preprocessor"> })</span> +00160 <span class="preprocessor"></span><span class="comment"></span> +00161 <span class="comment">/** @} */</span> +00162 <span class="preprocessor">#endif </span><span class="comment">/* _STRING_C_ */</span> +</pre></div></body></html> diff --git a/runtime/docs/html/string_8c.html b/runtime/docs/html/string_8c.html new file mode 100644 index 00000000..07151c62 --- /dev/null +++ b/runtime/docs/html/string_8c.html @@ -0,0 +1,52 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: string.c File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>string.c File Reference</h1>Implements String type. <a href="#_details">More...</a> +<p> +<code>#include <linux/config.h></code><br> + +<p> +<a href="string_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="string.c::STP_STRING_SIZE"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga8">STP_STRING_SIZE</a> 2048</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum string size allowed in Strings. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga9">_stp_string_cat</a>(str1, str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a String or C string to a String. <a href="group__string.html#ga9"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="string.c::String"></a> +typedef string * </td><td class="memItemRight" valign="bottom"><b>String</b></td></tr> + +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga2">_stp_string_init</a> (int num)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a String for our use. <a href="group__string.html#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga3">_stp_sprintf</a> (String str, const char *fmt,...)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sprintf into a String. <a href="group__string.html#ga3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga4">_stp_vsprintf</a> (String str, const char *fmt, va_list args)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Vsprintf into a String Use this if your function already has a va_list. <a href="group__string.html#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga5">_stp_string_cat_cstr</a> (String str1, const char *str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a C string to a String. <a href="group__string.html#ga5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga6">_stp_string_cat_string</a> (String str1, String str2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">ConCATenate (append) a String to a String. <a href="group__string.html#ga6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__string.html#ga7">_stp_string_ptr</a> (String str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to String's buffer For rare cases when a C string is needed and you have a String. <a href="group__string.html#ga7"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Implements String type. +<p> + +<p> +Definition in file <a class="el" href="string_8c-source.html">string.c</a>.</body></html> diff --git a/runtime/docs/html/structmap__node.html b/runtime/docs/html/structmap__node.html deleted file mode 100644 index c4c387ee..00000000 --- a/runtime/docs/html/structmap__node.html +++ /dev/null @@ -1,47 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: map_node Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map_node Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>basic map element -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="map_node::lnode"></a> -list_head </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node.html#o0">lnode</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">list of other nodes in the map <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="map_node::hnode"></a> -hlist_node </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node.html#o1">hnode</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">list of nodes with the same hash value <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o2" doxytag="map_node::key1"></a> -<a class="el" href="unionkey__data.html">key_data</a> </td><td class="memItemRight" valign="bottom"><b>key1</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o3" doxytag="map_node::key2"></a> -<a class="el" href="unionkey__data.html">key_data</a> </td><td class="memItemRight" valign="bottom"><b>key2</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o4" doxytag="map_node::key1type"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><b>key1type</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o5" doxytag="map_node::key2type"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><b>key2type</b></td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -basic map element -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00035">35</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/structmap__node__int64.html b/runtime/docs/html/structmap__node__int64.html deleted file mode 100644 index 4a8c3edc..00000000 --- a/runtime/docs/html/structmap__node__int64.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: map_node_int64 Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map_node_int64 Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>map element containing int64 -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="map_node_int64::n"></a> -<a class="el" href="structmap__node.html">map_node</a> </td><td class="memItemRight" valign="bottom"><b>n</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="map_node_int64::val"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>val</b></td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -map element containing int64 -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00047">47</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/structmap__node__stat.html b/runtime/docs/html/structmap__node__stat.html deleted file mode 100644 index fe581573..00000000 --- a/runtime/docs/html/structmap__node__stat.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: map_node_stat Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map_node_stat Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>map element containing stats -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="map_node_stat::n"></a> -<a class="el" href="structmap__node.html">map_node</a> </td><td class="memItemRight" valign="bottom"><b>n</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="map_node_stat::stats"></a> -<a class="el" href="structstat.html">stat</a> </td><td class="memItemRight" valign="bottom"><b>stats</b></td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -map element containing stats -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00059">59</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/structmap__node__str.html b/runtime/docs/html/structmap__node__str.html deleted file mode 100644 index fa970680..00000000 --- a/runtime/docs/html/structmap__node__str.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: map_node_str Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map_node_str Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>map element containing string -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="map_node_str::n"></a> -<a class="el" href="structmap__node.html">map_node</a> </td><td class="memItemRight" valign="bottom"><b>n</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="map_node_str::str"></a> -char * </td><td class="memItemRight" valign="bottom"><b>str</b></td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -map element containing string -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00053">53</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/structmap__root.html b/runtime/docs/html/structmap__root.html deleted file mode 100644 index 2a4eb819..00000000 --- a/runtime/docs/html/structmap__root.html +++ /dev/null @@ -1,170 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: map_root Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>map_root Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>This structure contains all information about a map. -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="map_root::type"></a> -enum <a class="el" href="group__maps.html#ga33">valtype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o0">type</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">type of the values stored in the array <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="map_root::maxnum"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o1">maxnum</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">maximum number of elements allowed in the array. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o2" doxytag="map_root::num"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o2">num</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">current number of used elements <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o3" doxytag="map_root::no_wrap"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o3">no_wrap</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">when more than maxnum elements, wrap or discard? <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o4" doxytag="map_root::head"></a> -list_head </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o4">head</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">linked list of current entries <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">list_head </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o5">pool</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">pool of unused entries. <a href="#o5"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o6" doxytag="map_root::key"></a> -<a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o6">key</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">saved key entry for lookups <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">u_int8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o7">create</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">this is the creation data saved between the key functions and the set/get functions <a href="#o7"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o8" doxytag="map_root::c_key1type"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><b>c_key1type</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o9" doxytag="map_root::c_key2type"></a> -enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><b>c_key2type</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o10" doxytag="map_root::c_keyhead"></a> -hlist_head * </td><td class="memItemRight" valign="bottom"><b>c_keyhead</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o11" doxytag="map_root::c_key1"></a> -<a class="el" href="unionkey__data.html">key_data</a> </td><td class="memItemRight" valign="bottom"><b>c_key1</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o12" doxytag="map_root::c_key2"></a> -<a class="el" href="unionkey__data.html">key_data</a> </td><td class="memItemRight" valign="bottom"><b>c_key2</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o13" doxytag="map_root::hashes"></a> -hlist_head </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o13">hashes</a> [HASH_TABLE_SIZE]</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">the hash table for this array <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o14">membuf</a></td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">pointer to allocated memory space. <a href="#o14"></a><br></td></tr> -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -This structure contains all information about a map. -<p> -It is allocated once when <a class="el" href="group__maps.html#ga2">_stp_map_new()</a> is called. -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00067">67</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr><h2>Field Documentation</h2> -<a class="anchor" name="o7" doxytag="map_root::create"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">u_int8_t <a class="el" href="structmap__root.html#o7">map_root::create</a> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -this is the creation data saved between the key functions and the set/get functions -<p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000009">Todo:</a></b></dt><dd>Needs to be per-cpu data for SMP support</dd></dl> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00093">93</a> of file <a class="el" href="map_8h-source.html">map.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00568">_stp_map_get_int64()</a>, <a class="el" href="map_8c-source.html#l00732">_stp_map_get_stat()</a>, <a class="el" href="map_8c-source.html#l00649">_stp_map_get_str()</a>, <a class="el" href="map_8c-source.html#l00233">_stp_map_key_long_long()</a>, <a class="el" href="map_8c-source.html#l00373">_stp_map_key_long_str()</a>, <a class="el" href="map_8c-source.html#l00325">_stp_map_key_str_long()</a>, <a class="el" href="map_8c-source.html#l00276">_stp_map_key_str_str()</a>, <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>, and <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add()</a>. </td> - </tr> -</table> -<a class="anchor" name="o14" doxytag="map_root::membuf"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">void* <a class="el" href="structmap__root.html#o14">map_root::membuf</a> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -pointer to allocated memory space. -<p> -Used for freeing memory. -<p> -Definition at line <a class="el" href="map_8h-source.html#l00104">104</a> of file <a class="el" href="map_8h-source.html">map.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00205">_stp_map_del()</a>, and <a class="el" href="map_8c-source.html#l00057">_stp_map_new()</a>. </td> - </tr> -</table> -<a class="anchor" name="o5" doxytag="map_root::pool"></a><p> -<table class="mdTable" cellpadding="2" cellspacing="0"> - <tr> - <td class="mdRow"> - <table cellpadding="0" cellspacing="0" border="0"> - <tr> - <td class="md" nowrap valign="top">struct list_head <a class="el" href="structmap__root.html#o5">map_root::pool</a> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -pool of unused entries. -<p> -Used only when entries are statically allocated at startup. -<p> -Definition at line <a class="el" href="map_8h-source.html#l00085">85</a> of file <a class="el" href="map_8h-source.html">map.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00813">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00057">_stp_map_new()</a>, <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> - </tr> -</table> -<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/structstat.html b/runtime/docs/html/structstat.html deleted file mode 100644 index 16155517..00000000 --- a/runtime/docs/html/structstat.html +++ /dev/null @@ -1,42 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: stat Struct Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>stat Struct Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>Statistics are stored in this struct. -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="stat::count"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>count</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="stat::sum"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>sum</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o2" doxytag="stat::min"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>min</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o3" doxytag="stat::max"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>max</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o4" doxytag="stat::histogram"></a> -int64_t </td><td class="memItemRight" valign="bottom"><b>histogram</b> [BUCKETS]</td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -Statistics are stored in this struct. -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00015">15</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this struct was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> diff --git a/runtime/docs/html/sym_8c-source.html b/runtime/docs/html/sym_8c-source.html index 2e8ffc8a..8e7f21b8 100644 --- a/runtime/docs/html/sym_8c-source.html +++ b/runtime/docs/html/sym_8c-source.html @@ -4,11 +4,11 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>sym.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _SYM_C_ </span><span class="comment">/* -*- linux-c -*- */</span> 00002 <span class="preprocessor">#define _SYM_C_</span> 00003 <span class="preprocessor"></span> -00004 <span class="preprocessor">#include "scbuf.c"</span> +00004 <span class="preprocessor">#include "<a class="code" href="string_8c.html">string.c</a>"</span> 00005 <span class="comment"></span> 00006 <span class="comment">/** @file sym.c</span> 00007 <span class="comment"> * @addtogroup sym Symbolic Functions</span> @@ -26,48 +26,54 @@ 00019 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *offset, 00020 <span class="keywordtype">char</span> **modname, <span class="keywordtype">char</span> *namebuf)=(<span class="keywordtype">void</span> *)KALLSYMS_LOOKUP; 00021 -00022 <span class="keyword">static</span> <span class="keywordtype">void</span> __stp_symbol_print (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address, <span class="keywordtype">void</span> (*prtfunc)(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...)) -00023 { -00024 <span class="keywordtype">char</span> *modname; -00025 <span class="keyword">const</span> <span class="keywordtype">char</span> *name; -00026 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset, size; -00027 <span class="keywordtype">char</span> namebuf[KSYM_NAME_LEN+1]; -00028 -00029 name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); -00030 -00031 (*prtfunc)(<span class="stringliteral">"0x%lx : "</span>, address); -00032 <span class="keywordflow">if</span> (modname) -00033 (*prtfunc)(<span class="stringliteral">"%s+%#lx/%#lx [%s]"</span>, name, offset, size, modname); -00034 <span class="keywordflow">else</span> -00035 (*prtfunc)(<span class="stringliteral">"%s+%#lx/%#lx"</span>, name, offset, size); -00036 } -00037 <span class="comment"></span> -00038 <span class="comment">/** Print addresses symbolically into a string</span> -00039 <span class="comment"> * @param address The address to lookup.</span> -00040 <span class="comment"> * @note Symbolic lookups should not be done within</span> -00041 <span class="comment"> * a probe because it is too time-consuming. Use at module exit time.</span> -00042 <span class="comment"> * @note Uses scbuf.</span> -00043 <span class="comment"> */</span> -00044 -<a name="l00045"></a><a class="code" href="group__sym.html#ga2">00045</a> <span class="keywordtype">char</span> * <a class="code" href="group__sym.html#ga2">_stp_symbol_sprint</a> (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) -00046 { -00047 <span class="keywordtype">char</span> *ptr = _stp_scbuf_cur(); -00048 __stp_symbol_print (address, <a class="code" href="group__scbuf.html#ga2">_stp_sprint</a>); -00049 <span class="keywordflow">return</span> ptr; -00050 } -00051 -00052 <span class="comment"></span> -00053 <span class="comment">/** Print addresses symbolically to the trace buffer.</span> -00054 <span class="comment"> * @param address The address to lookup.</span> -00055 <span class="comment"> * @note Symbolic lookups should not be done within</span> -00056 <span class="comment"> * a probe because it is too time-consuming. Use at module exit time.</span> -00057 <span class="comment"> */</span> -00058 -<a name="l00059"></a><a class="code" href="group__sym.html#ga3">00059</a> <span class="keywordtype">void</span> <a class="code" href="group__sym.html#ga3">_stp_symbol_print</a> (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) -00060 { -00061 __stp_symbol_print (address, <a class="code" href="group__io.html#ga1">_stp_print</a>); -00062 } -00063 <span class="comment"></span> -00064 <span class="comment">/** @} */</span> -00065 <span class="preprocessor">#endif </span><span class="comment">/* _SYM_C_ */</span> +00022 <span class="comment"></span> +00023 <span class="comment">/** Write addresses symbolically into a String</span> +00024 <span class="comment"> * @param str String</span> +00025 <span class="comment"> * @param address The address to lookup.</span> +00026 <span class="comment"> * @note Symbolic lookups should not normally be done within</span> +00027 <span class="comment"> * a probe because it is too time-consuming. Use at module exit time.</span> +00028 <span class="comment"> */</span> +00029 +<a name="l00030"></a><a class="code" href="group__sym.html#ga1">00030</a> String <a class="code" href="group__sym.html#ga1">_stp_symbol_sprint</a> (String str, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) +00031 { +00032 <span class="keywordtype">char</span> *modname; +00033 <span class="keyword">const</span> <span class="keywordtype">char</span> *name; +00034 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset, size; +00035 <span class="keywordtype">char</span> namebuf[KSYM_NAME_LEN+1]; +00036 +00037 name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); +00038 +00039 <a class="code" href="group__string.html#ga3">_stp_sprintf</a> (str, <span class="stringliteral">"0x%lx : "</span>, address); +00040 <span class="keywordflow">if</span> (modname) +00041 <a class="code" href="group__string.html#ga3">_stp_sprintf</a> (str, <span class="stringliteral">"%s+%#lx/%#lx [%s]"</span>, name, offset, size, modname); +00042 <span class="keywordflow">else</span> +00043 <a class="code" href="group__string.html#ga3">_stp_sprintf</a> (str, <span class="stringliteral">"%s+%#lx/%#lx"</span>, name, offset, size); +00044 <span class="keywordflow">return</span> str; +00045 } +00046 +00047 <span class="comment"></span> +00048 <span class="comment">/** Print addresses symbolically to the print buffer.</span> +00049 <span class="comment"> * @param address The address to lookup.</span> +00050 <span class="comment"> * @note Symbolic lookups should not normally be done within</span> +00051 <span class="comment"> * a probe because it is too time-consuming. Use at module exit time.</span> +00052 <span class="comment"> */</span> +00053 +<a name="l00054"></a><a class="code" href="group__sym.html#ga2">00054</a> <span class="keywordtype">void</span> <a class="code" href="group__sym.html#ga2">_stp_symbol_print</a> (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) +00055 { +00056 <span class="keywordtype">char</span> *modname; +00057 <span class="keyword">const</span> <span class="keywordtype">char</span> *name; +00058 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset, size; +00059 <span class="keywordtype">char</span> namebuf[KSYM_NAME_LEN+1]; +00060 +00061 name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); +00062 +00063 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"0x%lx : "</span>, address); +00064 <span class="keywordflow">if</span> (modname) +00065 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%s+%#lx/%#lx [%s]"</span>, name, offset, size, modname); +00066 <span class="keywordflow">else</span> +00067 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"%s+%#lx/%#lx"</span>, name, offset, size); +00068 } +00069 <span class="comment"></span> +00070 <span class="comment">/** @} */</span> +00071 <span class="preprocessor">#endif </span><span class="comment">/* _SYM_C_ */</span> </pre></div></body></html> diff --git a/runtime/docs/html/test4_2dtr_8c-source.html b/runtime/docs/html/test4_2dtr_8c-source.html index af19db1a..c3d65197 100644 --- a/runtime/docs/html/test4_2dtr_8c-source.html +++ b/runtime/docs/html/test4_2dtr_8c-source.html @@ -4,260 +4,149 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000003.html">test4</a></div> <h1>dtr.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#define HASH_TABLE_BITS 8</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1<<HASH_TABLE_BITS)</span> 00003 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span> -00004 <span class="preprocessor">#include <linux/module.h></span> -00005 <span class="preprocessor">#include <linux/interrupt.h></span> -00006 <span class="preprocessor">#include <net/sock.h></span> -00007 <span class="preprocessor">#include <linux/netlink.h></span> -00008 -00009 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> -00010 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span> -00011 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> -00012 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> -00013 <span class="preprocessor">#include "<a class="code" href="stack_8c.html">stack.c</a>"</span> -00014 -00015 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: test4"</span>); -00016 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); +00004 +00005 <span class="preprocessor">#define STP_NETLINK_ONLY</span> +00006 <span class="preprocessor"></span><span class="preprocessor">#define STP_NUM_STRINGS 1</span> +00007 <span class="preprocessor"></span> +00008 <span class="preprocessor">#include <linux/module.h></span> +00009 <span class="preprocessor">#include <linux/interrupt.h></span> +00010 <span class="preprocessor">#include <net/sock.h></span> +00011 <span class="preprocessor">#include <linux/netlink.h></span> +00012 +00013 <span class="preprocessor">#include "<a class="code" href="runtime_8h.html">runtime.h</a>"</span> +00014 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> +00015 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> +00016 <span class="preprocessor">#include "<a class="code" href="stack_8c.html">stack.c</a>"</span> 00017 -00018 <span class="keyword">static</span> <span class="keywordtype">char</span> tbuffer[2][50000]; -00019 <span class="keyword">static</span> <span class="keywordtype">void</span> stp_helper(<span class="keywordtype">void</span> *); -00020 <span class="keyword">static</span> DECLARE_WORK(stp_work, stp_helper, tbuffer); +00018 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: test4"</span>); +00019 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); +00020 00021 -00022 <a class="code" href="structmap__root.html">MAP</a> opens, reads, writes, traces; -00023 <span class="keyword">static</span> <span class="keywordtype">int</span> bufcount = 0; -00024 -00025 <span class="comment">/* netlink control channel */</span> -00026 <span class="keyword">static</span> <span class="keyword">struct </span>sock *control; -00027 <span class="keyword">static</span> <span class="keywordtype">int</span> seq = 0; -00028 -00029 <span class="keywordtype">int</span> pid; -00030 <span class="comment">/*</span> -00031 <span class="comment"> * send_reply - send reply to userspace over netlink control channel</span> -00032 <span class="comment"> */</span> -00033 <span class="keyword">static</span> <span class="keywordtype">int</span> send_reply(<span class="keywordtype">int</span> type, <span class="keywordtype">void</span> *reply, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> pid) -00034 { -00035 <span class="keyword">struct </span>sk_buff *skb; -00036 <span class="keyword">struct </span>nlmsghdr *nlh; -00037 <span class="keywordtype">void</span> *data; -00038 <span class="keywordtype">int</span> size; -00039 <span class="keywordtype">int</span> err; -00040 -00041 size = NLMSG_SPACE(len); -00042 skb = alloc_skb(size, GFP_KERNEL); -00043 <span class="keywordflow">if</span> (!skb) -00044 return -1; -00045 nlh = NLMSG_PUT(skb, pid, seq++, type, size - sizeof(*nlh)); -00046 nlh->nlmsg_flags = 0; -00047 data = NLMSG_DATA(nlh); -00048 memcpy(data, reply, len); -00049 err = netlink_unicast(control, skb, pid, MSG_DONTWAIT); -00050 -00051 return 0; -00052 -00053 nlmsg_failure: -00054 if (skb) -00055 kfree_skb(skb); -00056 -00057 return -1; -00058 } +00022 <a class="code" href="group__maps.html#ga1">MAP</a> opens, reads, writes, traces; +00023 +00024 asmlinkage <span class="keywordtype">long</span> inst_sys_open (<span class="keyword">const</span> <span class="keywordtype">char</span> __user * filename, <span class="keywordtype">int</span> flags, <span class="keywordtype">int</span> mode) +00025 { +00026 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (opens, current->comm); +00027 <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a> (opens, 1); +00028 jprobe_return(); +00029 <span class="keywordflow">return</span> 0; +00030 } +00031 +00032 asmlinkage ssize_t inst_sys_read (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keywordtype">char</span> __user * buf, size_t count) +00033 { +00034 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (reads, current->comm); +00035 <a class="code" href="group__maps.html#ga24">_stp_map_stat_add</a> (reads, count); +00036 jprobe_return(); +00037 <span class="keywordflow">return</span> 0; +00038 } +00039 +00040 asmlinkage ssize_t inst_sys_write (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">char</span> __user * buf, size_t count) +00041 { +00042 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (writes, current->comm); +00043 <a class="code" href="group__maps.html#ga24">_stp_map_stat_add</a> (writes, count); +00044 jprobe_return(); +00045 <span class="keywordflow">return</span> 0; +00046 } +00047 +00048 <span class="keywordtype">int</span> inst_show_cpuinfo(<span class="keyword">struct</span> seq_file *m, <span class="keywordtype">void</span> *v) +00049 { +00050 String str = <a class="code" href="group__string.html#ga2">_stp_string_init</a> (0); +00051 <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (0,0); +00052 <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (1,0); +00053 <a class="code" href="group__lists.html#ga6">_stp_list_add</a> (traces, <a class="code" href="group__stack.html#ga7">_stp_stack_sprint</a>(str, 0, 0)); +00054 +00055 jprobe_return(); +00056 <span class="keywordflow">return</span> 0; +00057 } +00058 00059 -00060 static <span class="keywordtype">char</span> pbuff[1024]; -00061 -00062 <span class="keywordtype">void</span> nlog (const <span class="keywordtype">char</span> *fmt, ...) -00063 { -00064 <span class="keywordtype">int</span> len; -00065 va_list args; -00066 va_start(args, fmt); -00067 len = vscnprintf (pbuff, <span class="keyword">sizeof</span>(pbuff), fmt, args) + 1; -00068 va_end(args); -00069 send_reply (42, pbuff, len, pid); -00070 } -00071 -00072 <span class="comment">/*</span> -00073 <span class="comment"> * msg_rcv_skb - dispatch userspace requests from netlink control channel</span> -00074 <span class="comment"> */</span> -00075 <span class="keyword">static</span> <span class="keywordtype">void</span> msg_rcv_skb(<span class="keyword">struct</span> sk_buff *skb) -00076 { -00077 <span class="keyword">struct </span>nlmsghdr *nlh = NULL; -00078 <span class="keywordtype">int</span> flags; -00079 <span class="keywordtype">int</span> nlmsglen, skblen; -00080 <span class="keywordtype">void</span> *data; -00081 -00082 skblen = skb->len; -00083 <span class="comment">// dlog ("skblen = %d %d\n", skblen, sizeof(*nlh));</span> -00084 <span class="keywordflow">if</span> (skblen < <span class="keyword">sizeof</span> (*nlh)) -00085 return; -00086 -00087 nlh = (struct nlmsghdr *)skb->data; -00088 nlmsglen = nlh->nlmsg_len; -00089 -00090 <span class="comment">// dlog ("nlmsghlen=%d\n", nlmsglen);</span> -00091 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen) -00092 return; -00093 -00094 pid = nlh->nlmsg_pid; -00095 flags = nlh->nlmsg_flags; -00096 -00097 <span class="comment">// dlog ("pid=%d flags=%x %x %x %x\n", pid, flags, NLM_F_REQUEST, MSG_TRUNC, NLM_F_ACK);</span> -00098 if (pid <= 0 || !(flags & NLM_F_REQUEST)) { -00099 netlink_ack(skb, nlh, -EINVAL); -00100 <span class="keywordflow">return</span>; -00101 } -00102 -00103 <span class="keywordflow">if</span> (flags & MSG_TRUNC) { -00104 netlink_ack(skb, nlh, -ECOMM); -00105 <span class="keywordflow">return</span>; -00106 } -00107 -00108 data = NLMSG_DATA(nlh); -00109 -00110 <span class="comment">// dlog ("NETLINK: Got message \"%s\" of type %d from pid %d\n", data, nlh->nlmsg_type,pid);</span> -00111 -00112 <span class="keywordflow">if</span> (flags & NLM_F_ACK) -00113 netlink_ack(skb, nlh, 0); -00114 -00115 send_reply (42, "Howdy Partner", 14, pid); -00116 } -00117 -00118 static <span class="keywordtype">void</span> msg_rcv(struct sock *sk, <span class="keywordtype">int</span> len) -00119 { -00120 <span class="keyword">struct </span>sk_buff *skb; -00121 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"netlink message received\n"</span>); -00122 <span class="keywordflow">while</span> ((skb = skb_dequeue(&sk->sk_receive_queue))) { -00123 msg_rcv_skb(skb); -00124 kfree_skb(skb); -00125 } -00126 } -00127 -00128 <span class="keyword">static</span> <span class="keywordtype">void</span> stp_helper (<span class="keywordtype">void</span> *data) -00129 { -00130 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"HELPER\n"</span>); -00131 } -00132 -00133 asmlinkage <span class="keywordtype">long</span> inst_sys_open (<span class="keyword">const</span> <span class="keywordtype">char</span> __user * filename, <span class="keywordtype">int</span> flags, <span class="keywordtype">int</span> mode) -00134 { -00135 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (opens, current->comm); -00136 <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a> (opens, 1); -00137 jprobe_return(); -00138 <span class="keywordflow">return</span> 0; -00139 } -00140 -00141 asmlinkage ssize_t inst_sys_read (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keywordtype">char</span> __user * buf, size_t count) -00142 { -00143 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (reads, current->comm); -00144 <a class="code" href="group__maps.html#ga23">_stp_map_stat_add</a> (reads, count); -00145 jprobe_return(); -00146 <span class="keywordflow">return</span> 0; -00147 } -00148 -00149 asmlinkage ssize_t inst_sys_write (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">char</span> __user * buf, size_t count) -00150 { -00151 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (writes, current->comm); -00152 <a class="code" href="group__maps.html#ga23">_stp_map_stat_add</a> (writes, count); -00153 jprobe_return(); -00154 <span class="keywordflow">return</span> 0; -00155 } -00156 -00157 <span class="keywordtype">int</span> inst_show_cpuinfo(<span class="keyword">struct</span> seq_file *m, <span class="keywordtype">void</span> *v) -00158 { -00159 <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (0,0); -00160 <a class="code" href="group__stack.html#ga6">_stp_stack_print</a> (1,0); -00161 -00162 <a class="code" href="group__scbuf.html#ga4">_stp_scbuf_clear</a>(); -00163 <a class="code" href="group__lists.html#ga5">_stp_list_add</a> (traces, _stp_stack_sprint(0,0)); -00164 <span class="keywordflow">if</span> (bufcount++ == 0) -00165 schedule_work (&stp_work); -00166 -00167 jprobe_return(); -00168 return 0; -00169 } -00170 -00171 -00172 static struct jprobe dtr_probes[] = { -00173 { -00174 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_open"</span>, -00175 .entry = (kprobe_opcode_t *) inst_sys_open -00176 }, -00177 { -00178 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_read"</span>, -00179 .entry = (kprobe_opcode_t *) inst_sys_read -00180 }, -00181 { -00182 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>, -00183 .entry = (kprobe_opcode_t *) inst_sys_write -00184 }, -00185 { -00186 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"show_cpuinfo"</span>, -00187 .entry = (kprobe_opcode_t *) inst_show_cpuinfo, -00188 }, -00189 }; -00190 -00191 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span> -00192 <span class="preprocessor"></span> -00193 <span class="keyword">static</span> <span class="keywordtype">int</span> init_dtr(<span class="keywordtype">void</span>) -00194 { -00195 <span class="keywordtype">int</span> ret; -00196 -00197 control = netlink_kernel_create(31, msg_rcv); -00198 <span class="keywordflow">if</span> (!control) { -00199 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"Couldn't create netlink channel\n"</span>); -00200 <span class="keywordflow">return</span> -1; -00201 } -00202 -00203 opens = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, INT64); -00204 reads = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, STAT); -00205 writes = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, STAT); -00206 traces = <a class="code" href="group__lists.html#ga0">_stp_list_new</a> (1000, STRING); -00207 -00208 ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00209 -00210 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); -00211 <span class="keywordflow">return</span> ret; -00212 -00213 } -00214 -00215 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) -00216 { -00217 <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> *st; -00218 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *ptr; -00219 <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> *sptr; -00220 -00221 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00222 -00223 <a class="code" href="group__maps.html#ga31">foreach</a> (traces, sptr) -00224 nlog ("trace: %s\n", sptr->str); -00225 -00226 foreach (opens, ptr) -00227 nlog ("opens[%s] = %lld\n", key1str(ptr), ptr->val); -00228 nlog ("\n"); -00229 -00230 foreach (reads, st) -00231 nlog ("reads[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), -00232 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); -00233 nlog ("\n"); -00234 -00235 foreach (writes, st) -00236 nlog ("writes[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), -00237 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); -00238 nlog ("\n"); -00239 -00240 _stp_map_del (opens); -00241 _stp_map_del (reads); -00242 _stp_map_del (writes); -00243 -00244 if (control) -00245 sock_release(control->sk_socket); -00246 -00247 dlog("EXIT\n"); -00248 } -00249 -00250 module_init(init_dtr); -00251 module_exit(cleanup_dtr); -00252 MODULE_LICENSE("GPL"); -00253 +00060 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe dtr_probes[] = { +00061 { +00062 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_open"</span>, +00063 .entry = (kprobe_opcode_t *) inst_sys_open +00064 }, +00065 { +00066 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_read"</span>, +00067 .entry = (kprobe_opcode_t *) inst_sys_read +00068 }, +00069 { +00070 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>, +00071 .entry = (kprobe_opcode_t *) inst_sys_write +00072 }, +00073 { +00074 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"show_cpuinfo"</span>, +00075 .entry = (kprobe_opcode_t *) inst_show_cpuinfo, +00076 }, +00077 }; +00078 +00079 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span> +00080 <span class="preprocessor"></span> +00081 <span class="keyword">static</span> <span class="keywordtype">int</span> init_dtr(<span class="keywordtype">void</span>) +00082 { +00083 <span class="keywordtype">int</span> ret; +00084 +00085 <span class="keywordflow">if</span> (<a class="code" href="group__io.html#ga7">_stp_netlink_open</a>() < 0) +00086 return -1; +00087 +00088 opens = _stp_map_new (1000, INT64); +00089 reads = _stp_map_new (1000, STAT); +00090 writes = _stp_map_new (1000, STAT); +00091 traces = _stp_list_new (1000, STRING); +00092 +00093 ret = _stp_register_jprobes (dtr_probes, MAX_DTR_ROUTINE); +00094 +00095 _stp_log("instrumentation is enabled...\n"); +00096 return ret; +00097 } +00098 +00099 static <span class="keywordtype">void</span> probe_exit (<span class="keywordtype">void</span>) +00100 { +00101 <span class="keyword">struct </span>map_node_stat *st; +00102 <span class="keyword">struct </span>map_node_int64 *ptr; +00103 <span class="keyword">struct </span>map_node_str *sptr; +00104 +00105 <a class="code" href="probes_8c.html#a2">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); +00106 +00107 <a class="code" href="group__maps.html#ga32">foreach</a> (traces, sptr) { +00108 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"trace: %s\n"</span>, sptr->str); +00109 <a class="code" href="group__print.html#ga2">_stp_print_flush</a> (); +00110 } +00111 +00112 <a class="code" href="group__maps.html#ga32">foreach</a> (opens, ptr) { +00113 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"opens[%s] = %lld\n"</span>, <a class="code" href="group__maps.html#ga25">key1str</a>(ptr), ptr->val); +00114 <a class="code" href="group__print.html#ga2">_stp_print_flush</a> (); +00115 } +00116 +00117 <a class="code" href="group__maps.html#ga32">foreach</a> (reads, st) { +00118 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"reads[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n"</span>, <a class="code" href="group__maps.html#ga25">key1str</a>(st), +00119 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); +00120 <a class="code" href="group__print.html#ga2">_stp_print_flush</a> (); +00121 } +00122 +00123 <a class="code" href="group__maps.html#ga32">foreach</a> (writes, st) { +00124 <a class="code" href="group__print.html#ga3">_stp_printf</a> (<span class="stringliteral">"writes[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n"</span>, <a class="code" href="group__maps.html#ga25">key1str</a>(st), +00125 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); +00126 <a class="code" href="group__print.html#ga2">_stp_print_flush</a>(); +00127 } +00128 +00129 <a class="code" href="group__maps.html#ga7">_stp_map_del</a> (opens); +00130 <a class="code" href="group__maps.html#ga7">_stp_map_del</a> (reads); +00131 <a class="code" href="group__maps.html#ga7">_stp_map_del</a> (writes); +00132 } +00133 +00134 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) +00135 { +00136 <a class="code" href="group__io.html#ga8">_stp_netlink_close</a>(); +00137 } +00138 +00139 module_init(init_dtr); +00140 module_exit(cleanup_dtr); +00141 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); +00142 </pre></div></body></html> diff --git a/runtime/docs/html/todo.html b/runtime/docs/html/todo.html index 22265a06..8b147af8 100644 --- a/runtime/docs/html/todo.html +++ b/runtime/docs/html/todo.html @@ -4,10 +4,60 @@ <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1><a class="anchor" name="todo">Todo List</a></h1><a class="anchor" name="_todo000009"></a> <dl> -<dt>Global <a class="el" href="structmap__root.html#o7">map_root::create</a> </dt> -<dd>Needs to be per-cpu data for SMP support</dd> +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1><a class="anchor" name="todo">Todo List</a></h1><a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd needs an option to disable ANSI colors. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd needs to be able to write netlink REALTIME_DATA to a file. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd/stp/io.c stpd needs better startup/shutdown integration with <a class="el" href="io_8c.html">io.c</a> in runtime. Shutdown works, but isn't very clean. Currently the stp script loads the module, then starts stpd. Data is lost until stpd is active. Maybe stpd needs to load the module. Maybe it needs to signal the module that stpd is ready and the module can proceed to load the probes. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd/stp - What if there are multiple probes running? </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd/stp - Need something to post-process relayfs files and integrate into a single file. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>stpd - Implement command that runtime can send to stpd to tell it to fork a specified program and pass the output from the probe module to it. Create example probe to use it. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>relayfs/build - figure out how to get rid of the linker warnings when building probes. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>runtime - Clean up #defines. Need to have a clearer way to have the probe writer (translator) see which defines affect what and all defines should have reasonable defaults. </dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>runtime - <a class="el" href="current_8c.html">current.c</a> - implement a memory dump function. Does a hex dump into String or print buffer.</dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>runtime - put wrappers around current task struct entries, like pid, ppid, comm, etc.</dd> +</dl> +<p> +<a class="anchor" name="_todo000010"></a> <dl> +<dt>File <a class="el" href="TODO.html">TODO</a> </dt> +<dd>runtime - Implement stack functions for kprobes (not just jprobes) </dd> </dl> <p> <a class="anchor" name="_todo000001"></a> <dl> @@ -20,33 +70,38 @@ <dd>Some of these currently use kmalloc (GFP_ATOMIC) for small allocations. This should be evaluated for performance and stability.</dd> </dl> <p> -<a class="anchor" name="_todo000004"></a> <dl> -<dt>Global <a class="el" href="group__io.html#ga1">_stp_print</a> (const char *fmt,...) </dt> -<dd>Needs replaced with something much faster that does not use the system log. </dd> +<a class="anchor" name="_todo000003"></a> <dl> +<dt>Global <a class="el" href="group__io.html#ga2">_stp_log</a> (const char *fmt,...) </dt> +<dd>Evaluate if this function is necessary. </dd> </dl> <p> -<a class="anchor" name="_todo000005"></a> <dl> -<dt>Global <a class="el" href="group__io.html#ga2">_stp_print_str</a> (char *str) </dt> -<dd>Needs replaced with something much faster that does not use the system log. </dd> +<a class="anchor" name="_todo000006"></a> <dl> +<dt>Group <a class="el" href="group__maps.html">maps</a> </dt> +<dd>Needs to be made SMP-safe for when the big lock is removed from kprobes.</dd> </dl> <p> -<a class="anchor" name="_todo000003"></a> <dl> -<dt>Global <a class="el" href="group__io.html#ga0">dlog</a> (const char *fmt,...) </dt> -<dd>Either deprecate or redefine this as a way to log debug or status messages, separate from the normal program output. </dd> +<a class="anchor" name="_todo000004"></a> <dl> +<dt>Global <a class="el" href="group__maps.html#ga22">_stp_map_set_stat</a> (MAP map, stat *stats) </dt> +<dd>Histograms don't work yet. </dd> </dl> <p> -<a class="anchor" name="_todo000006"></a> <dl> -<dt>Global <a class="el" href="group__maps.html#ga21">_stp_map_set_stat</a> (MAP map, stat *stats) </dt> +<a class="anchor" name="_todo000005"></a> <dl> +<dt>Global <a class="el" href="group__maps.html#ga24">_stp_map_stat_add</a> (MAP map, int64_t val) </dt> <dd>Histograms don't work yet. </dd> </dl> <p> <a class="anchor" name="_todo000007"></a> <dl> -<dt>Global <a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a> (MAP map, int64_t val) </dt> -<dd>Histograms don't work yet. </dd> +<dt>Global <a class="el" href="group__stack.html#ga6">_stp_stack_print</a> (int verbose, int levels) </dt> +<dd>Implement verbosity and levels parameters.</dd> </dl> <p> <a class="anchor" name="_todo000008"></a> <dl> -<dt>Group <a class="el" href="group__scbuf.html">scbuf</a> </dt> -<dd>Need careful review of these to insure safety.</dd> +<dt>Global <a class="el" href="group__stack.html#ga7">_stp_stack_sprint</a> (String str, int verbose, int levels) </dt> +<dd>Implement verbosity and levels parameters.</dd> +</dl> +<p> +<a class="anchor" name="_todo000009"></a> <dl> +<dt>Global <a class="el" href="group__string.html#ga2">_stp_string_init</a> (int num) </dt> +<dd>Global (and static) Strings not implemented yet. </dd> </dl> </body></html> diff --git a/runtime/docs/html/tree.html b/runtime/docs/html/tree.html deleted file mode 100644 index 1d3f49b0..00000000 --- a/runtime/docs/html/tree.html +++ /dev/null @@ -1,139 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <meta http-equiv="Content-Type" content="text/xhtml;charset="iso-8859-1" /> - <meta http-equiv="Content-Style-Type" content="text/css" /> - <meta http-equiv="Content-Language" content="en" /> - <link rel="stylesheet" href="doxygen.css"> - <title>TreeView</title> - <style type="text/css"> - <!-- - .directory { font-size: 10pt; font-weight: bold; } - .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } - .directory p { margin: 0px; white-space: nowrap; } - .directory div { display: none; margin: 0px; } - .directory img { vertical-align: middle; } - --> - </style> - <script type="text/javascript"> - <!-- // Hide script from old browsers - - function findChildNode(node, name) - { - var temp; - if (node == null) - { - return null; - } - node = node.firstChild; - while (node != null) - { - if (node.nodeName == name) - { - return node; - } - temp = findChildNode(node, name); - if (temp != null) - { - return temp; - } - node = node.nextSibling; - } - return null; - } - - function toggleFolder(id, imageNode) - { - var folder = document.getElementById(id); - var l = 0; - var vl = "ftv2vertline.png"; - if (imageNode != null && imageNode.nodeName != "IMG") - { - imageNode = findChildNode(imageNode, "IMG"); - if (imageNode!=null) l = imageNode.src.length; - } - if (folder == null) - { - } - else if (folder.style.display == "block") - { - while (imageNode != null && - imageNode.src.substring(l-vl.length,l) == vl) - { - imageNode = imageNode.nextSibling; - l = imageNode.src.length; - } - if (imageNode != null) - { - l = imageNode.src.length; - imageNode.nextSibling.src = "ftv2folderclosed.png"; - if (imageNode.src.substring(l-13,l) == "ftv2mnode.png") - { - imageNode.src = "ftv2pnode.png"; - } - else if (imageNode.src.substring(l-17,l) == "ftv2mlastnode.png") - { - imageNode.src = "ftv2plastnode.png"; - } - } - folder.style.display = "none"; - } - else - { - while (imageNode != null && - imageNode.src.substring(l-vl.length,l) == vl) - { - imageNode = imageNode.nextSibling; - l = imageNode.src.length; - } - if (imageNode != null) - { - l = imageNode.src.length; - imageNode.nextSibling.src = "ftv2folderopen.png"; - if (imageNode.src.substring(l-13,l) == "ftv2pnode.png") - { - imageNode.src = "ftv2mnode.png"; - } - else if (imageNode.src.substring(l-17,l) == "ftv2plastnode.png") - { - imageNode.src = "ftv2mlastnode.png"; - } - } - folder.style.display = "block"; - } - } - - // End script hiding --> - </script> - </head> - - <body> - <div class="directory"> - <h3>SystemTap</h3> - <div style="display: block;"> - <p><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="main.html" target="basefrm">SystemTap Runtime Library</a></p> - <p><img src="ftv2pnode.png" alt="o" width=16 height=22 onclick="toggleFolder('folder1', this)"/><img src="ftv2folderclosed.png" alt="+" width=24 height=22 onclick="toggleFolder('folder1', this)"/><a class="el" href="files.html" target="basefrm">File List</a></p> - <div id="folder1"> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="alloc_8h.html" target="basefrm">alloc.h</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="copy_8c.html" target="basefrm">copy.c</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="io_8c.html" target="basefrm">io.c</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="map_8c.html" target="basefrm">map.c</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="map_8h.html" target="basefrm">map.h</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="README.html" target="basefrm">README</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2lastnode.png" alt="\" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="runtime_8h.html" target="basefrm">runtime.h</a></p> - </div> - <p><img src="ftv2pnode.png" alt="o" width=16 height=22 onclick="toggleFolder('folder2', this)"/><img src="ftv2folderclosed.png" alt="+" width=24 height=22 onclick="toggleFolder('folder2', this)"/><a class="el" href="annotated.html" target="basefrm">Data Structures</a></p> - <div id="folder2"> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="unionkey__data.html" target="basefrm">key_data</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structmap__node.html" target="basefrm">map_node</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structmap__node__int64.html" target="basefrm">map_node_int64</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structmap__node__stat.html" target="basefrm">map_node_stat</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structmap__node__str.html" target="basefrm">map_node_str</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structmap__root.html" target="basefrm">map_root</a></p> - <p><img src="ftv2vertline.png" alt="|" width=16 height=22 /><img src="ftv2lastnode.png" alt="\" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="structstat.html" target="basefrm">stat</a></p> - </div> - <p><img src="ftv2node.png" alt="o" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="functions.html" target="basefrm">Data Fields</a></p> - <p><img src="ftv2lastnode.png" alt="\" width=16 height=22 /><img src="ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="globals.html" target="basefrm">Globals</a></p> - </div> - </div> - </body> -</html> diff --git a/runtime/docs/html/unionkey__data.html b/runtime/docs/html/unionkey__data.html deleted file mode 100644 index f6fed5cb..00000000 --- a/runtime/docs/html/unionkey__data.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: key_data Union Reference</title> -<link href="doxygen.css" rel="stylesheet" type="text/css"> -</head><body> -<!-- Generated by Doxygen 1.4.1 --> -<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> -<h1>key_data Union Reference<br> -<small> -[<a class="el" href="group__maps.html">Maps</a>]</small> -</h1>Keys are either longs or char *. -<a href="#_details">More...</a> -<p> -<code>#include <<a class="el" href="map_8h-source.html">map.h</a>></code> -<p> -<table border="0" cellpadding="0" cellspacing="0"> -<tr><td></td></tr> -<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o0" doxytag="key_data::val"></a> -long </td><td class="memItemRight" valign="bottom"><b>val</b></td></tr> - -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o1" doxytag="key_data::str"></a> -char * </td><td class="memItemRight" valign="bottom"><b>str</b></td></tr> - -</table> -<hr><a name="_details"></a><h2>Detailed Description</h2> -Keys are either longs or char *. -<p> - -<p> -Definition at line <a class="el" href="map_8h-source.html#l00023">23</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr>The documentation for this union was generated from the following file:<ul> -<li><a class="el" href="map_8h-source.html">map.h</a></ul> -</body></html> |