diff options
Diffstat (limited to 'runtime/docs')
74 files changed, 5090 insertions, 4238 deletions
diff --git a/runtime/docs/examples/argv.c b/runtime/docs/examples/argv.c index 5200c350..609ad74f 100644 --- a/runtime/docs/examples/argv.c +++ b/runtime/docs/examples/argv.c @@ -4,6 +4,7 @@ int inst_do_execve (char * filename, char __user *__user *argv, char __user *__u { struct map_node_str *ptr; + _stp_list_clear (arglist); _stp_copy_argv_from_user (arglist, argv); foreach (arglist, ptr) diff --git a/runtime/docs/examples/list.c b/runtime/docs/examples/list.c new file mode 100644 index 00000000..15d13d4b --- /dev/null +++ b/runtime/docs/examples/list.c @@ -0,0 +1,14 @@ + +struct map_node_str *ptr; + +MAP map = _stp_list_new(10, STRING); + +for (i = 0; i < 10; i++) { + sprintf (buf, "Item%d", i); + _stp_list_add (map, buf); + } + +foreach (map, ptr) + printf ("map[%ld] = %s\n", key1int(ptr), ptr->str); + + diff --git a/runtime/docs/footer.html b/runtime/docs/footer.html index add9de59..62b274f1 100644 --- a/runtime/docs/footer.html +++ b/runtime/docs/footer.html @@ -1,3 +1 @@ -<hr size="1"><address style="align: right;"><small> -Generated on $datetime for $projectname.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/README-source.html b/runtime/docs/html/README-source.html index e3a311ea..1b03993d 100644 --- a/runtime/docs/html/README-source.html +++ b/runtime/docs/html/README-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="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="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> @@ -39,7 +39,7 @@ 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_map_new(). Add to it</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> @@ -57,7 +57,8 @@ 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> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +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> +</pre></div></body></html> diff --git a/runtime/docs/html/alloc_8c-source.html b/runtime/docs/html/alloc_8c-source.html new file mode 100644 index 00000000..34641788 --- /dev/null +++ b/runtime/docs/html/alloc_8c-source.html @@ -0,0 +1,101 @@ +<!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.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>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> +00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> +00005 <span class="comment">/** @file alloc.c</span> +00006 <span class="comment"> * @brief Memory functions.</span> +00007 <span class="comment"> */</span><span class="comment"></span> +00008 <span class="comment">/** @addtogroup alloc Memory Functions</span> +00009 <span class="comment"> * Basic malloc/calloc/free functions. These will be changed so </span> +00010 <span class="comment"> * that memory allocation errors will call a handler. The default will</span> +00011 <span class="comment"> * send a signal to the user-space daemon that will trigger the module to</span> +00012 <span class="comment"> * be unloaded.</span> +00013 <span class="comment"> * @todo Need error handling for memory allocations</span> +00014 <span class="comment"> * @todo Some of these currently use kmalloc (GFP_ATOMIC) for</span> +00015 <span class="comment"> * small allocations. This should be evaluated for performance</span> +00016 <span class="comment"> * and stability.</span> +00017 <span class="comment"> * @{</span> +00018 <span class="comment"> */</span> +00019 +00020 <span class="keyword">enum</span> errorcode { ERR_NONE=0, ERR_NO_MEM }; +00021 <span class="keyword">enum</span> errorcode _stp_error = ERR_NONE; +00022 <span class="comment"></span> +00023 <span class="comment">/** Allocates memory within a probe.</span> +00024 <span class="comment"> * This is used for small allocations from within a running</span> +00025 <span class="comment"> * probe where the process cannot sleep. </span> +00026 <span class="comment"> * @param len Number of bytes to allocate.</span> +00027 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> +00028 <span class="comment"> * @bug Currently uses kmalloc (GFP_ATOMIC).</span> +00029 <span class="comment"> */</span> +00030 +<a name="l00031"></a><a class="code" href="group__alloc.html#ga1">00031</a> <span class="keywordtype">void</span> *<a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(size_t len) +00032 { +00033 <span class="keywordtype">void</span> *ptr = kmalloc(len, GFP_ATOMIC); +00034 <span class="keywordflow">if</span> (unlikely(ptr == NULL)) +00035 _stp_error = ERR_NO_MEM; +00036 <span class="keywordflow">return</span> ptr; +00037 } +00038 <span class="comment"></span> +00039 <span class="comment">/** Allocates and clears memory within a probe.</span> +00040 <span class="comment"> * This is used for small allocations from within a running</span> +00041 <span class="comment"> * probe where the process cannot sleep. </span> +00042 <span class="comment"> * @param len Number of bytes to allocate.</span> +00043 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> +00044 <span class="comment"> * @bug Currently uses kmalloc (GFP_ATOMIC).</span> +00045 <span class="comment"> */</span> +00046 +<a name="l00047"></a><a class="code" href="group__alloc.html#ga2">00047</a> <span class="keywordtype">void</span> *<a class="code" href="group__alloc.html#ga2">_stp_calloc</a>(size_t len) +00048 { +00049 <span class="keywordtype">void</span> *ptr = <a class="code" href="group__alloc.html#ga1">_stp_alloc</a>(len); +00050 <span class="keywordflow">if</span> (likely(ptr)) +00051 memset(ptr, 0, len); +00052 <span class="keywordflow">return</span> ptr; +00053 } +00054 <span class="comment"></span> +00055 <span class="comment">/** Allocates and clears memory outside a probe.</span> +00056 <span class="comment"> * This is typically used in the module initialization to</span> +00057 <span class="comment"> * allocate new maps, lists, etc.</span> +00058 <span class="comment"> * @param len Number of bytes to allocate.</span> +00059 <span class="comment"> * @return a valid pointer on success or NULL on failure.</span> +00060 <span class="comment"> */</span> +00061 +<a name="l00062"></a><a class="code" href="group__alloc.html#ga3">00062</a> <span class="keywordtype">void</span> *<a class="code" href="group__alloc.html#ga3">_stp_valloc</a>(size_t len) +00063 { +00064 <span class="keywordtype">void</span> *ptr = vmalloc(len); +00065 <span class="keywordflow">if</span> (likely(ptr)) +00066 memset(ptr, 0, len); +00067 <span class="keywordflow">else</span> +00068 _stp_error = ERR_NO_MEM; +00069 <span class="keywordflow">return</span> ptr; +00070 } +00071 <span class="comment"></span> +00072 <span class="comment">/** Frees memory allocated by _stp_alloc or _stp_calloc.</span> +00073 <span class="comment"> * @param ptr pointer to memory to free</span> +00074 <span class="comment"> */</span> +00075 +<a name="l00076"></a><a class="code" href="group__alloc.html#ga4">00076</a> <span class="keywordtype">void</span> <a class="code" href="group__alloc.html#ga4">_stp_free</a>(<span class="keywordtype">void</span> *ptr) +00077 { +00078 <span class="keywordflow">if</span> (likely(ptr)) +00079 kfree(ptr); +00080 } +00081 <span class="comment"></span> +00082 <span class="comment">/** Frees memory allocated by _stp_valloc.</span> +00083 <span class="comment"> * @param ptr pointer to memory to free</span> +00084 <span class="comment"> */</span> +00085 +<a name="l00086"></a><a class="code" href="group__alloc.html#ga5">00086</a> <span class="keywordtype">void</span> <a class="code" href="group__alloc.html#ga5">_stp_vfree</a>(<span class="keywordtype">void</span> *ptr) +00087 { +00088 <span class="keywordflow">if</span> (likely(ptr)) +00089 vfree(ptr); +00090 } +00091 <span class="comment"></span> +00092 <span class="comment">/** @} */</span> +00093 <span class="preprocessor">#endif </span><span class="comment">/* _ALLOC_C_ */</span> +</pre></div></body></html> diff --git a/runtime/docs/html/alloc_8c.html b/runtime/docs/html/alloc_8c.html new file mode 100644 index 00000000..358cb6a8 --- /dev/null +++ b/runtime/docs/html/alloc_8c.html @@ -0,0 +1,45 @@ +<!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.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="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.c File Reference</h1>Memory functions. <a href="#_details">More...</a> +<p> + +<p> +<a href="alloc_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>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="group__alloc.html#ga1">_stp_alloc</a> (size_t len)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates memory within a probe. <a href="group__alloc.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__alloc.html#ga2">_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="group__alloc.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__alloc.html#ga3">_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="group__alloc.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__alloc.html#ga4">_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="group__alloc.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__alloc.html#ga5">_stp_vfree</a> (void *ptr)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees memory allocated by _stp_valloc. <a href="group__alloc.html#ga5"></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="alloc.c::_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 functions. +<p> + +<p> +Definition in file <a class="el" href="alloc_8c-source.html">alloc.c</a>.</body></html> diff --git a/runtime/docs/html/alloc_8h-source.html b/runtime/docs/html/alloc_8h-source.html index e68fbb86..551deccd 100644 --- a/runtime/docs/html/alloc_8h-source.html +++ b/runtime/docs/html/alloc_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="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="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> @@ -82,6 +82,4 @@ 00075 <span class="keywordflow">if</span> (likely(ptr)) 00076 vfree(ptr); 00077 } -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/alloc_8h.html b/runtime/docs/html/alloc_8h.html index 385d8e1a..c8735838 100644 --- a/runtime/docs/html/alloc_8h.html +++ b/runtime/docs/html/alloc_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="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="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> @@ -82,7 +82,7 @@ This is used for small allocations from within a running probe where the process <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#l00577">_stp_map_set_str()</a>. </td> +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> @@ -125,7 +125,7 @@ Definition at line <a class="el" href="alloc_8h-source.html#l00034">34</a> of fi <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#l00662">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>. </td> +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> @@ -164,7 +164,7 @@ Frees memory allocated by _stp_alloc or _stp_calloc. <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#l00794">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00107">_stp_map_key_del()</a>, and <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>. </td> +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> @@ -204,7 +204,7 @@ This is typically used in the module initialization to allocate new maps, lists, <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#l00046">_stp_map_new()</a>. </td> +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> @@ -243,9 +243,7 @@ Frees memory allocated by _stp_valloc. <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#l00194">_stp_map_del()</a>. </td> +Referenced by <a class="el" href="map_8c-source.html#l00199">_stp_map_del()</a>. </td> </tr> </table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/annotated.html b/runtime/docs/html/annotated.html index 49994e1a..4359c217 100644 --- a/runtime/docs/html/annotated.html +++ b/runtime/docs/html/annotated.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="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="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> @@ -14,6 +14,4 @@ <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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/bug.html b/runtime/docs/html/bug.html index 6c73243e..4ed1d36b 100644 --- a/runtime/docs/html/bug.html +++ b/runtime/docs/html/bug.html @@ -4,21 +4,19 @@ <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> +<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="bug">Bug List</a></h1><a class="anchor" name="_bug000001"></a> <dl> -<dt>Global <a class="el" href="alloc_8h.html#a3">_stp_alloc</a> (size_t len) </dt> +<dt>Global <a class="el" href="group__alloc.html#ga1">_stp_alloc</a> (size_t len) </dt> <dd>Currently uses kmalloc (GFP_ATOMIC). </dd> </dl> <p> <a class="anchor" name="_bug000002"></a> <dl> -<dt>Global <a class="el" href="alloc_8h.html#a4">_stp_calloc</a> (size_t len) </dt> +<dt>Global <a class="el" href="group__alloc.html#ga2">_stp_calloc</a> (size_t len) </dt> <dd>Currently uses kmalloc (GFP_ATOMIC). </dd> </dl> <p> <a class="anchor" name="_bug000003"></a> <dl> -<dt>Global <a class="el" href="io_8c.html#a4">dlog</a> (const char *fmt,...) </dt> -<dd>Lines are limited in length by printk buffer.</dd> +<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> </dl> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/copy_8c-source.html b/runtime/docs/html/copy_8c-source.html index 3456380c..1d4f8652 100644 --- a/runtime/docs/html/copy_8c-source.html +++ b/runtime/docs/html/copy_8c-source.html @@ -4,148 +4,159 @@ <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>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="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file copy.c</span> -00003 <span class="comment"> * @brief Functions to copy from user space.</span> -00004 <span class="comment"> */</span> -00005 -00006 <span class="keywordtype">long</span> <a class="code" href="copy_8c.html#a0">_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); -00007 <span class="comment">//static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);</span> -00008 -00009 <span class="preprocessor">#if defined (__i386__)</span> -00010 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> -00011 <span class="preprocessor">do { \</span> -00012 <span class="preprocessor"> int __d0, __d1, __d2; \</span> -00013 <span class="preprocessor"> __asm__ __volatile__( \</span> -00014 <span class="preprocessor"> " testl %1,%1\n" \</span> -00015 <span class="preprocessor"> " jz 2f\n" \</span> -00016 <span class="preprocessor"> "0: lodsb\n" \</span> -00017 <span class="preprocessor"> " stosb\n" \</span> -00018 <span class="preprocessor"> " testb %%al,%%al\n" \</span> -00019 <span class="preprocessor"> " jz 1f\n" \</span> -00020 <span class="preprocessor"> " decl %1\n" \</span> -00021 <span class="preprocessor"> " jnz 0b\n" \</span> -00022 <span class="preprocessor"> "1: subl %1,%0\n" \</span> -00023 <span class="preprocessor"> "2:\n" \</span> -00024 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> -00025 <span class="preprocessor"> "3: movl %5,%0\n" \</span> -00026 <span class="preprocessor"> " jmp 2b\n" \</span> -00027 <span class="preprocessor"> ".previous\n" \</span> -00028 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> -00029 <span class="preprocessor"> " .align 4\n" \</span> -00030 <span class="preprocessor"> " .long 0b,3b\n" \</span> -00031 <span class="preprocessor"> ".previous" \</span> -00032 <span class="preprocessor"> : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> -00033 <span class="preprocessor"> "=&D" (__d2) \</span> -00034 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> -00035 <span class="preprocessor"> : "memory"); \</span> -00036 <span class="preprocessor">} while (0)</span> -00037 <span class="preprocessor"></span><span class="preprocessor">#elif defined (__x86_64__)</span> -00038 <span class="preprocessor"></span><span class="preprocessor">#define __stp_strncpy_from_user(dst,src,count,res) \</span> -00039 <span class="preprocessor">do { \</span> -00040 <span class="preprocessor"> long __d0, __d1, __d2; \</span> -00041 <span class="preprocessor"> __asm__ __volatile__( \</span> -00042 <span class="preprocessor"> " testq %1,%1\n" \</span> -00043 <span class="preprocessor"> " jz 2f\n" \</span> -00044 <span class="preprocessor"> "0: lodsb\n" \</span> -00045 <span class="preprocessor"> " stosb\n" \</span> -00046 <span class="preprocessor"> " testb %%al,%%al\n" \</span> -00047 <span class="preprocessor"> " jz 1f\n" \</span> -00048 <span class="preprocessor"> " decq %1\n" \</span> -00049 <span class="preprocessor"> " jnz 0b\n" \</span> -00050 <span class="preprocessor"> "1: subq %1,%0\n" \</span> -00051 <span class="preprocessor"> "2:\n" \</span> -00052 <span class="preprocessor"> ".section .fixup,\"ax\"\n" \</span> -00053 <span class="preprocessor"> "3: movq %5,%0\n" \</span> -00054 <span class="preprocessor"> " jmp 2b\n" \</span> -00055 <span class="preprocessor"> ".previous\n" \</span> -00056 <span class="preprocessor"> ".section __ex_table,\"a\"\n" \</span> -00057 <span class="preprocessor"> " .align 8\n" \</span> -00058 <span class="preprocessor"> " .quad 0b,3b\n" \</span> -00059 <span class="preprocessor"> ".previous" \</span> -00060 <span class="preprocessor"> : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \</span> -00061 <span class="preprocessor"> "=&D" (__d2) \</span> -00062 <span class="preprocessor"> : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \</span> -00063 <span class="preprocessor"> : "memory"); \</span> -00064 <span class="preprocessor">} while (0)</span> -00065 <span class="preprocessor"></span><span class="preprocessor">#endif</span> -00066 <span class="preprocessor"></span><span class="comment"></span> -00067 <span class="comment">/** Copy a NULL-terminated string from userspace.</span> -00068 <span class="comment"> * On success, returns the length of the string (not including the trailing</span> -00069 <span class="comment"> * NULL).</span> -00070 <span class="comment"> *</span> -00071 <span class="comment"> * If access to userspace fails, returns -EFAULT (some data may have been</span> -00072 <span class="comment"> * copied).</span> -00073 <span class="comment"> * @param dst Destination address, in kernel space. This buffer must be at</span> -00074 <span class="comment"> * least <i>count</i> bytes long.</span> -00075 <span class="comment"> * @param src Source address, in user space.</span> -00076 <span class="comment"> * @param count Maximum number of bytes to copy, including the trailing NULL.</span> -00077 <span class="comment"> * </span> -00078 <span class="comment"> * If <i>count</i> is smaller than the length of the string, copies </span> -00079 <span class="comment"> * <i>count</i> bytes and returns <i>count</i>.</span> -00080 <span class="comment"> */</span> -00081 -00082 <span class="keywordtype">long</span> -<a name="l00083"></a><a class="code" href="copy_8c.html#a0">00083</a> <a class="code" href="copy_8c.html#a0">_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) -00084 { -00085 <span class="keywordtype">long</span> res; -00086 __stp_strncpy_from_user(dst, src, count, res); -00087 <span class="keywordflow">return</span> res; -00088 } -00089 <span class="comment"></span> -00090 <span class="comment">/** Copy a block of data from user space.</span> -00091 <span class="comment"> *</span> -00092 <span class="comment"> * If some data could not be copied, this function will pad the copied</span> -00093 <span class="comment"> * data to the requested size using zero bytes.</span> -00094 <span class="comment"></span> -00095 <span class="comment"> * @param dst Destination address, in kernel space.</span> -00096 <span class="comment"> * @param src Source address, in user space.</span> -00097 <span class="comment"> * @param count Number of bytes to copy.</span> -00098 <span class="comment"> * @return number of bytes that could not be copied. On success, </span> -00099 <span class="comment"> * this will be zero.</span> -00100 <span class="comment"> *</span> -00101 <span class="comment"> */</span> -00102 -00103 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keyword">inline</span> -<a name="l00104"></a><a class="code" href="copy_8c.html#a1">00104</a> <a class="code" href="copy_8c.html#a1">_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) -00105 { -00106 <span class="keywordflow">return</span> __copy_from_user_inatomic(dst, src, count); -00107 } -00108 <span class="comment"></span> -00109 <span class="comment">/** Copy an argv from user space to a List.</span> -00110 <span class="comment"> *</span> -00111 <span class="comment"> * @param list A list.</span> -00112 <span class="comment"> * @param argv Source argv, in user space.</span> -00113 <span class="comment"> * @return number of elements in <i>list</i></span> -00114 <span class="comment"> *</span> -00115 <span class="comment"> * @b Example:</span> -00116 <span class="comment"> * @include argv.c</span> -00117 <span class="comment"> */</span> -00118 -<a name="l00119"></a><a class="code" href="copy_8c.html#a2">00119</a> <span class="keywordtype">int</span> <a class="code" href="copy_8c.html#a2">_stp_copy_argv_from_user</a> (<a class="code" href="structmap__root.html">MAP</a> list, <span class="keywordtype">char</span> __user *__user *argv) -00120 { -00121 <span class="keywordtype">char</span> str[128]; -00122 <span class="keywordtype">char</span> __user *vstr; -00123 <span class="keywordtype">int</span> len; -00124 -00125 <span class="keywordflow">if</span> (argv) -00126 argv++; -00127 -00128 <span class="keywordflow">while</span> (argv != NULL) { -00129 <span class="keywordflow">if</span> (get_user (vstr, argv)) -00130 <span class="keywordflow">break</span>; -00131 -00132 <span class="keywordflow">if</span> (vstr == NULL) -00133 <span class="keywordflow">break</span>; -00134 -00135 len = <a class="code" href="copy_8c.html#a0">_stp_strncpy_from_user</a>(str, vstr, 128); -00136 str[len] = 0; -00137 <a class="code" href="map_8c.html#a27">_stp_list_add_str</a> (list, str); -00138 argv++; -00139 } -00140 <span class="keywordflow">return</span> list-><a class="code" href="structmap__root.html#o2">num</a>; -00141 } -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<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> +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> +</pre></div></body></html> diff --git a/runtime/docs/html/copy_8c.html b/runtime/docs/html/copy_8c.html index d4e3ba26..6877dc73 100644 --- a/runtime/docs/html/copy_8c.html +++ b/runtime/docs/html/copy_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="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="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 File Reference</h1>Functions to copy from user space. <a href="#_details">More...</a> <p> @@ -12,197 +12,19 @@ <a href="copy_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">long </td><td class="memItemRight" valign="bottom"><a class="el" href="copy_8c.html#a0">_stp_strncpy_from_user</a> (char *dst, const char __user *src, long count)</td></tr> +<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="#a0"></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="copy_8c.html#a1">_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 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="mdescLeft"> </td><td class="mdescRight">Copy a block of data from user space. <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="copy_8c.html#a2">_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 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 an argv from user space to a List. <a href="#a2"></a><br></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> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Functions to copy from user space. <p> <p> -Definition in file <a class="el" href="copy_8c-source.html">copy.c</a>.<hr><h2>Function Documentation</h2> -<a class="anchor" name="a2" doxytag="copy.c::_stp_copy_argv_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">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="mdname" nowrap> <em>list</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char __user *__user * </td> - <td class="mdname" nowrap> <em>argv</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 an argv from user space 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>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> -<b>Example:</b> <div class="fragment"><pre class="fragment"><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 class="code" href="structmap__node__str.html">map_node_str</a> *ptr; - - <a class="code" href="copy_8c.html#a2">_stp_copy_argv_from_user</a> (arglist, argv); - - <a class="code" href="map_8h.html#a8">foreach</a> (arglist, ptr) - printk ("%s ", ptr->str); - printk ("\n"); -} -</pre></div> -<p> -Definition at line <a class="el" href="copy_8c-source.html#l00119">119</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00834">_stp_list_add_str()</a>, <a class="el" href="copy_8c-source.html#l00083">_stp_strncpy_from_user()</a>, and <a class="el" href="map_8h-source.html#l00069">map_root::num</a>. </td> - </tr> -</table> -<a class="anchor" name="a1" doxytag="copy.c::_stp_copy_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">unsigned long _stp_copy_from_user </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">char * </td> - <td class="mdname" nowrap> <em>dst</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>unsigned 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"><code> [inline]</code></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Copy a block of data from user space. -<p> -If some data could not be copied, this function will pad the copied data to the requested size using zero bytes.<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>dst</em> </td><td>Destination address, in kernel space. </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>Number of bytes to copy. </td></tr> - </table> -</dl> -<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#l00104">104</a> of file <a class="el" href="copy_8c-source.html">copy.c</a>. </td> - </tr> -</table> -<a class="anchor" name="a0" doxytag="copy.c::_stp_strncpy_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">long _stp_strncpy_from_user </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">char * </td> - <td class="mdname" nowrap> <em>dst</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 NULL-terminated string from userspace. -<p> -On success, returns the length of the string (not including the trailing NULL).<p> -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>dst</em> </td><td>Destination address, in kernel space. This buffer must be at least <em>count</em> bytes long. </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> -If <em>count</em> is smaller than the length of the string, copies <em>count</em> bytes and returns <em>count</em>. -<p> -Definition at line <a class="el" href="copy_8c-source.html#l00083">83</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#l00119">_stp_copy_argv_from_user()</a>. </td> - </tr> -</table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +Definition in file <a class="el" href="copy_8c-source.html">copy.c</a>.</body></html> diff --git a/runtime/docs/html/current_8c-source.html b/runtime/docs/html/current_8c-source.html new file mode 100644 index 00000000..88ad571a --- /dev/null +++ b/runtime/docs/html/current_8c-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: current.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>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> +00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> +00005 <span class="comment">/** @file current.c</span> +00006 <span class="comment"> * @brief Functions to get the current state.</span> +00007 <span class="comment"> */</span><span class="comment"></span> +00008 <span class="comment">/** @addtogroup current Current State</span> +00009 <span class="comment"> * Functions to get the current state.</span> +00010 <span class="comment"> * @{</span> +00011 <span class="comment"> */</span> +00012 +00013 <span class="comment"></span> +00014 <span class="comment">/** Get the current return address.</span> +00015 <span class="comment"> * Call from kprobes (not jprobes).</span> +00016 <span class="comment"> * @param regs The pt_regs saved by the kprobe.</span> +00017 <span class="comment"> * @return The return address saved in esp or rsp.</span> +00018 <span class="comment"> * @note i386 and x86_64 only so far.</span> +00019 <span class="comment"> */</span> +00020 +<a name="l00021"></a><a class="code" href="group__current.html#ga0">00021</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="group__current.html#ga0">_stp_ret_addr</a> (<span class="keyword">struct</span> pt_regs *regs) +00022 { +00023 <span class="preprocessor">#ifdef __x86_64__</span> +00024 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *ra = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)regs->rsp; +00025 <span class="preprocessor">#else</span> +00026 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *ra = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)regs->esp; +00027 <span class="preprocessor">#endif</span> +00028 <span class="preprocessor"></span> <span class="keywordflow">if</span> (ra) +00029 <span class="keywordflow">return</span> *ra; +00030 <span class="keywordflow">else</span> +00031 <span class="keywordflow">return</span> 0; +00032 }<span class="comment"></span> +00033 <span class="comment">/** @} */</span> +00034 <span class="preprocessor">#endif </span><span class="comment">/* _CURRENT_C_ */</span> +</pre></div></body></html> diff --git a/runtime/docs/html/current_8c.html b/runtime/docs/html/current_8c.html new file mode 100644 index 00000000..bfb2b727 --- /dev/null +++ b/runtime/docs/html/current_8c.html @@ -0,0 +1,24 @@ +<!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: current.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="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>current.c File Reference</h1>Functions to get the current state. <a href="#_details">More...</a> +<p> + +<p> +<a href="current_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">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__current.html#ga0">_stp_ret_addr</a> (struct pt_regs *regs)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current return address. <a href="group__current.html#ga0"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Functions to get the current state. +<p> + +<p> +Definition in file <a class="el" href="current_8c-source.html">current.c</a>.</body></html> diff --git a/runtime/docs/html/dir_000000.html b/runtime/docs/html/dir_000000.html index f791914d..acfc2d57 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="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="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="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. @@ -38,6 +38,4 @@ <hr><a name="_details"></a><h2>Detailed Description</h2> This directory contains working example probes that demonstrate and test the runtime library. <p> -They are tested on i386 and x86_64. <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +They are tested on i386 and x86_64. </body></html> diff --git a/runtime/docs/html/dir_000001.html b/runtime/docs/html/dir_000001.html index 37f053ab..e9fac182 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="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="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="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. @@ -19,7 +19,7 @@ <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="copy_8c.html#a2">_stp_copy_argv_from_user()</a> and <a class="el" href="copy_8c.html#a0">_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#ga2">_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. @@ -84,6 +84,4 @@ probe sys_write:entry { } } } -</pre></div> <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div> </body></html> diff --git a/runtime/docs/html/dir_000002.html b/runtime/docs/html/dir_000002.html index a22bfaa4..0a007775 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="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="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="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. @@ -24,6 +24,4 @@ Useful for interrupt context testing.<p> > ./build > insmod stp_tasklet.ko > rmmod stp_tasklet.ko -</pre></div> <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div> </body></html> diff --git a/runtime/docs/html/dir_000003.html b/runtime/docs/html/dir_000003.html index 002ee608..173623b3 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="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="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="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,6 +13,8 @@ <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>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> @@ -37,6 +39,4 @@ probe sys_read:entry { probe sys_write:entry { @writes[current->comm] << count; } -</pre></div> <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div> </body></html> diff --git a/runtime/docs/html/dir_000004.html b/runtime/docs/html/dir_000004.html index de4c82b6..f2294de2 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="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="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="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. @@ -20,11 +20,9 @@ This is a silly little instrumentation routine to instrument functions entry by name. <p> It makes use of the SystemTap runtime libraries to break down the number of times the function by caller.<p> -It demonstrates kprobes, passing a module parameter, using the print buffer, and using <a class="el" href="io_8c.html#a7">_stp_print_symbol()</a> to map the addresses back to locations in functions.<p> +It demonstrates kprobes, passing a module parameter, using the print buffer, and using _stp_print_symbol() to map the addresses back to locations in functions.<p> By default it instruments schedule().<p> The instrumentation module is built by having the kernel that is going to be instrumented currently on the machine and doing <div class="fragment"><pre class="fragment">./build </pre></div> The instrumentation is inserted as root with: <div class="fragment"><pre class="fragment">/sbin/insmod kprobe_funct_where.ko funct_name=function_name </pre></div> The instrumentation is removed as root with: <div class="fragment"><pre class="fragment">/sbin/rmmod kprobe_funct_where -</pre></div> -Will Cohen <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div> -Will Cohen </body></html> diff --git a/runtime/docs/html/dirs.html b/runtime/docs/html/dirs.html index fdf2f363..36214b8b 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="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="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> <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> @@ -14,6 +14,4 @@ <li><a class="el" href="dir_000004.html">where_func</a> </ul> </ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/dtr_8mod_8c-source.html b/runtime/docs/html/dtr_8mod_8c-source.html index 38f5967a..1deec9c6 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/shellsnoop/dtr.mod.c Source File</title> +<title>SystemTap: probes/test4/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="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> +<!-- Generated by Doxygen 1.3.9.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="nav"> -<a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000001.html">shellsnoop</a></div> +<a class="el" href="dir_000000.html">probes</a> / <a class="el" href="dir_000003.html">test4</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,33 +27,30 @@ 00018 __attribute_used__ 00019 __attribute__((section("__versions"))) = { 00020 { 0x506abef7, <span class="stringliteral">"struct_module"</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> }, +00021 { 0xb240ca65, <span class="stringliteral">"schedule_work"</span> }, +00022 { 0x1b9aca3f, <span class="stringliteral">"jprobe_return"</span> }, +00023 { 0xe3b0192b, <span class="stringliteral">"vscnprintf"</span> }, +00024 { 0x45e5f47f, <span class="stringliteral">"register_kprobe"</span> }, +00025 { 0x1e736243, <span class="stringliteral">"unregister_kprobe"</span> }, +00026 { 0xdd03a51e, <span class="stringliteral">"register_jprobe"</span> }, +00027 { 0x49a83d3a, <span class="stringliteral">"unregister_jprobe"</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 { 0xe3b0192b, <span class="stringliteral">"vscnprintf"</span> }, -00033 { 0x8e3c9cc3, <span class="stringliteral">"vprintk"</span> }, -00034 { 0xdd132261, <span class="stringliteral">"printk"</span> }, -00035 { 0x2fd1d81c, <span class="stringliteral">"vfree"</span> }, -00036 { 0x37a0cba, <span class="stringliteral">"kfree"</span> }, -00037 { 0xd6ee688f, <span class="stringliteral">"vmalloc"</span> }, -00038 { 0x8ce16b3f, <span class="stringliteral">"__kmalloc"</span> }, -00039 }; -00040 -00041 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> __module_depends[] -00042 __attribute_used__ -00043 __attribute__((section(<span class="stringliteral">".modinfo"</span>))) = -00044 <span class="stringliteral">"depends="</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 { 0x8e3c9cc3, <span class="stringliteral">"vprintk"</span> }, +00037 { 0xdd132261, <span class="stringliteral">"printk"</span> }, +00038 }; +00039 +00040 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> __module_depends[] +00041 __attribute_used__ +00042 __attribute__((section(<span class="stringliteral">".modinfo"</span>))) = +00043 <span class="stringliteral">"depends="</span>; +00044 00045 -00046 -00047 MODULE_INFO(srcversion, <span class="stringliteral">"D6A3BE8A54CB181A59924B3"</span>); -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 00:32:02 2005 for SystemTap.</small></body> -</html> +00046 MODULE_INFO(srcversion, <span class="stringliteral">"3CC4F9300C5C4E353BD2804"</span>); +</pre></div></body></html> diff --git a/runtime/docs/html/files.html b/runtime/docs/html/files.html index ec707721..ef853864 100644 --- a/runtime/docs/html/files.html +++ b/runtime/docs/html/files.html @@ -4,27 +4,29 @@ <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="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="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> <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_8h.html">alloc.h</a> <a href="alloc_8h-source.html">[code]</a></td><td class="indexvalue">Memory allocation functions </td></tr> + <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> + <tr><td class="indexkey"><a class="el" href="current_8c.html">current.c</a> <a href="current_8c-source.html">[code]</a></td><td class="indexvalue">Functions to get the current state </td></tr> <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"><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>runtime.h</b> <a href="runtime_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> - <tr><td class="indexkey"><b>stack.c</b> <a href="stack_8c-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"><b>sym.c</b> <a href="sym_8c-source.html">[code]</a></td><td class="indexvalue"></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>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>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>README</b> <a href="probes_2where__func_2README-source.html">[code]</a></td><td class="indexvalue"></td></tr> </table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/functions.html b/runtime/docs/html/functions.html index f81967b0..e48ba9fa 100644 --- a/runtime/docs/html/functions.html +++ b/runtime/docs/html/functions.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="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="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> @@ -22,6 +22,4 @@ Here is a list of all documented struct and union fields with links to the struc : <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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/functions_vars.html b/runtime/docs/html/functions_vars.html index 261bcd3b..ed63f0fd 100644 --- a/runtime/docs/html/functions_vars.html +++ b/runtime/docs/html/functions_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="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="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> @@ -22,6 +22,4 @@ : <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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/globals.html b/runtime/docs/html/globals.html index d3331603..74f0f2e2 100644 --- a/runtime/docs/html/globals.html +++ b/runtime/docs/html/globals.html @@ -4,86 +4,78 @@ <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="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="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="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_c">c</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_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> <p> <p> Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:<h3><a class="anchor" name="index__">- _ -</a></h3><ul> <li>_stp_alloc() -: <a class="el" href="alloc_8h.html#a3">alloc.h</a><li>_stp_calloc() -: <a class="el" href="alloc_8h.html#a4">alloc.h</a><li>_stp_copy_argv_from_user() -: <a class="el" href="copy_8c.html#a2">copy.c</a><li>_stp_copy_from_user() -: <a class="el" href="copy_8c.html#a1">copy.c</a><li>_stp_free() -: <a class="el" href="alloc_8h.html#a6">alloc.h</a><li>_stp_kallsyms_lookup -: <a class="el" href="io_8c.html#a1">io.c</a><li>_stp_list_add -: <a class="el" href="map_8h.html#a7">map.h</a><li>_stp_list_add_int64() -: <a class="el" href="map_8c.html#a28">map.c</a><li>_stp_list_add_str() -: <a class="el" href="map_8c.html#a27">map.c</a><li>_stp_list_clear() -: <a class="el" href="map_8c.html#a26">map.c</a><li>_stp_list_new() -: <a class="el" href="map_8c.html#a25">map.c</a><li>_stp_list_size() -: <a class="el" href="map_8c.html#a29">map.c</a><li>_stp_lookup_name -: <a class="el" href="probes_8c.html#a0">probes.c</a><li>_stp_map_add_int64() -: <a class="el" href="map_8c.html#a18">map.c</a><li>_stp_map_del() -: <a class="el" href="map_8c.html#a8">map.c</a><li>_stp_map_get_int64() -: <a class="el" href="map_8c.html#a19">map.c</a><li>_stp_map_get_stat() -: <a class="el" href="map_8c.html#a23">map.c</a><li>_stp_map_get_str() -: <a class="el" href="map_8c.html#a21">map.c</a><li>_stp_map_iter() -: <a class="el" href="map_8c.html#a7">map.c</a><li>_stp_map_key -: <a class="el" href="map_8h.html#a5">map.h</a><li>_stp_map_key2 -: <a class="el" href="map_8h.html#a4">map.h</a><li>_stp_map_key_del() -: <a class="el" href="map_8c.html#a5">map.c</a><li>_stp_map_key_long() -: <a class="el" href="map_8c.html#a14">map.c</a><li>_stp_map_key_long_long() -: <a class="el" href="map_8c.html#a9">map.c</a><li>_stp_map_key_long_str() -: <a class="el" href="map_8c.html#a12">map.c</a><li>_stp_map_key_str() -: <a class="el" href="map_8c.html#a13">map.c</a><li>_stp_map_key_str_long() -: <a class="el" href="map_8c.html#a11">map.c</a><li>_stp_map_key_str_str() -: <a class="el" href="map_8c.html#a10">map.c</a><li>_stp_map_new() -: <a class="el" href="map_8c.html#a3">map.c</a><li>_stp_map_set -: <a class="el" href="map_8h.html#a6">map.h</a><li>_stp_map_set_int64() -: <a class="el" href="map_8c.html#a17">map.c</a><li>_stp_map_set_stat() -: <a class="el" href="map_8c.html#a22">map.c</a><li>_stp_map_set_str() -: <a class="el" href="map_8c.html#a20">map.c</a><li>_stp_map_start() -: <a class="el" href="map_8c.html#a6">map.c</a><li>_stp_map_stat_add() -: <a class="el" href="map_8c.html#a24">map.c</a><li>_stp_pbuf -: <a class="el" href="io_8c.html#a2">io.c</a><li>_stp_print_buf() -: <a class="el" href="io_8c.html#a5">io.c</a><li>_stp_print_buf_init() -: <a class="el" href="io_8c.html#a6">io.c</a><li>_stp_print_symbol() -: <a class="el" href="io_8c.html#a7">io.c</a><li>_stp_register_jprobes() +: <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__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#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__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#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#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() +: <a class="el" href="group__maps.html#ga11">map.c</a><li>_stp_map_key_str() +: <a class="el" href="group__maps.html#ga12">map.c</a><li>_stp_map_key_str_long() +: <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#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#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_strncpy_from_user() -: <a class="el" href="copy_8c.html#a0">copy.c</a><li>_stp_unregister_jprobes() +: <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_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="alloc_8h.html#a5">alloc.h</a><li>_stp_vfree() -: <a class="el" href="alloc_8h.html#a7">alloc.h</a></ul> -<h3><a class="anchor" name="index_c">- c -</a></h3><ul> -<li>cur_ret_addr() -: <a class="el" href="io_8c.html#a8">io.c</a></ul> +: <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="io_8c.html#a4">io.c</a></ul> +: <a class="el" href="group__io.html#ga0">io.c</a></ul> <h3><a class="anchor" name="index_f">- f -</a></h3><ul> <li>foreach -: <a class="el" href="map_8h.html#a8">map.h</a></ul> +: <a class="el" href="group__maps.html#ga31">map.h</a></ul> <h3><a class="anchor" name="index_k">- k -</a></h3><ul> <li>key1int -: <a class="el" href="map_8h.html#a2">map.h</a><li>key1str -: <a class="el" href="map_8h.html#a0">map.h</a><li>key2int -: <a class="el" href="map_8h.html#a3">map.h</a><li>key2str -: <a class="el" href="map_8h.html#a1">map.h</a><li>keytype -: <a class="el" href="map_8h.html#a18">map.h</a></ul> +: <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> <h3><a class="anchor" name="index_m">- m -</a></h3><ul> <li>MAP -: <a class="el" href="map_8h.html#a10">map.h</a></ul> +: <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="map_8h.html#a9">map.h</a></ul> +: <a class="el" href="group__maps.html#ga0">map.h</a></ul> <h3><a class="anchor" name="index_v">- v -</a></h3><ul> <li>valtype -: <a class="el" href="map_8h.html#a19">map.h</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +: <a class="el" href="group__maps.html#ga33">map.h</a></ul> +</body></html> diff --git a/runtime/docs/html/globals_defs.html b/runtime/docs/html/globals_defs.html index b612ab13..fd07c918 100644 --- a/runtime/docs/html/globals_defs.html +++ b/runtime/docs/html/globals_defs.html @@ -4,21 +4,19 @@ <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="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="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="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="map_8h.html#a7">map.h</a><li>_stp_map_key -: <a class="el" href="map_8h.html#a5">map.h</a><li>_stp_map_key2 -: <a class="el" href="map_8h.html#a4">map.h</a><li>_stp_map_set -: <a class="el" href="map_8h.html#a6">map.h</a><li>foreach -: <a class="el" href="map_8h.html#a8">map.h</a><li>key1int -: <a class="el" href="map_8h.html#a2">map.h</a><li>key1str -: <a class="el" href="map_8h.html#a0">map.h</a><li>key2int -: <a class="el" href="map_8h.html#a3">map.h</a><li>key2str -: <a class="el" href="map_8h.html#a1">map.h</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +: <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> +</body></html> diff --git a/runtime/docs/html/globals_enum.html b/runtime/docs/html/globals_enum.html index 61d85695..da3f3ac0 100644 --- a/runtime/docs/html/globals_enum.html +++ b/runtime/docs/html/globals_enum.html @@ -4,14 +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="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="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="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="map_8h.html#a18">map.h</a><li>valtype -: <a class="el" href="map_8h.html#a19">map.h</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +: <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> +</body></html> diff --git a/runtime/docs/html/globals_func.html b/runtime/docs/html/globals_func.html index 2d0c9ba2..051cf88c 100644 --- a/runtime/docs/html/globals_func.html +++ b/runtime/docs/html/globals_func.html @@ -4,60 +4,55 @@ <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="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="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="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_c">c</a> | <a class="qindex" href="#index_d">d</a></div> +<div class="qindex"><a class="qindex" href="#index__">_</a> | <a class="qindex" href="#index_d">d</a></div> <p> <p> <h3><a class="anchor" name="index__">- _ -</a></h3><ul> <li>_stp_alloc() -: <a class="el" href="alloc_8h.html#a3">alloc.h</a><li>_stp_calloc() -: <a class="el" href="alloc_8h.html#a4">alloc.h</a><li>_stp_copy_argv_from_user() -: <a class="el" href="copy_8c.html#a2">copy.c</a><li>_stp_copy_from_user() -: <a class="el" href="copy_8c.html#a1">copy.c</a><li>_stp_free() -: <a class="el" href="alloc_8h.html#a6">alloc.h</a><li>_stp_list_add_int64() -: <a class="el" href="map_8c.html#a28">map.c</a><li>_stp_list_add_str() -: <a class="el" href="map_8c.html#a27">map.c</a><li>_stp_list_clear() -: <a class="el" href="map_8c.html#a26">map.c</a><li>_stp_list_new() -: <a class="el" href="map_8c.html#a25">map.c</a><li>_stp_list_size() -: <a class="el" href="map_8c.html#a29">map.c</a><li>_stp_map_add_int64() -: <a class="el" href="map_8c.html#a18">map.c</a><li>_stp_map_del() -: <a class="el" href="map_8c.html#a8">map.c</a><li>_stp_map_get_int64() -: <a class="el" href="map_8c.html#a19">map.c</a><li>_stp_map_get_stat() -: <a class="el" href="map_8c.html#a23">map.c</a><li>_stp_map_get_str() -: <a class="el" href="map_8c.html#a21">map.c</a><li>_stp_map_iter() -: <a class="el" href="map_8c.html#a7">map.c</a><li>_stp_map_key_del() -: <a class="el" href="map_8c.html#a5">map.c</a><li>_stp_map_key_long() -: <a class="el" href="map_8c.html#a14">map.c</a><li>_stp_map_key_long_long() -: <a class="el" href="map_8c.html#a9">map.c</a><li>_stp_map_key_long_str() -: <a class="el" href="map_8c.html#a12">map.c</a><li>_stp_map_key_str() -: <a class="el" href="map_8c.html#a13">map.c</a><li>_stp_map_key_str_long() -: <a class="el" href="map_8c.html#a11">map.c</a><li>_stp_map_key_str_str() -: <a class="el" href="map_8c.html#a10">map.c</a><li>_stp_map_new() -: <a class="el" href="map_8c.html#a3">map.c</a><li>_stp_map_set_int64() -: <a class="el" href="map_8c.html#a17">map.c</a><li>_stp_map_set_stat() -: <a class="el" href="map_8c.html#a22">map.c</a><li>_stp_map_set_str() -: <a class="el" href="map_8c.html#a20">map.c</a><li>_stp_map_start() -: <a class="el" href="map_8c.html#a6">map.c</a><li>_stp_map_stat_add() -: <a class="el" href="map_8c.html#a24">map.c</a><li>_stp_print_buf() -: <a class="el" href="io_8c.html#a5">io.c</a><li>_stp_print_buf_init() -: <a class="el" href="io_8c.html#a6">io.c</a><li>_stp_print_symbol() -: <a class="el" href="io_8c.html#a7">io.c</a><li>_stp_register_jprobes() +: <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__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#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__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#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() +: <a class="el" href="group__maps.html#ga8">map.c</a><li>_stp_map_key_long_str() +: <a class="el" href="group__maps.html#ga11">map.c</a><li>_stp_map_key_str() +: <a class="el" href="group__maps.html#ga12">map.c</a><li>_stp_map_key_str_long() +: <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_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#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_strncpy_from_user() -: <a class="el" href="copy_8c.html#a0">copy.c</a><li>_stp_unregister_jprobes() +: <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_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="alloc_8h.html#a5">alloc.h</a><li>_stp_vfree() -: <a class="el" href="alloc_8h.html#a7">alloc.h</a></ul> -<h3><a class="anchor" name="index_c">- c -</a></h3><ul> -<li>cur_ret_addr() -: <a class="el" href="io_8c.html#a8">io.c</a></ul> +: <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="io_8c.html#a4">io.c</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +: <a class="el" href="group__io.html#ga0">io.c</a></ul> +</body></html> diff --git a/runtime/docs/html/globals_type.html b/runtime/docs/html/globals_type.html index da9cb0bc..ab8a7382 100644 --- a/runtime/docs/html/globals_type.html +++ b/runtime/docs/html/globals_type.html @@ -4,13 +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="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="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="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> <ul> <li>MAP -: <a class="el" href="map_8h.html#a10">map.h</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +: <a class="el" href="group__maps.html#ga1">map.h</a></ul> +</body></html> diff --git a/runtime/docs/html/globals_vars.html b/runtime/docs/html/globals_vars.html index 2c1becac..a4674892 100644 --- a/runtime/docs/html/globals_vars.html +++ b/runtime/docs/html/globals_vars.html @@ -4,16 +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="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="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="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> <ul> -<li>_stp_kallsyms_lookup -: <a class="el" href="io_8c.html#a1">io.c</a><li>_stp_lookup_name -: <a class="el" href="probes_8c.html#a0">probes.c</a><li>_stp_pbuf -: <a class="el" href="io_8c.html#a2">io.c</a><li>packed -: <a class="el" href="map_8h.html#a9">map.h</a></ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<li>packed +: <a class="el" href="group__maps.html#ga0">map.h</a></ul> +</body></html> diff --git a/runtime/docs/html/group__alloc.html b/runtime/docs/html/group__alloc.html new file mode 100644 index 00000000..1a3e32b2 --- /dev/null +++ b/runtime/docs/html/group__alloc.html @@ -0,0 +1,247 @@ +<!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: Memory 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="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>Memory Functions</h1>Basic malloc/calloc/free functions. +<a href="#_details">More...</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="group__alloc.html#ga1">_stp_alloc</a> (size_t len)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates memory within a probe. <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__alloc.html#ga2">_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="#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__alloc.html#ga3">_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="#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__alloc.html#ga4">_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="#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__alloc.html#ga5">_stp_vfree</a> (void *ptr)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees memory allocated by _stp_valloc. <a href="#ga5"></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="alloc::_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> +Basic malloc/calloc/free functions. +<p> +These will be changed so that memory allocation errors will call a handler. The default will send a signal to the user-space daemon that will trigger the module to be unloaded. <p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>Need error handling for memory allocations</dd></dl> +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>Some of these currently use kmalloc (GFP_ATOMIC) for small allocations. This should be evaluated for performance and stability.</dd></dl> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga1" doxytag="alloc.c::_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_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> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="alloc.c::_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_8c-source.html#l00047">47</a> of file <a class="el" href="alloc_8c-source.html">alloc.c</a>. +<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> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="alloc.c::_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_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> + </tr> +</table> +<a class="anchor" name="ga3" doxytag="alloc.c::_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_8c-source.html#l00062">62</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#l00057">_stp_map_new()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga5" doxytag="alloc.c::_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_8c-source.html#l00086">86</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#l00205">_stp_map_del()</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__copy.html b/runtime/docs/html/group__copy.html new file mode 100644 index 00000000..83928d95 --- /dev/null +++ b/runtime/docs/html/group__copy.html @@ -0,0 +1,202 @@ +<!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: Functions to copy from user space.</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>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> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<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="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 an argv from user space to a List. <a href="#ga2"></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> +<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">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="mdname" nowrap> <em>list</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char __user *__user * </td> + <td class="mdname" nowrap> <em>argv</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 an argv from user space 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>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> +<b>Example:</b> <div class="fragment"><pre class="fragment"><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 class="code" href="structmap__node__str.html">map_node_str</a> *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__maps.html#ga31">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>. +<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> + </tr> +</table> +<a class="anchor" name="ga1" doxytag="copy.c::_stp_copy_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">unsigned long _stp_copy_from_user </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">char * </td> + <td class="mdname" nowrap> <em>dst</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>unsigned 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"><code> [inline]</code></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Copy a block of data from user space. +<p> +If some data could not be copied, this function will pad the copied data to the requested size using zero bytes.<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>dst</em> </td><td>Destination address, in kernel space. </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>Number of bytes to copy. </td></tr> + </table> +</dl> +<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> + </tr> +</table> +<a class="anchor" name="ga0" doxytag="copy.c::_stp_strncpy_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">long _stp_strncpy_from_user </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">char * </td> + <td class="mdname" nowrap> <em>dst</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 NULL-terminated string from userspace. +<p> +On success, returns the length of the string (not including the trailing NULL).<p> +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>dst</em> </td><td>Destination address, in kernel space. This buffer must be at least <em>count</em> bytes long. </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> +If <em>count</em> is smaller than the length of the string, copies <em>count</em> bytes and returns <em>count</em>. +<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>. +<p> +Referenced by <a class="el" href="copy_8c-source.html#l00130">_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 new file mode 100644 index 00000000..91973e06 --- /dev/null +++ b/runtime/docs/html/group__current.html @@ -0,0 +1,59 @@ +<!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: Current State</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>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> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__current.html#ga0">_stp_ret_addr</a> (struct pt_regs *regs)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current return address. <a href="#ga0"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Functions to get the current state. +<p> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga0" doxytag="current.c::_stp_ret_addr"></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">unsigned long _stp_ret_addr </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">struct pt_regs * </td> + <td class="mdname1" valign="top" nowrap> <em>regs</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 the current return address. +<p> +Call from kprobes (not jprobes). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>regs</em> </td><td>The pt_regs saved by the kprobe. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>The return address saved in esp or rsp. </dd></dl> +<dl compact><dt><b>Note:</b></dt><dd>i386 and x86_64 only so far. </dd></dl> + +<p> +Definition at line <a class="el" href="current_8c-source.html#l00021">21</a> of file <a class="el" href="current_8c-source.html">current.c</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__io.html b/runtime/docs/html/group__io.html new file mode 100644 index 00000000..357e250b --- /dev/null +++ b/runtime/docs/html/group__io.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: I/O</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>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>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="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">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">Prints to the trace buffer. <a href="#ga2"></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> +<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" 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> +Prints to the trace buffer. +<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> + <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> + +<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>. +<p> +Referenced by <a class="el" href="sym_8c-source.html#l00059">_stp_symbol_print()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="io.c::_stp_print_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_print_str </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" 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> +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> +<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> + +<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> + </tr> +</table> +<a class="anchor" name="ga0" doxytag="io.c::dlog"></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" 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> +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> + +<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>. +<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> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__list.html b/runtime/docs/html/group__list.html new file mode 100644 index 00000000..3e9f1eb0 --- /dev/null +++ b/runtime/docs/html/group__list.html @@ -0,0 +1,58 @@ +<!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 new file mode 100644 index 00000000..49550e5c --- /dev/null +++ b/runtime/docs/html/group__lists.html @@ -0,0 +1,323 @@ +<!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: Lists</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>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="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 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="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="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="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 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">Get the number of elements in a list. <a href="#ga4"></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; + +<a class="code" href="structmap__root.html">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__maps.html#ga31">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> +<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#l00181">181</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> +<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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</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 an int64 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>val</em> </td><td></td></tr> + </table> +</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>. +<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> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="map.c::_stp_list_add_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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </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></td></tr> + </table> +</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>. +<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>. +<p> +Referenced by <a class="el" href="copy_8c-source.html#l00130">_stp_copy_argv_from_user()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga1" doxytag="map.c::_stp_list_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">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="mdname1" valign="top" nowrap> <em>map</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> +Clears a list. +<p> +All elements in the list are deleted. <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> + </table> +</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>. +<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> + </tr> +</table> +<a class="anchor" name="ga0" doxytag="map.c::_stp_list_new"></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="structmap__root.html">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> + </tr> + <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="mdname" nowrap> <em>type</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> +Create a new list. +<p> +A list is a map that internally has an incrementing long key for each member. Lists do not wrap if elements are added to exceed their maximum size. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>max_entries</em> </td><td>The maximum number of entries allowed. Currently that number will be preallocated. If max_entries is 0, there will be no maximum and entries will be allocated dynamically. </td></tr> + <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Type of values stored in this list. </td></tr> + </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> + +<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>. +<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> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="map.c::_stp_list_size"></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">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="mdname1" valign="top" nowrap> <em>map</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Get the number of elements in 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> + </table> +</dl> +<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> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__maps.html b/runtime/docs/html/group__maps.html new file mode 100644 index 00000000..1da96a51 --- /dev/null +++ b/runtime/docs/html/group__maps.html @@ -0,0 +1,1265 @@ +<!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: Maps</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>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="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="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="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="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="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="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="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="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="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="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="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="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 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_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">Loop through all elements of a map or list. <a href="#ga31"></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> + +<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>, +<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>, +<b>STAT</b>, +<b>STRING</b>, +<b>END</b> + }</td></tr> + +<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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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">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 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="#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">Add to the current element's statistics. <a href="#ga23"></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> + +<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> +<hr><h2>Define Documentation</h2> +<a class="anchor" name="ga29" doxytag="map.h::_stp_map_key"></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_map_key </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>key </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 (key), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (map, (<span class="keywordtype">char</span> *)(key)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (map, (<span class="keywordtype">long</span>)(key)); \ + }) +</pre></div>Macro to call the proper _stp_map_key function based on the type 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#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> +<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_map_key2 </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>key1, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>key2 </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 (key1), <span class="keywordtype">char</span>[])) \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga9">_stp_map_key_str_str</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">char</span> *)(key2)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga10">_stp_map_key_str_long</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">long</span>)(key2)); \ + <span class="keywordflow">else</span> \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga11">_stp_map_key_long_str</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">char</span> *)(key2)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga8">_stp_map_key_long_long</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">long</span>)(key2)); \ + }) +</pre></div>Macro to call the proper _stp_map_key functions based on the types of the arguments. +<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#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> +<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_map_set </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__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)); \ + }) +</pre></div>Macro to call the proper _stp_map_set function based on the type 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#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> +<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 foreach </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>ptr </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">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)) +</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> + </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; + +<a class="code" href="group__maps.html#ga31">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> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga17" doxytag="map.c::_stp_map_add_int64"></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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</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> +Adds an int64 to the current element's value. +<p> +This adds an int64 to the current element's value. The map must have been created to hold int64s using <a class="el" href="group__maps.html#ga2">_stp_map_new()</a><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>value </td></tr> + </table> +</dl> +<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> + </tr> +</table> +<a class="anchor" name="ga7" doxytag="map.c::_stp_map_del"></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_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="mdname1" valign="top" nowrap> <em>map</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> +Deletes a map. +<p> +Deletes a map, freeing all memory in all elements. Normally done only when the module exits. <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> + </table> +</dl> + +<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> + </tr> +</table> +<a class="anchor" name="ga18" doxytag="map.c::_stp_map_get_int64"></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">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="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<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> + </table> +</dl> +<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> + </tr> +</table> +<a class="anchor" name="ga22" 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" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<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> + </table> +</dl> +<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> + </tr> +</table> +<a class="anchor" name="ga20" doxytag="map.c::_stp_map_get_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">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="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<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> + </table> +</dl> +<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> + </tr> +</table> +<a class="anchor" name="ga6" doxytag="map.c::_stp_map_iter"></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 <a class="el" href="structmap__node.html">map_node</a>* _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="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="mdname" nowrap> <em>m</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> +Get the next element in a map. +<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>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> + +<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> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="map.c::_stp_map_key_del"></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_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="mdname1" valign="top" nowrap> <em>map</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> +Deletes the current element. +<p> +If no current element (key) for this map is set, 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> + </table> +</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>. +<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> + </tr> +</table> +<a class="anchor" name="ga13" doxytag="map.c::_stp_map_key_long"></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_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="mdname" nowrap> <em>map</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>key</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 map's key to a long. +<p> +This sets the current element based on a long key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> + </table> +</dl> + +<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>. +<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> + </tr> +</table> +<a class="anchor" name="ga8" doxytag="map.c::_stp_map_key_long_long"></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_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="mdname" nowrap> <em>map</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>key1</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>key2</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 map's key to two longs. +<p> +This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<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> +<a class="anchor" name="ga11" doxytag="map.c::_stp_map_key_long_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_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="mdname" nowrap> <em>map</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>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key2</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 map's key to a long and a string. +<p> +This sets the current element based on a key of a long and a string. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</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> + </tr> +</table> +<a class="anchor" name="ga12" doxytag="map.c::_stp_map_key_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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key</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 map's key to a string. +<p> +This sets the current element based on a string key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> + </table> +</dl> + +<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> + </tr> +</table> +<a class="anchor" name="ga10" doxytag="map.c::_stp_map_key_str_long"></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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key1</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>key2</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 map's key to a string and a long. +<p> +This sets the current element based on a key of a string and a long. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</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> + </tr> +</table> +<a class="anchor" name="ga9" doxytag="map.c::_stp_map_key_str_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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key2</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 map's key to two strings. +<p> +This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<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> +<a class="anchor" name="ga2" doxytag="map.c::_stp_map_new"></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="structmap__root.html">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> + </tr> + <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="mdname" nowrap> <em>type</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> +Create a new map. +<p> +Maps must be created at module initialization time. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>max_entries</em> </td><td>The maximum number of entries allowed. Currently that number will be preallocated. If more entries are required, the oldest ones will be deleted. This makes it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries will be allocated dynamically. </td></tr> + <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Type of values stored in this map. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>A MAP on success or NULL on failure. </dd></dl> + +<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>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00801">_stp_list_new()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga16" doxytag="map.c::_stp_map_set_int64"></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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</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 an int64. +<p> +This sets the current element's value to an int64. The map must have been created to hold int64s using <a class="el" href="group__maps.html#ga2">_stp_map_new()</a><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 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> + +<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>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga21" doxytag="map.c::_stp_map_set_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">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="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="mdname" nowrap> <em>stats</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 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> +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> + +<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>. +<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>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga19" doxytag="map.c::_stp_map_set_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_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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>val</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 a 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> +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> + +<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>. +<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>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga5" doxytag="map.c::_stp_map_start"></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 <a class="el" href="structmap__node.html">map_node</a>* _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="mdname1" valign="top" nowrap> <em>map</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 the first element in a map. +<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> + </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> + +<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> + </tr> +</table> +<a class="anchor" name="ga23" doxytag="map.c::_stp_map_stat_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">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="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</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> +Add to the current element's statistics. +<p> +Increments the statistics counter by one and the sum by <em>val</em>. Adjusts minimum, maximum, and histogram.<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>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> + +<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>. +<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> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__scbuf.html b/runtime/docs/html/group__scbuf.html new file mode 100644 index 00000000..c5e0d6e0 --- /dev/null +++ b/runtime/docs/html/group__scbuf.html @@ -0,0 +1,122 @@ +<!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"><a class="anchor" name="ga3" doxytag="scbuf::_stp_sprint_str"></a> +void </td><td class="memItemRight" valign="bottom"><b>_stp_sprint_str</b> (const 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__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> +<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="scbuf::_stp_scbuf"></a> +char </td><td class="memItemRight" valign="bottom"><a class="el" href="group__scbuf.html#ga0">_stp_scbuf</a> [8191+1]</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Scratch buffer for printing, building strings, etc. <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. <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">void _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> +Output from <a class="el" href="group__scbuf.html#ga2">_stp_sprint()</a> will accumulate in the buffer until this is called. +<p> +Definition at line <a class="el" href="scbuf_8c-source.html#l00059">59</a> of file <a class="el" href="scbuf_8c-source.html">scbuf.c</a>. +<p> +References <a class="el" href="scbuf_8c-source.html#l00018">_stp_scbuf</a>, and <a class="el" href="scbuf_8c-source.html#l00015">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 class="el" href="group__scbuf.html#ga0">_stp_scbuf</a>, which will contain the null-terminated output. Safe because overflowing <a class="el" href="group__scbuf.html#ga0">_stp_scbuf</a> 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#l00032">32</a> of file <a class="el" href="scbuf_8c-source.html">scbuf.c</a>. +<p> +References <a class="el" href="scbuf_8c-source.html#l00018">_stp_scbuf</a>, and <a class="el" href="scbuf_8c-source.html#l00015">STP_BUF_LEN</a>. +<p> +Referenced by <a class="el" href="sym_8c-source.html#l00045">_stp_symbol_sprint()</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/group__stack.html b/runtime/docs/html/group__stack.html new file mode 100644 index 00000000..bf112d0a --- /dev/null +++ b/runtime/docs/html/group__stack.html @@ -0,0 +1,18 @@ +<!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: Stack Tracing 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="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 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"><a class="anchor" name="ga6" doxytag="stack::_stp_stack_print"></a> +void </td><td class="memItemRight" valign="bottom"><b>_stp_stack_print</b> (int verbose, int levels)</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> + +</table> +</body></html> diff --git a/runtime/docs/html/group__sym.html b/runtime/docs/html/group__sym.html new file mode 100644 index 00000000..c5301602 --- /dev/null +++ b/runtime/docs/html/group__sym.html @@ -0,0 +1,104 @@ +<!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: Symbolic 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="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>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="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">Print addresses symbolically to the trace buffer. <a href="#ga3"></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> +<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_symbol_print </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> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Print addresses symbolically to the trace 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> + +<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>. +<p> +References <a class="el" href="io_8c-source.html#l00043">_stp_print()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga2" 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" 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> + </tr> + </table> + </td> + </tr> +</table> +<table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td> + + </td> + <td> + +<p> +Print 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>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> + +<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>. +<p> +References <a class="el" href="scbuf_8c-source.html#l00032">_stp_sprint()</a>. </td> + </tr> +</table> +</body></html> diff --git a/runtime/docs/html/index.html b/runtime/docs/html/index.html index 458ba52a..86c7e175 100644 --- a/runtime/docs/html/index.html +++ b/runtime/docs/html/index.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="qindexHL" 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> +<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> <p> <h3 align="center">0.1 </h3><h2><a class="anchor" name="intro_sec"> @@ -16,7 +16,7 @@ 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"> 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="map_8c.html#a3">_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> +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> @@ -28,7 +28,7 @@ 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="map_8c.html#a3">_stp_map_new()</a>. Add to it with <a class="el" href="map_8c.html#a27">_stp_list_add_str()</a> and <a class="el" href="map_8c.html#a28">_stp_list_add_int64()</a>. Clear it with <a class="el" href="map_8c.html#a26">_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#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"> Status</a></h2> <ul> <li>Maps are implemented and tested. Histograms are not yet finished. </li> @@ -40,6 +40,6 @@ Status</a></h2> Example Probes</a></h2> Working sample probe code using the runtime is in runtime/probes. <a href="dir_000000.html">Browse probes.</a><h2><a class="anchor" name="todo_sec"> ToDo</a></h2> -<a class="el" href="todo.html">Click Here for Complete List </a> <hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<a class="el" href="todo.html">Click Here for Complete List </a><h2><a class="anchor" name="links"> +Links</a></h2> +<a href="http://sources.redhat.com/systemtap/">SystemTap Project Page</a> </body></html> diff --git a/runtime/docs/html/io_8c-source.html b/runtime/docs/html/io_8c-source.html index c241bba1..064ef3f8 100644 --- a/runtime/docs/html/io_8c-source.html +++ b/runtime/docs/html/io_8c-source.html @@ -4,130 +4,71 @@ <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>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="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file io.c</span> -00003 <span class="comment"> * @brief I/O functions</span> -00004 <span class="comment"> */</span> -00005 <span class="comment"></span> -00006 <span class="comment">/** Logs data.</span> -00007 <span class="comment"> * This function is compatible with printk. In fact it currently</span> -00008 <span class="comment"> * sends all output to vprintk, after sending "STP: ". This allows</span> -00009 <span class="comment"> * us to easily detect SystemTap output in the log file.</span> -00010 <span class="comment"> *</span> -00011 <span class="comment"> * @param fmt A variable number of args.</span> -00012 <span class="comment"> * @bug Lines are limited in length by printk buffer.</span> -00013 <span class="comment"> * @todo Needs replaced with something much faster that does not</span> -00014 <span class="comment"> * use the system log.</span> -00015 <span class="comment"> */</span> -<a name="l00016"></a><a class="code" href="io_8c.html#a4">00016</a> <span class="keywordtype">void</span> <a class="code" href="io_8c.html#a4">dlog</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) -00017 { -00018 va_list args; -00019 printk(<span class="stringliteral">"STP: "</span>); -00020 va_start(args, fmt); -00021 vprintk(fmt, args); -00022 va_end(args); -00023 } -00024 -00025 <span class="comment"></span> -00026 <span class="comment">/** Lookup symbol.</span> -00027 <span class="comment"> * This simply calls the kernel function kallsyms_lookup().</span> -00028 <span class="comment"> * That function is not exported, so this workaround is required.</span> -00029 <span class="comment"> * See the kernel source, kernel/kallsyms.c for more information.</span> -00030 <span class="comment"> */</span> -<a name="l00031"></a><a class="code" href="io_8c.html#a1">00031</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * (*_stp_kallsyms_lookup)(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr, -00032 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *symbolsize, -00033 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *offset, -00034 <span class="keywordtype">char</span> **modname, <span class="keywordtype">char</span> *namebuf)=(<span class="keywordtype">void</span> *)KALLSYMS_LOOKUP; -00035 -00036 -00037 <span class="preprocessor">#define STP_BUF_LEN 8191</span> -00038 <span class="preprocessor"></span><span class="comment"></span> -00039 <span class="comment">/** Static buffer for printing */</span> -<a name="l00040"></a><a class="code" href="io_8c.html#a2">00040</a> <span class="keyword">static</span> <span class="keywordtype">char</span> <a class="code" href="io_8c.html#a2">_stp_pbuf</a>[STP_BUF_LEN+1]; -00041 <span class="keyword">static</span> <span class="keywordtype">int</span> _stp_pbuf_len = STP_BUF_LEN; -00042 <span class="comment"></span> -00043 <span class="comment">/** Print into the print buffer.</span> -00044 <span class="comment"> * Like printf, except output goes into _stp_pbuf,</span> -00045 <span class="comment"> * which will contain the null-terminated output.</span> -00046 <span class="comment"> * Safe because overflowing _stp_pbuf is not allowed.</span> -00047 <span class="comment"> * Size is limited by length of print buffer.</span> -00048 <span class="comment"> *</span> -00049 <span class="comment"> * @param fmt A variable number of args.</span> -00050 <span class="comment"> * @note Formatting output should never be done within</span> -00051 <span class="comment"> * a probe. Use at module exit time.</span> -00052 <span class="comment"> * @sa _stp_print_buf_init</span> -00053 <span class="comment"> */</span> -00054 -<a name="l00055"></a><a class="code" href="io_8c.html#a5">00055</a> <span class="keywordtype">void</span> <a class="code" href="io_8c.html#a5">_stp_print_buf</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...) -00056 { -00057 <span class="keywordtype">int</span> num; -00058 va_list args; -00059 <span class="keywordtype">char</span> *buf = <a class="code" href="io_8c.html#a2">_stp_pbuf</a> + STP_BUF_LEN - _stp_pbuf_len; -00060 va_start(args, fmt); -00061 num = vscnprintf(buf, _stp_pbuf_len, fmt, args); -00062 va_end(args); -00063 <span class="keywordflow">if</span> (num > 0) -00064 _stp_pbuf_len -= num; -00065 } -00066 <span class="comment"></span> -00067 <span class="comment">/** Clear the print buffer.</span> -00068 <span class="comment"> * Output from _stp_print_buf() will accumulate in the buffer</span> -00069 <span class="comment"> * until this is called.</span> -00070 <span class="comment"> */</span> -00071 -<a name="l00072"></a><a class="code" href="io_8c.html#a6">00072</a> <span class="keywordtype">void</span> <a class="code" href="io_8c.html#a6">_stp_print_buf_init</a> (<span class="keywordtype">void</span>) -00073 { -00074 _stp_pbuf_len = STP_BUF_LEN; -00075 <a class="code" href="io_8c.html#a2">_stp_pbuf</a>[0] = 0; -00076 } -00077 <span class="comment"></span> -00078 <span class="comment">/** Print addresses symbolically into the print buffer.</span> -00079 <span class="comment"> * @param fmt A variable number of args.</span> -00080 <span class="comment"> * @param address The address to lookup.</span> -00081 <span class="comment"> * @note Formatting output should never be done within</span> -00082 <span class="comment"> * a probe. Use at module exit time.</span> -00083 <span class="comment"> */</span> -00084 -<a name="l00085"></a><a class="code" href="io_8c.html#a7">00085</a> <span class="keywordtype">void</span> <a class="code" href="io_8c.html#a7">_stp_print_symbol</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) -00086 { -00087 <span class="keywordtype">char</span> *modname; -00088 <span class="keyword">const</span> <span class="keywordtype">char</span> *name; -00089 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset, size; -00090 <span class="keywordtype">char</span> namebuf[KSYM_NAME_LEN+1]; -00091 -00092 name = <a class="code" href="io_8c.html#a1">_stp_kallsyms_lookup</a>(address, &size, &offset, &modname, namebuf); -00093 -00094 <span class="keywordflow">if</span> (!name) -00095 <a class="code" href="io_8c.html#a5">_stp_print_buf</a>(<span class="stringliteral">"0x%lx"</span>, address); -00096 <span class="keywordflow">else</span> { -00097 <span class="keywordflow">if</span> (modname) -00098 <a class="code" href="io_8c.html#a5">_stp_print_buf</a>(<span class="stringliteral">"%s+%#lx/%#lx [%s]"</span>, name, offset, -00099 size, modname); -00100 <span class="keywordflow">else</span> -00101 <a class="code" href="io_8c.html#a5">_stp_print_buf</a>(<span class="stringliteral">"%s+%#lx/%#lx"</span>, name, offset, size); -00102 } -00103 } -00104 <span class="comment"></span> -00105 <span class="comment">/** Get the current return address.</span> -00106 <span class="comment"> * Call from kprobes (not jprobes).</span> -00107 <span class="comment"> * @param regs The pt_regs saved by the kprobe.</span> -00108 <span class="comment"> * @return The return address saved in esp or rsp.</span> -00109 <span class="comment"> * @note i386 and x86_64 only.</span> -00110 <span class="comment"> */</span> -00111 -<a name="l00112"></a><a class="code" href="io_8c.html#a8">00112</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="io_8c.html#a8">cur_ret_addr</a> (<span class="keyword">struct</span> pt_regs *regs) -00113 { -00114 <span class="preprocessor">#ifdef __x86_64__</span> -00115 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *ra = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)regs->rsp; -00116 <span class="preprocessor">#else</span> -00117 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *ra = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *)regs->esp; -00118 <span class="preprocessor">#endif</span> -00119 <span class="preprocessor"></span> <span class="keywordflow">if</span> (ra) -00120 <span class="keywordflow">return</span> *ra; -00121 <span class="keywordflow">else</span> -00122 <span class="keywordflow">return</span> 0; -00123 } -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<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> +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> +</pre></div></body></html> diff --git a/runtime/docs/html/io_8c.html b/runtime/docs/html/io_8c.html index ca8818d3..3357e2f8 100644 --- a/runtime/docs/html/io_8c.html +++ b/runtime/docs/html/io_8c.html @@ -4,309 +4,27 @@ <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> +<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 File Reference</h1>I/O functions. <a href="#_details">More...</a> <p> <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="a0" doxytag="io.c::STP_BUF_LEN"></a> -#define </td><td class="memItemRight" valign="bottom"><b>STP_BUF_LEN</b> 8191</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="io_8c.html#a4">dlog</a> (const char *fmt,...)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Logs data. <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="io_8c.html#a5">_stp_print_buf</a> (const char *fmt,...)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Print into the print buffer. <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="io_8c.html#a6">_stp_print_buf_init</a> (void)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear the print buffer. <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="io_8c.html#a7">_stp_print_symbol</a> (const char *fmt, unsigned long address)</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="mdescLeft"> </td><td class="mdescRight">Print addresses symbolically into the print buffer. <a href="#a7"></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="io_8c.html#a8">cur_ret_addr</a> (struct pt_regs *regs)</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">Get the current return address. <a href="#a8"></a><br></td></tr> -<tr><td colspan="2"><br><h2>Variables</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="io_8c.html#a1">_stp_kallsyms_lookup</a> )(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, char *namebuf) = (void *)KALLSYMS_LOOKUP</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Lookup symbol. <a href="#a1"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2" doxytag="io.c::_stp_pbuf"></a> -static char </td><td class="memItemRight" valign="bottom"><a class="el" href="io_8c.html#a2">_stp_pbuf</a> [8191+1]</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Static buffer for printing. <br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3" doxytag="io.c::_stp_pbuf_len"></a> -static int </td><td class="memItemRight" valign="bottom"><b>_stp_pbuf_len</b> = 8191</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">Prints to the trace buffer. <a href="group__io.html#ga2"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> I/O functions. <p> <p> -Definition in file <a class="el" href="io_8c-source.html">io.c</a>.<hr><h2>Function Documentation</h2> -<a class="anchor" name="a5" doxytag="io.c::_stp_print_buf"></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_buf </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 into _stp_pbuf, which will contain the null-terminated output. Safe because overflowing _stp_pbuf is not allowed. Size is limited by length of 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>fmt</em> </td><td>A variable number of args. </td></tr> - </table> -</dl> -<dl compact><dt><b>Note:</b></dt><dd>Formatting output should never be done within a probe. Use at module exit time. </dd></dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="io_8c.html#a6">_stp_print_buf_init</a> </dd></dl> - -<p> -Definition at line <a class="el" href="io_8c-source.html#l00055">55</a> of file <a class="el" href="io_8c-source.html">io.c</a>. -<p> -References <a class="el" href="io_8c-source.html#l00040">_stp_pbuf</a>. -<p> -Referenced by <a class="el" href="io_8c-source.html#l00085">_stp_print_symbol()</a>. </td> - </tr> -</table> -<a class="anchor" name="a6" doxytag="io.c::_stp_print_buf_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">void _stp_print_buf_init </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 print buffer. -<p> -Output from <a class="el" href="io_8c.html#a5">_stp_print_buf()</a> will accumulate in the buffer until this is called. -<p> -Definition at line <a class="el" href="io_8c-source.html#l00072">72</a> of file <a class="el" href="io_8c-source.html">io.c</a>. -<p> -References <a class="el" href="io_8c-source.html#l00040">_stp_pbuf</a>. </td> - </tr> -</table> -<a class="anchor" name="a7" doxytag="io.c::_stp_print_symbol"></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_symbol </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>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> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Print addresses symbolically into 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>fmt</em> </td><td>A variable number of args. </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>Formatting output should never be done within a probe. Use at module exit time. </dd></dl> - -<p> -Definition at line <a class="el" href="io_8c-source.html#l00085">85</a> of file <a class="el" href="io_8c-source.html">io.c</a>. -<p> -References <a class="el" href="io_8c-source.html#l00031">_stp_kallsyms_lookup</a>, and <a class="el" href="io_8c-source.html#l00055">_stp_print_buf()</a>. </td> - </tr> -</table> -<a class="anchor" name="a8" doxytag="io.c::cur_ret_addr"></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">unsigned long cur_ret_addr </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">struct pt_regs * </td> - <td class="mdname1" valign="top" nowrap> <em>regs</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 the current return address. -<p> -Call from kprobes (not jprobes). <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>regs</em> </td><td>The pt_regs saved by the kprobe. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>The return address saved in esp or rsp. </dd></dl> -<dl compact><dt><b>Note:</b></dt><dd>i386 and x86_64 only. </dd></dl> - -<p> -Definition at line <a class="el" href="io_8c-source.html#l00112">112</a> of file <a class="el" href="io_8c-source.html">io.c</a>. </td> - </tr> -</table> -<a class="anchor" name="a4" doxytag="io.c::dlog"></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" 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> -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> -<dl compact><dt><b><a class="el" href="bug.html#_bug000003">Bug:</a></b></dt><dd>Lines are limited in length by printk buffer.</dd></dl> -<p> -<dl compact><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>Needs replaced with something much faster that does not use the system log. </dd></dl> - -<p> -Definition at line <a class="el" href="io_8c-source.html#l00016">16</a> of file <a class="el" href="io_8c-source.html">io.c</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00794">_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> - </tr> -</table> -<hr><h2>Variable Documentation</h2> -<a class="anchor" name="a1" doxytag="io.c::_stp_kallsyms_lookup"></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">const char*(* <a class="el" href="io_8c.html#a1">_stp_kallsyms_lookup</a>)(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, char *namebuf) = (void *)KALLSYMS_LOOKUP<code> [static]</code> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Lookup symbol. -<p> -This simply calls the kernel function kallsyms_lookup(). That function is not exported, so this workaround is required. See the kernel source, kernel/kallsyms.c for more information. -<p> -Definition at line <a class="el" href="io_8c-source.html#l00031">31</a> of file <a class="el" href="io_8c-source.html">io.c</a>. -<p> -Referenced by <a class="el" href="io_8c-source.html#l00085">_stp_print_symbol()</a>. </td> - </tr> -</table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +Definition in file <a class="el" href="io_8c-source.html">io.c</a>.</body></html> diff --git a/runtime/docs/html/kprobe__where__funct_8c-source.html b/runtime/docs/html/kprobe__where__funct_8c-source.html index cccc3205..dbe9ac74 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="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="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="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> @@ -16,75 +16,75 @@ 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 "runtime.h"</span> +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 -00015 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: where_func"</span>); -00016 MODULE_AUTHOR(<span class="stringliteral">"Will Cohen and Martin Hunt"</span>); -00017 -00018 <span class="keyword">static</span> <span class="keywordtype">char</span> default_name[] = <span class="stringliteral">"schedule"</span>; -00019 <span class="keyword">static</span> <span class="keywordtype">char</span> *funct_name = default_name; -00020 module_param(funct_name, charp, 0); -00021 MODULE_PARM_DESC(funct_name, <span class="stringliteral">"function entry name.\n"</span>); -00022 -00023 <span class="keyword">static</span> <span class="keywordtype">int</span> count_funct = 0; +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 <a class="code" href="structmap__root.html">MAP</a> funct_locations; +00025 <span class="keyword">static</span> <span class="keywordtype">int</span> count_funct = 0; 00026 -00027 <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) -00028 { -00029 <span class="keywordtype">long</span> ret_addr = <a class="code" href="io_8c.html#a8">cur_ret_addr</a>(regs); -00030 ++count_funct; -00031 <a class="code" href="map_8c.html#a14">_stp_map_key_long</a>(funct_locations, ret_addr); -00032 <a class="code" href="map_8c.html#a18">_stp_map_add_int64</a>(funct_locations, 1); -00033 <span class="keywordflow">return</span> 0; -00034 } -00035 -00036 <span class="comment">/*For each probe you need to allocate a kprobe structure*/</span> -00037 <span class="keyword">static</span> <span class="keyword">struct </span>kprobe kp[] = { -00038 { -00039 .addr = default_name, -00040 .pre_handler = inst_funct, -00041 } -00042 }; -00043 <span class="preprocessor">#define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe))</span> -00044 <span class="preprocessor"></span> -00045 <span class="keywordtype">int</span> init_module(<span class="keywordtype">void</span>) -00046 { -00047 <span class="keywordtype">int</span> ret; -00048 -00049 funct_locations = <a class="code" href="map_8c.html#a3">_stp_map_new</a>(1000, INT64); +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 <span class="keywordflow">if</span> (funct_name) -00052 kp[0].addr = funct_name; -00053 -00054 ret = _stp_register_kprobes (kp, MAX_KPROBES); +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 return ret; -00057 } -00058 -00059 <span class="keywordtype">void</span> cleanup_module(<span class="keywordtype">void</span>) -00060 { -00061 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *ptr; -00062 -00063 <a class="code" href="probes_8c.html#a3">_stp_unregister_kprobes</a> (kp, MAX_KPROBES); +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; 00064 -00065 <a class="code" href="io_8c.html#a4">dlog</a>(<span class="stringliteral">"%s() called %d times.\n"</span>, funct_name, count_funct); -00066 <a class="code" href="io_8c.html#a4">dlog</a>(<span class="stringliteral">"NUM\tCaller Addr\tCaller Name\n"</span>, funct_name); -00067 -00068 <span class="comment">/* now walk the hash table and print out all the information */</span> -00069 <a class="code" href="map_8h.html#a8">foreach</a>(funct_locations, ptr) { -00070 <a class="code" href="io_8c.html#a6">_stp_print_buf_init</a>(); -00071 <a class="code" href="io_8c.html#a7">_stp_print_symbol</a>(<span class="stringliteral">"%s\n"</span>, <a class="code" href="map_8h.html#a2">key1int</a>(ptr)); -00072 <a class="code" href="io_8c.html#a4">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="map_8h.html#a2">key1int</a>(ptr), _stp_pbuf); -00073 } -00074 -00075 <a class="code" href="map_8c.html#a8">_stp_map_del</a>(funct_locations); -00076 } -00077 -00078 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +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 <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), _stp_scbuf); +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>); +</pre></div></body></html> diff --git a/runtime/docs/html/map_8c-source.html b/runtime/docs/html/map_8c-source.html index 9d91bd68..1ff69e73 100644 --- a/runtime/docs/html/map_8c-source.html +++ b/runtime/docs/html/map_8c-source.html @@ -4,866 +4,885 @@ <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>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="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file map.c</span> -00003 <span class="comment"> * @brief Implements maps (associative arrays) and lists</span> -00004 <span class="comment"> */</span> -00005 -00006 <span class="keyword">static</span> <span class="keywordtype">int</span> map_sizes[] = { -00007 <span class="keyword">sizeof</span>(<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a>), -00008 sizeof(struct map_node_stat), -00009 sizeof(struct map_node_str), -00010 0 -00011 }; -00012 -00013 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> string_hash(<span class="keyword">const</span> <span class="keywordtype">char</span> *key1, <span class="keyword">const</span> <span class="keywordtype">char</span> *key2) -00014 { -00015 <span class="keywordtype">int</span> hash = 0, count = 0; -00016 <span class="keywordtype">char</span> *v1 = (<span class="keywordtype">char</span> *)key1; -00017 <span class="keywordtype">char</span> *v2 = (<span class="keywordtype">char</span> *)key2; -00018 <span class="keywordflow">while</span> (*v1 && count++ < 5) { -00019 hash += *v1++; -00020 } -00021 <span class="keywordflow">while</span> (v2 && *v2 && count++ < 5) { -00022 hash += *v2++; -00023 } -00024 <span class="keywordflow">return</span> hash_long((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)hash, HASH_TABLE_BITS); -00025 } -00026 -00027 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> mixed_hash(<span class="keyword">const</span> <span class="keywordtype">char</span> *key1, <span class="keywordtype">long</span> key2) -00028 { -00029 <span class="keywordtype">int</span> hash = 0, count = 0; -00030 <span class="keywordtype">char</span> *v = (<span class="keywordtype">char</span> *)key1; -00031 <span class="keywordflow">while</span> (v && *v && count++ < 5) -00032 hash += *v++; -00033 return hash_long((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)(hash ^ key2), HASH_TABLE_BITS); -00034 } -00035 <span class="comment"></span> -00036 <span class="comment">/** Create a new map.</span> -00037 <span class="comment"> * Maps must be created at module initialization time.</span> -00038 <span class="comment"> * @param max_entries The maximum number of entries allowed. Currently that number will</span> -00039 <span class="comment"> * be preallocated. If more entries are required, the oldest ones will be deleted. This makes</span> -00040 <span class="comment"> * it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries</span> -00041 <span class="comment"> * will be allocated dynamically.</span> -00042 <span class="comment"> * @param type Type of values stored in this map. </span> -00043 <span class="comment"> * @return A MAP on success or NULL on failure.</span> -00044 <span class="comment"> */</span> -00045 -<a name="l00046"></a><a class="code" href="map_8c.html#a3">00046</a> <a class="code" href="structmap__root.html">MAP</a> _stp_map_new(<span class="keywordtype">unsigned</span> max_entries, enum valtype type) -00047 { -00048 size_t size; -00049 <a class="code" href="structmap__root.html">MAP</a> m = (<a class="code" href="structmap__root.html">MAP</a>) <a class="code" href="alloc_8h.html#a5">_stp_valloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code" href="structmap__root.html">map_root</a>)); -00050 <span class="keywordflow">if</span> (m == NULL) -00051 <span class="keywordflow">return</span> NULL; -00052 -00053 INIT_LIST_HEAD(&m-><a class="code" href="structmap__root.html#o4">head</a>); -00054 -00055 m-><a class="code" href="structmap__root.html#o1">maxnum</a> = max_entries; -00056 m-><a class="code" href="structmap__root.html#o0">type</a> = type; -00057 <span class="keywordflow">if</span> (type >= END) { -00058 dbug (<span class="stringliteral">"map_new: unknown type %d\n"</span>, type); -00059 <span class="keywordflow">return</span> NULL; -00060 } -00061 -00062 <span class="keywordflow">if</span> (max_entries) { -00063 <span class="keywordtype">void</span> *tmp; -00064 <span class="keywordtype">int</span> i; -00065 <span class="keyword">struct </span>list_head *e; -00066 -00067 INIT_LIST_HEAD(&m-><a class="code" href="structmap__root.html#o5">pool</a>); -00068 size = map_sizes[type]; -00069 tmp = <a class="code" href="alloc_8h.html#a5">_stp_valloc</a>(max_entries * size); -00070 -00071 <span class="keywordflow">for</span> (i = max_entries - 1; i >= 0; i--) { -00072 e = i * size + tmp; -00073 dbug (<span class="stringliteral">"e=%lx\n"</span>, (<span class="keywordtype">long</span>)e); -00074 list_add(e, &m-><a class="code" href="structmap__root.html#o5">pool</a>); -00075 } -00076 m-><a class="code" href="structmap__root.html#o14">membuf</a> = tmp; -00077 } -00078 <span class="keywordflow">return</span> m; -00079 } -00080 -00081 <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) -00082 { -00083 <span class="keyword">struct </span>map_node_str *m = (<span class="keyword">struct </span>map_node_str *)n; -00084 dbug (<span class="stringliteral">"n = %lx\n"</span>, (<span class="keywordtype">long</span>)n); -00085 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o0">type</a> == STRING) { -00086 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>); -00087 <span class="keywordflow">if</span> (m-><a class="code" href="structmap__node__str.html#o1">str</a>) -00088 _stp_free(m->str); -00089 } -00090 if (m->n.key1type == STR) { -00091 dbug (<span class="stringliteral">"key1 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="map_8h.html#a0">key1str</a>(m)); -00092 <span class="keywordflow">if</span> (<a class="code" href="map_8h.html#a0">key1str</a>(m)) -00093 _stp_free(key1str(m)); -00094 } -00095 if (m->n.key2type == STR) { -00096 dbug (<span class="stringliteral">"key2 STR %lx\n"</span>, (<span class="keywordtype">long</span>)<a class="code" href="map_8h.html#a1">key2str</a>(m)); -00097 <span class="keywordflow">if</span> (<a class="code" href="map_8h.html#a1">key2str</a>(m)) -00098 _stp_free(key2str(m)); -00099 } -00100 } -00101 <span class="comment"></span> -00102 <span class="comment">/** Deletes the current element.</span> -00103 <span class="comment"> * If no current element (key) for this map is set, this function does nothing.</span> -00104 <span class="comment"> * @param map </span> -00105 <span class="comment"> */</span> -00106 -<a name="l00107"></a><a class="code" href="map_8c.html#a5">00107</a> <span class="keywordtype">void</span> _stp_map_key_del(<a class="code" href="structmap__root.html">MAP</a> map) -00108 { -00109 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *m; -00110 -00111 dbug (<span class="stringliteral">"create=%d key=%lx\n"</span>, map->create, (<span class="keywordtype">long</span>)map->key); -00112 <span class="keywordflow">if</span> (map == NULL) -00113 <span class="keywordflow">return</span>; -00114 -00115 <span class="keywordflow">if</span> (map->create) { -00116 map->create = 0; -00117 map->key = NULL; -00118 <span class="keywordflow">return</span>; -00119 } -00120 -00121 <span class="keywordflow">if</span> (map->key == NULL) -00122 <span class="keywordflow">return</span>; -00123 -00124 m = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)map->key; +<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> +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>), +00014 sizeof(struct map_node_stat), +00015 sizeof(struct map_node_str), +00016 0 +00017 }; +00018 +00019 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> string_hash(<span class="keyword">const</span> <span class="keywordtype">char</span> *key1, <span class="keyword">const</span> <span class="keywordtype">char</span> *key2) +00020 { +00021 <span class="keywordtype">int</span> hash = 0, count = 0; +00022 <span class="keywordtype">char</span> *v1 = (<span class="keywordtype">char</span> *)key1; +00023 <span class="keywordtype">char</span> *v2 = (<span class="keywordtype">char</span> *)key2; +00024 <span class="keywordflow">while</span> (*v1 && count++ < 5) { +00025 hash += *v1++; +00026 } +00027 <span class="keywordflow">while</span> (v2 && *v2 && count++ < 5) { +00028 hash += *v2++; +00029 } +00030 <span class="keywordflow">return</span> hash_long((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)hash, HASH_TABLE_BITS); +00031 } +00032 +00033 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> mixed_hash(<span class="keyword">const</span> <span class="keywordtype">char</span> *key1, <span class="keywordtype">long</span> key2) +00034 { +00035 <span class="keywordtype">int</span> hash = 0, count = 0; +00036 <span class="keywordtype">char</span> *v = (<span class="keywordtype">char</span> *)key1; +00037 <span class="keywordflow">while</span> (v && *v && count++ < 5) +00038 hash += *v++; +00039 return hash_long((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)(hash ^ key2), HASH_TABLE_BITS); +00040 } +00041 <span class="comment"></span> +00042 <span class="comment">/** @addtogroup maps </span> +00043 <span class="comment"> * Implements maps (associative arrays) and lists</span> +00044 <span class="comment"> * @{ </span> +00045 <span class="comment"> */</span> +00046 <span class="comment"></span> +00047 <span class="comment">/** Create a new map.</span> +00048 <span class="comment"> * Maps must be created at module initialization time.</span> +00049 <span class="comment"> * @param max_entries The maximum number of entries allowed. Currently that number will</span> +00050 <span class="comment"> * be preallocated. If more entries are required, the oldest ones will be deleted. This makes</span> +00051 <span class="comment"> * it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries</span> +00052 <span class="comment"> * will be allocated dynamically.</span> +00053 <span class="comment"> * @param type Type of values stored in this map. </span> +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) +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>)); +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>); +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; +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; +00071 } +00072 +00073 <span class="keywordflow">if</span> (max_entries) { +00074 <span class="keywordtype">void</span> *tmp; +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>); +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>); +00086 } +00087 m-><a class="code" href="structmap__root.html#o14">membuf</a> = 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) +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>) +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)) +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)) +00109 _stp_free(key2str(m)); +00110 } +00111 } +00112 <span class="comment"></span> +00113 <span class="comment">/** Deletes the current element.</span> +00114 <span class="comment"> * If no current element (key) for this map is set, this function does nothing.</span> +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) +00119 { +00120 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *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) +00124 <span class="keywordflow">return</span>; 00125 -00126 <span class="comment">/* remove node from old hash list */</span> -00127 hlist_del_init(&m-><a class="code" href="structmap__node.html#o1">hnode</a>); -00128 -00129 <span class="comment">/* remove from entry list */</span> -00130 list_del(&m-><a class="code" href="structmap__node.html#o0">lnode</a>); +00126 <span class="keywordflow">if</span> (map->create) { +00127 map->create = 0; +00128 map->key = NULL; +00129 <span class="keywordflow">return</span>; +00130 } 00131 -00132 <span class="comment">/* remove any allocated string storage */</span> -00133 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)map->key); +00132 <span class="keywordflow">if</span> (map->key == NULL) +00133 <span class="keywordflow">return</span>; 00134 -00135 <span class="keywordflow">if</span> (map->maxnum) -00136 list_add(&m-><a class="code" href="structmap__node.html#o0">lnode</a>, &map->pool); -00137 <span class="keywordflow">else</span> -00138 <a class="code" href="alloc_8h.html#a6">_stp_free</a>(m); +00135 m = (<span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *)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>); 00139 -00140 map->key = NULL; -00141 map->num--; -00142 } -00143 <span class="comment"></span> -00144 <span class="comment">/** Get the first element in a map.</span> -00145 <span class="comment"> * @param map </span> -00146 <span class="comment"> * @returns a pointer to the first element.</span> -00147 <span class="comment"> * This is typically used with _stp_map_iter(). See the foreach() macro</span> -00148 <span class="comment"> * for typical usage. It probably does what you want anyway.</span> -00149 <span class="comment"> * @sa foreach</span> -00150 <span class="comment"> */</span> -00151 -<a name="l00152"></a><a class="code" href="map_8c.html#a6">00152</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="map_8c.html#a6">_stp_map_start</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00153 { -00154 <span class="keywordflow">if</span> (map == NULL) -00155 <span class="keywordflow">return</span> NULL; -00156 -00157 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o4">head</a>.next); -00158 -00159 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) -00160 <span class="keywordflow">return</span> NULL; -00161 -00162 <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; -00163 } -00164 <span class="comment"></span> -00165 <span class="comment">/** Get the next element in a map.</span> -00166 <span class="comment"> * @param map </span> -00167 <span class="comment"> * @param m a pointer to the current element, returned from _stp_map_start()</span> -00168 <span class="comment"> * or _stp_map_iter().</span> -00169 <span class="comment"> * @returns a pointer to the next element.</span> -00170 <span class="comment"> * This is typically used with _stp_map_start(). See the foreach() macro</span> -00171 <span class="comment"> * for typical usage. It probably does what you want anyway.</span> -00172 <span class="comment"> * @sa foreach</span> -00173 <span class="comment"> */</span> -00174 -<a name="l00175"></a><a class="code" href="map_8c.html#a7">00175</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="map_8c.html#a7">_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) -00176 { -00177 <span class="keywordflow">if</span> (map == NULL) -00178 <span class="keywordflow">return</span> NULL; -00179 -00180 dbug (<span class="stringliteral">"%lx next=%lx prev=%lx map->head.next=%lx\n"</span>, (<span class="keywordtype">long</span>)m, -00181 (<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); -00182 -00183 <span class="keywordflow">if</span> (m->lnode.next == &map-><a class="code" href="structmap__root.html#o4">head</a>) -00184 <span class="keywordflow">return</span> NULL; +00140 <span class="comment">/* remove from entry list */</span> +00141 list_del(&m-><a class="code" href="structmap__node.html#o0">lnode</a>); +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); +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); +00148 <span class="keywordflow">else</span> +00149 <a class="code" href="group__alloc.html#ga4">_stp_free</a>(m); +00150 +00151 map->key = NULL; +00152 map->num--; +00153 } +00154 <span class="comment"></span> +00155 <span class="comment">/** Get the first element in a map.</span> +00156 <span class="comment"> * @param map </span> +00157 <span class="comment"> * @returns a pointer to the first element.</span> +00158 <span class="comment"> * This is typically used with _stp_map_iter(). See the foreach() macro</span> +00159 <span class="comment"> * for typical usage. It probably does what you want anyway.</span> +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) +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); +00169 +00170 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) +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; +00174 } +00175 <span class="comment"></span> +00176 <span class="comment">/** Get the next element in a map.</span> +00177 <span class="comment"> * @param map </span> +00178 <span class="comment"> * @param m a pointer to the current element, returned from _stp_map_start()</span> +00179 <span class="comment"> * or _stp_map_iter().</span> +00180 <span class="comment"> * @returns a pointer to the next element.</span> +00181 <span class="comment"> * This is typically used with _stp_map_start(). See the foreach() macro</span> +00182 <span class="comment"> * for typical usage. It probably does what you want anyway.</span> +00183 <span class="comment"> * @sa foreach</span> +00184 <span class="comment"> */</span> 00185 -00186 <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; -00187 } -00188 <span class="comment"></span> -00189 <span class="comment">/** Deletes a map.</span> -00190 <span class="comment"> * Deletes a map, freeing all memory in all elements. Normally done only when the module exits.</span> -00191 <span class="comment"> * @param map</span> -00192 <span class="comment"> */</span> +<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) +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); 00193 -<a name="l00194"></a><a class="code" href="map_8c.html#a8">00194</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a8">_stp_map_del</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00195 { -00196 <span class="keywordflow">if</span> (map == NULL) -00197 <span class="keywordflow">return</span>; -00198 -00199 <span class="keywordflow">if</span> (!list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) { -00200 <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; -00201 <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>) { -00202 map_free_strings(map, ptr); -00203 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; -00204 } -00205 } -00206 <a class="code" href="alloc_8h.html#a7">_stp_vfree</a>(map-><a class="code" href="structmap__root.html#o14">membuf</a>); -00207 <a class="code" href="alloc_8h.html#a7">_stp_vfree</a>(map); -00208 } +00194 <span class="keywordflow">if</span> (m->lnode.next == &map-><a class="code" href="structmap__root.html#o4">head</a>) +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; +00198 } +00199 <span class="comment"></span> +00200 <span class="comment">/** Deletes a map.</span> +00201 <span class="comment"> * Deletes a map, freeing all memory in all elements. Normally done only when the module exits.</span> +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) +00206 { +00207 <span class="keywordflow">if</span> (map == NULL) +00208 <span class="keywordflow">return</span>; 00209 -00210 <span class="comment">/********************** KEY FUNCTIONS *********************/</span> -00211 -00212 <span class="comment"></span> -00213 <span class="comment">/** Set the map's key to two longs.</span> -00214 <span class="comment"> * This sets the current element based on a key of two strings. If the keys are</span> -00215 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00216 <span class="comment"> * call.</span> -00217 <span class="comment"> * @param map</span> -00218 <span class="comment"> * @param key1 first key</span> -00219 <span class="comment"> * @param key2 second key</span> -00220 <span class="comment"> */</span> -00221 -<a name="l00222"></a><a class="code" href="map_8c.html#a9">00222</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a9">_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) -00223 { -00224 <span class="keywordtype">unsigned</span> hv; -00225 <span class="keyword">struct </span>hlist_head *head; -00226 <span class="keyword">struct </span>hlist_node *e; -00227 -00228 <span class="keywordflow">if</span> (map == NULL) -00229 <span class="keywordflow">return</span>; -00230 -00231 hv = hash_long(key1 ^ key2, HASH_TABLE_BITS); -00232 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; -00233 -00234 dbug (<span class="stringliteral">"hash for %ld,%ld is %d\n"</span>, key1, key2, hv); -00235 -00236 hlist_for_each(e, head) { -00237 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00238 (<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)); -00239 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>); -00240 <span class="keywordflow">if</span> (key1 == n->key1.val && key2 == n->key2.val) { -00241 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00242 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>); -00243 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00244 <span class="keywordflow">return</span>; -00245 } -00246 } -00247 -00248 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key1; -00249 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key2; -00250 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = LONG; -00251 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = LONG; -00252 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00253 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; -00254 } -00255 <span class="comment"></span> -00256 <span class="comment">/** Set the map's key to two strings.</span> -00257 <span class="comment"> * This sets the current element based on a key of two strings. If the keys are</span> -00258 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00259 <span class="comment"> * call.</span> -00260 <span class="comment"> * @param map</span> -00261 <span class="comment"> * @param key1 first key</span> -00262 <span class="comment"> * @param key2 second key</span> -00263 <span class="comment"> */</span> -00264 -<a name="l00265"></a><a class="code" href="map_8c.html#a10">00265</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a10">_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) -00266 { -00267 <span class="keywordtype">unsigned</span> hv; -00268 <span class="keyword">struct </span>hlist_head *head; -00269 <span class="keyword">struct </span>hlist_node *e; -00270 -00271 <span class="keywordflow">if</span> (map == NULL) -00272 <span class="keywordflow">return</span>; -00273 -00274 <span class="keywordflow">if</span> (key1 == NULL) { -00275 map-><a class="code" href="structmap__root.html#o6">key</a> = NULL; -00276 <span class="keywordflow">return</span>; -00277 } -00278 -00279 hv = string_hash(key1, key2); -00280 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +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>) { +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; +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>); +00218 <a class="code" href="group__alloc.html#ga5">_stp_vfree</a>(map); +00219 } +00220 +00221 <span class="comment">/********************** KEY FUNCTIONS *********************/</span> +00222 +00223 <span class="comment"></span> +00224 <span class="comment">/** Set the map's key to two longs.</span> +00225 <span class="comment"> * This sets the current element based on a key of two strings. If the keys are</span> +00226 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00227 <span class="comment"> * call.</span> +00228 <span class="comment"> * @param map</span> +00229 <span class="comment"> * @param key1 first key</span> +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) +00234 { +00235 <span class="keywordtype">unsigned</span> hv; +00236 <span class="keyword">struct </span>hlist_head *head; +00237 <span class="keyword">struct </span>hlist_node *e; +00238 +00239 <span class="keywordflow">if</span> (map == NULL) +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]; +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>); +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; +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; +00265 } +00266 <span class="comment"></span> +00267 <span class="comment">/** Set the map's key to two strings.</span> +00268 <span class="comment"> * This sets the current element based on a key of two strings. If the keys are</span> +00269 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00270 <span class="comment"> * call.</span> +00271 <span class="comment"> * @param map</span> +00272 <span class="comment"> * @param key1 first key</span> +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) +00277 { +00278 <span class="keywordtype">unsigned</span> hv; +00279 <span class="keyword">struct </span>hlist_head *head; +00280 <span class="keyword">struct </span>hlist_node *e; 00281 -00282 dbug (<span class="stringliteral">"hash for %s,%s is %d\n"</span>, key1, key2, hv); -00283 -00284 hlist_for_each(e, head) { -00285 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00286 (<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)); -00287 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>); -00288 <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 -00289 && (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)) { -00290 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00291 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>); -00292 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00293 <span class="keywordflow">return</span>; -00294 } -00295 } -00296 -00297 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key1; -00298 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key2; -00299 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = STR; -00300 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = STR; -00301 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00302 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; -00303 } -00304 <span class="comment"></span> -00305 <span class="comment">/** Set the map's key to a string and a long.</span> -00306 <span class="comment"> * This sets the current element based on a key of a string and a long. If the keys are</span> -00307 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00308 <span class="comment"> * call.</span> -00309 <span class="comment"> * @param map</span> -00310 <span class="comment"> * @param key1 first key</span> -00311 <span class="comment"> * @param key2 second key</span> -00312 <span class="comment"> */</span> -00313 -<a name="l00314"></a><a class="code" href="map_8c.html#a11">00314</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a11">_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) -00315 { -00316 <span class="keywordtype">unsigned</span> hv; -00317 <span class="keyword">struct </span>hlist_head *head; -00318 <span class="keyword">struct </span>hlist_node *e; -00319 -00320 <span class="keywordflow">if</span> (map == NULL) -00321 <span class="keywordflow">return</span>; -00322 -00323 <span class="keywordflow">if</span> (key1 == NULL) { -00324 map-><a class="code" href="structmap__root.html#o6">key</a> = NULL; -00325 <span class="keywordflow">return</span>; -00326 } -00327 -00328 hv = mixed_hash(key1, key2); -00329 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; +00282 <span class="keywordflow">if</span> (map == NULL) +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; +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]; +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; +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; +00314 } +00315 <span class="comment"></span> +00316 <span class="comment">/** Set the map's key to a string and a long.</span> +00317 <span class="comment"> * This sets the current element based on a key of a string and a long. If the keys are</span> +00318 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00319 <span class="comment"> * call.</span> +00320 <span class="comment"> * @param map</span> +00321 <span class="comment"> * @param key1 first key</span> +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) +00326 { +00327 <span class="keywordtype">unsigned</span> hv; +00328 <span class="keyword">struct </span>hlist_head *head; +00329 <span class="keyword">struct </span>hlist_node *e; 00330 -00331 dbug (<span class="stringliteral">"hash for %s,%ld is %d\n"</span>, key1, key2, hv); -00332 -00333 hlist_for_each(e, head) { -00334 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00335 (<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)); -00336 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>); -00337 <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>) { -00338 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00339 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>); -00340 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00341 <span class="keywordflow">return</span>; -00342 } -00343 } -00344 -00345 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key1; -00346 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key2; -00347 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = STR; -00348 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = LONG; -00349 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00350 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; -00351 } -00352 <span class="comment"></span> -00353 <span class="comment">/** Set the map's key to a long and a string.</span> -00354 <span class="comment"> * This sets the current element based on a key of a long and a string. If the keys are</span> -00355 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00356 <span class="comment"> * call.</span> -00357 <span class="comment"> * @param map</span> -00358 <span class="comment"> * @param key1 first key</span> -00359 <span class="comment"> * @param key2 second key</span> -00360 <span class="comment"> */</span> -00361 -<a name="l00362"></a><a class="code" href="map_8c.html#a12">00362</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a12">_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) -00363 { -00364 <span class="keywordtype">unsigned</span> hv; -00365 <span class="keyword">struct </span>hlist_head *head; -00366 <span class="keyword">struct </span>hlist_node *e; -00367 -00368 <span class="keywordflow">if</span> (map == NULL) -00369 <span class="keywordflow">return</span>; -00370 -00371 hv = mixed_hash(key2, key1); -00372 head = &map-><a class="code" href="structmap__root.html#o13">hashes</a>[hv]; -00373 dbug (<span class="stringliteral">"hash for %ld,%s is %d\n"</span>, key1, key2, hv); -00374 -00375 hlist_for_each(e, head) { -00376 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *n = -00377 (<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)); -00378 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>); -00379 <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) { -00380 map-><a class="code" href="structmap__root.html#o6">key</a> = n; -00381 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>); -00382 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00383 <span class="keywordflow">return</span>; -00384 } -00385 } -00386 -00387 map-><a class="code" href="structmap__root.html#o11">c_key1</a>.<a class="code" href="unionkey__data.html#o0">val</a> = key1; -00388 map-><a class="code" href="structmap__root.html#o12">c_key2</a>.<a class="code" href="unionkey__data.html#o1">str</a> = key2; -00389 map-><a class="code" href="structmap__root.html#o8">c_key1type</a> = LONG; -00390 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = STR; -00391 map-><a class="code" href="structmap__root.html#o10">c_keyhead</a> = head; -00392 map-><a class="code" href="structmap__root.html#o7">create</a> = 1; -00393 } -00394 <span class="comment"></span> -00395 <span class="comment">/** Set the map's key to a string.</span> -00396 <span class="comment"> * This sets the current element based on a string key. If the key is</span> -00397 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00398 <span class="comment"> * call.</span> -00399 <span class="comment"> * @param map</span> -00400 <span class="comment"> * @param key</span> -00401 <span class="comment"> */</span> -00402 -<a name="l00403"></a><a class="code" href="map_8c.html#a13">00403</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a13">_stp_map_key_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *key) -00404 { -00405 <span class="keywordflow">if</span> (map == NULL) -00406 <span class="keywordflow">return</span>; -00407 <a class="code" href="map_8c.html#a10">_stp_map_key_str_str</a>(map, key, NULL); -00408 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = NONE; -00409 } -00410 <span class="comment"></span> -00411 <span class="comment">/** Set the map's key to a long.</span> -00412 <span class="comment"> * This sets the current element based on a long key. If the key is</span> -00413 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> -00414 <span class="comment"> * call.</span> -00415 <span class="comment"> * @param map</span> -00416 <span class="comment"> * @param key </span> -00417 <span class="comment"> */</span> -00418 -<a name="l00419"></a><a class="code" href="map_8c.html#a14">00419</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a14">_stp_map_key_long</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">long</span> key) -00420 { -00421 <span class="keywordflow">if</span> (map == NULL) -00422 <span class="keywordflow">return</span>; -00423 <a class="code" href="map_8c.html#a9">_stp_map_key_long_long</a>(map, key, 0); -00424 map-><a class="code" href="structmap__root.html#o9">c_key2type</a> = NONE; -00425 } -00426 -00427 <span class="comment">/********************** SET/GET VALUES *********************/</span> -00428 -00429 <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) -00430 { -00431 m->key1type = map-><a class="code" href="structmap__root.html#o8">c_key1type</a>; -00432 m->key2type = map-><a class="code" href="structmap__root.html#o9">c_key2type</a>; -00433 <span class="keywordflow">switch</span> (map-><a class="code" href="structmap__root.html#o8">c_key1type</a>) { -00434 <span class="keywordflow">case</span> STR: -00435 m->key1.str = <a class="code" href="alloc_8h.html#a3">_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); -00436 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>); -00437 <span class="keywordflow">break</span>; -00438 <span class="keywordflow">case</span> LONG: -00439 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>; -00440 <span class="keywordflow">break</span>; -00441 <span class="keywordflow">case</span> NONE: -00442 <span class="comment">/* ERROR */</span> -00443 <span class="keywordflow">break</span>; -00444 } -00445 <span class="keywordflow">switch</span> (map-><a class="code" href="structmap__root.html#o9">c_key2type</a>) { -00446 <span class="keywordflow">case</span> STR: -00447 m->key2.<a class="code" href="unionkey__data.html#o1">str</a> = <a class="code" href="alloc_8h.html#a3">_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); -00448 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>); -00449 <span class="keywordflow">break</span>; -00450 <span class="keywordflow">case</span> LONG: -00451 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>; -00452 <span class="keywordflow">break</span>; -00453 <span class="keywordflow">case</span> NONE: +00331 <span class="keywordflow">if</span> (map == NULL) +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; +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]; +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; +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; +00362 } +00363 <span class="comment"></span> +00364 <span class="comment">/** Set the map's key to a long and a string.</span> +00365 <span class="comment"> * This sets the current element based on a key of a long and a string. If the keys are</span> +00366 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00367 <span class="comment"> * call.</span> +00368 <span class="comment"> * @param map</span> +00369 <span class="comment"> * @param key1 first key</span> +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) +00374 { +00375 <span class="keywordtype">unsigned</span> hv; +00376 <span class="keyword">struct </span>hlist_head *head; +00377 <span class="keyword">struct </span>hlist_node *e; +00378 +00379 <span class="keywordflow">if</span> (map == NULL) +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]; +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; +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; +00404 } +00405 <span class="comment"></span> +00406 <span class="comment">/** Set the map's key to a string.</span> +00407 <span class="comment"> * This sets the current element based on a string key. If the key is</span> +00408 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00409 <span class="comment"> * call.</span> +00410 <span class="comment"> * @param map</span> +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) +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; +00420 } +00421 <span class="comment"></span> +00422 <span class="comment">/** Set the map's key to a long.</span> +00423 <span class="comment"> * This sets the current element based on a long key. If the key is</span> +00424 <span class="comment"> * not found, a new element will not be created until a <i>_stp_map_set_xxx</i></span> +00425 <span class="comment"> * call.</span> +00426 <span class="comment"> * @param map</span> +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) +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; +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) +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>) { +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>); +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>; +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 -00457 <span class="comment">/* add node to new hash list */</span> -00458 hlist_add_head(&m->hnode, map-><a class="code" href="structmap__root.html#o10">c_keyhead</a>); -00459 -00460 map-><a class="code" href="structmap__root.html#o6">key</a> = m; -00461 map-><a class="code" href="structmap__root.html#o7">create</a> = 0; -00462 map-><a class="code" href="structmap__root.html#o2">num</a>++; -00463 } -00464 -00465 <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) -00466 { -00467 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *m; -00468 -00469 <span class="keywordflow">if</span> (map == NULL) -00470 return; -00471 -00472 if (map->create) { -00473 <span class="keywordflow">if</span> (val == 0) -00474 return; +00456 <span class="keywordflow">switch</span> (map-><a class="code" href="structmap__root.html#o9">c_key2type</a>) { +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>); +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>; +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>); +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>++; +00474 } 00475 -00476 if (map->maxnum) { -00477 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00478 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { -00479 <span class="comment">/* ERROR. FIXME */</span> -00480 <span class="keywordflow">return</span>; -00481 } -00482 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; -00483 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>); -00484 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); -00485 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); -00486 } <span class="keywordflow">else</span> { -00487 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; -00488 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); -00489 } -00490 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>); -00491 } <span class="keywordflow">else</span> { -00492 m = (<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *) -00493 <a class="code" href="alloc_8h.html#a4">_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>)); -00494 <span class="comment">/* add node to list */</span> -00495 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>); -00496 } -00497 -00498 <span class="comment">/* copy the key(s) */</span> -00499 map_copy_keys(map, &m-><a class="code" href="structmap__node__int64.html#o0">n</a>); -00500 -00501 <span class="comment">/* set the value */</span> -00502 m-><a class="code" href="structmap__node__int64.html#o1">val</a> = val; -00503 } <span class="keywordflow">else</span> { -00504 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00505 return; -00506 -00507 if (val) { -00508 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>; -00509 <span class="keywordflow">if</span> (add) -00510 m->val += val; -00511 else -00512 m->val = val; -00513 } else if (!add) { -00514 <span class="comment">/* setting value to 0 is the same as deleting */</span> -00515 <a class="code" href="map_8c.html#a5">_stp_map_key_del</a>(map); -00516 } -00517 } -00518 } -00519 <span class="comment"></span> -00520 <span class="comment">/** Set the current element's value to an int64.</span> -00521 <span class="comment"> * This sets the current element's value to an int64. The map must have been created</span> -00522 <span class="comment"> * to hold int64s using _stp_map_new()</span> -00523 <span class="comment"> *</span> -00524 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00525 <span class="comment"> * is set for the map, this function does nothing.</span> -00526 <span class="comment"> * @param map</span> -00527 <span class="comment"> * @param val new value</span> -00528 <span class="comment"> * @sa _stp_map_add_int64</span> -00529 <span class="comment"> */</span> -<a name="l00530"></a><a class="code" href="map_8c.html#a17">00530</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a17">_stp_map_set_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00531 { -00532 __stp_map_set_int64 (map, val, 0); -00533 } -00534 -00535 <span class="comment"></span> -00536 <span class="comment">/** Adds an int64 to the current element's value.</span> -00537 <span class="comment"> * This adds an int64 to the current element's value. The map must have been created</span> -00538 <span class="comment"> * to hold int64s using _stp_map_new()</span> -00539 <span class="comment"> *</span> -00540 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00541 <span class="comment"> * is set for the map, this function does nothing.</span> -00542 <span class="comment"> * @param map</span> -00543 <span class="comment"> * @param val value</span> -00544 <span class="comment"> * @sa _stp_map_set_int64</span> -00545 <span class="comment"> */</span> -00546 -<a name="l00547"></a><a class="code" href="map_8c.html#a18">00547</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a18">_stp_map_add_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00548 { -00549 __stp_map_set_int64 (map, val, 1); -00550 } -00551 <span class="comment"></span> -00552 <span class="comment">/** Gets the current element's value.</span> +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) +00477 { +00478 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *m; +00479 +00480 <span class="keywordflow">if</span> (map == NULL) +00481 return; +00482 +00483 if (map->create) { +00484 <span class="keywordflow">if</span> (val == 0) +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>) { +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); +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; +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>); +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>)); +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>); +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>); +00511 +00512 <span class="comment">/* set the value */</span> +00513 m-><a class="code" href="structmap__node__int64.html#o1">val</a> = 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) +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>; +00520 <span class="keywordflow">if</span> (add) +00521 m->val += val; +00522 else +00523 m->val = val; +00524 } else if (!add) { +00525 <span class="comment">/* setting value to 0 is the same as deleting */</span> +00526 <a class="code" href="group__maps.html#ga4">_stp_map_key_del</a>(map); +00527 } +00528 } +00529 } +00530 <span class="comment"></span> +00531 <span class="comment">/** Set the current element's value to an int64.</span> +00532 <span class="comment"> * This sets the current element's value to an int64. The map must have been created</span> +00533 <span class="comment"> * to hold int64s using _stp_map_new()</span> +00534 <span class="comment"> *</span> +00535 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> +00536 <span class="comment"> * is set for the map, this function does nothing.</span> +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"> * @returns The value. If the current element is not set or doesn't exist, returns 0.</span> -00555 <span class="comment"> */</span> -00556 -<a name="l00557"></a><a class="code" href="map_8c.html#a19">00557</a> int64_t <a class="code" href="map_8c.html#a19">_stp_map_get_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00558 { -00559 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *m; -00560 <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) -00561 <span class="keywordflow">return</span> 0; -00562 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00563 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>; -00564 <span class="keywordflow">return</span> m-><a class="code" href="structmap__node__int64.html#o1">val</a>; -00565 } -00566 <span class="comment"></span> -00567 <span class="comment">/** Set the current element's value to a string.</span> -00568 <span class="comment"> * This sets the current element's value to an string. The map must have been created</span> -00569 <span class="comment"> * to hold int64s using <i>_stp_map_new(xxx, STRING)</i></span> -00570 <span class="comment"> *</span> -00571 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00572 <span class="comment"> * is set for the map, this function does nothing.</span> -00573 <span class="comment"> * @param map</span> -00574 <span class="comment"> * @param val new string</span> -00575 <span class="comment"> */</span> -00576 -<a name="l00577"></a><a class="code" href="map_8c.html#a20">00577</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a20">_stp_map_set_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *val) -00578 { -00579 <span class="keyword">struct </span>map_node_str *m; -00580 -00581 <span class="keywordflow">if</span> (map == NULL) -00582 <span class="keywordflow">return</span>; -00583 -00584 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00585 <span class="keywordflow">if</span> (val == NULL) -00586 <span class="keywordflow">return</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 -00588 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) { -00589 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00590 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { -00591 <span class="comment">/* ERROR. FIXME */</span> -00592 <span class="keywordflow">return</span>; -00593 } -00594 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00595 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>); -00596 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); -00597 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); -00598 } <span class="keywordflow">else</span> { -00599 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o5">pool</a>.next; -00600 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); -00601 } -00602 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>); -00603 } <span class="keywordflow">else</span> { -00604 m = (<span class="keyword">struct </span>map_node_str *) -00605 <a class="code" href="alloc_8h.html#a4">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_str)); -00606 <span class="comment">/* add node to list */</span> -00607 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>); -00608 } -00609 -00610 <span class="comment">/* copy the key(s) */</span> -00611 map_copy_keys(map, &m-><a class="code" href="structmap__node__str.html#o0">n</a>); -00612 -00613 <span class="comment">/* set the value */</span> -00614 m-><a class="code" href="structmap__node__str.html#o1">str</a> = <a class="code" href="alloc_8h.html#a3">_stp_alloc</a>(strlen(val) + 1); -00615 strcpy(m-><a class="code" href="structmap__node__str.html#o1">str</a>, val); -00616 } <span class="keywordflow">else</span> { -00617 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00618 <span class="keywordflow">return</span>; -00619 -00620 <span class="keywordflow">if</span> (val) { -00621 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00622 <span class="keywordflow">if</span> (m-><a class="code" href="structmap__node__str.html#o1">str</a>) -00623 <a class="code" href="alloc_8h.html#a6">_stp_free</a>(m-><a class="code" href="structmap__node__str.html#o1">str</a>); -00624 m-><a class="code" href="structmap__node__str.html#o1">str</a> = <a class="code" href="alloc_8h.html#a3">_stp_alloc</a>(strlen(val) + 1); -00625 strcpy(m-><a class="code" href="structmap__node__str.html#o1">str</a>, val); -00626 } <span class="keywordflow">else</span> { -00627 <span class="comment">/* setting value to 0 is the same as deleting */</span> -00628 <a class="code" href="map_8c.html#a5">_stp_map_key_del</a>(map); -00629 } -00630 } -00631 } -00632 <span class="comment"></span> -00633 <span class="comment">/** Gets the current element's value.</span> -00634 <span class="comment"> * @param map</span> -00635 <span class="comment"> * @returns A string pointer. If the current element is not set or doesn't exist, returns NULL.</span> -00636 <span class="comment"> */</span> -00637 -<a name="l00638"></a><a class="code" href="map_8c.html#a21">00638</a> <span class="keywordtype">char</span> *<a class="code" href="map_8c.html#a21">_stp_map_get_str</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00639 { -00640 <span class="keyword">struct </span>map_node_str *m; -00641 <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) -00642 <span class="keywordflow">return</span> NULL; -00643 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00644 m = (<span class="keyword">struct </span>map_node_str *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00645 <span class="keywordflow">return</span> m-><a class="code" href="structmap__node__str.html#o1">str</a>; -00646 } -00647 <span class="comment"></span> -00648 <span class="comment">/** Set the current element's value to a stat.</span> -00649 <span class="comment"> * This sets the current element's value to an stat struct. The map must have been created</span> -00650 <span class="comment"> * to hold stats using <i>_stp_map_new(xxx, STAT)</i>. This function would only be used</span> -00651 <span class="comment"> * if we wanted to set stats to something other than the normal initial values (count = 0,</span> -00652 <span class="comment"> * sum = 0, etc). It may be deleted if it doesn't turn out to be useful.</span> -00653 <span class="comment"> * @sa _stp_map_stat_add </span> -00654 <span class="comment"> *</span> -00655 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00656 <span class="comment"> * is set for the map, this function does nothing.</span> -00657 <span class="comment"> * @param map</span> -00658 <span class="comment"> * @param stats pointer to stats struct.</span> -00659 <span class="comment"> * @todo Histograms don't work yet.</span> -00660 <span class="comment"> */</span> -00661 -<a name="l00662"></a><a class="code" href="map_8c.html#a22">00662</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a22">_stp_map_set_stat</a>(<a class="code" href="structmap__root.html">MAP</a> map, <a class="code" href="structstat.html">stat</a> * stats) -00663 { -00664 <span class="keyword">struct </span>map_node_stat *m; -00665 -00666 <span class="keywordflow">if</span> (map == NULL) -00667 <span class="keywordflow">return</span>; -00668 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>); -00669 -00670 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00671 <span class="keywordflow">if</span> (stats == NULL) -00672 <span class="keywordflow">return</span>; -00673 -00674 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) { -00675 <span class="keywordflow">if</span> (list_empty(&map-><a class="code" href="structmap__root.html#o5">pool</a>)) { -00676 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o3">no_wrap</a>) { -00677 <span class="comment">/* ERROR. FIXME */</span> -00678 <span class="keywordflow">return</span>; -00679 } -00680 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o4">head</a>.next; -00681 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>); -00682 map_free_strings(map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)m); -00683 dbug (<span class="stringliteral">"got %lx off head\n"</span>, (<span class="keywordtype">long</span>)m); -00684 } <span class="keywordflow">else</span> { -00685 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o5">pool</a>.next; -00686 dbug (<span class="stringliteral">"got %lx off pool\n"</span>, (<span class="keywordtype">long</span>)m); -00687 } -00688 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>); -00689 } <span class="keywordflow">else</span> { -00690 m = (<span class="keyword">struct </span>map_node_stat *) -00691 <a class="code" href="alloc_8h.html#a4">_stp_calloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> map_node_stat)); -00692 <span class="comment">/* add node to list */</span> -00693 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>); -00694 } -00695 -00696 <span class="comment">/* copy the key(s) */</span> -00697 map_copy_keys(map, &m-><a class="code" href="structmap__node__stat.html#o0">n</a>); -00698 -00699 <span class="comment">/* set the value */</span> -00700 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>)); -00701 } <span class="keywordflow">else</span> { -00702 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00703 <span class="keywordflow">return</span>; -00704 -00705 <span class="keywordflow">if</span> (stats) { -00706 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00707 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>)); -00708 } <span class="keywordflow">else</span> { -00709 <span class="comment">/* setting value to NULL is the same as deleting */</span> -00710 <a class="code" href="map_8c.html#a5">_stp_map_key_del</a>(map); -00711 } -00712 } -00713 } -00714 <span class="comment"></span> -00715 <span class="comment">/** Gets the current element's value.</span> -00716 <span class="comment"> * @param map</span> -00717 <span class="comment"> * @returns A pointer to the stats struct. If the current element is not set </span> -00718 <span class="comment"> * or doesn't exist, returns NULL.</span> -00719 <span class="comment"> */</span> -00720 -<a name="l00721"></a><a class="code" href="map_8c.html#a23">00721</a> <a class="code" href="structstat.html">stat</a> *<a class="code" href="map_8c.html#a23">_stp_map_get_stat</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00722 { -00723 <span class="keyword">struct </span>map_node_stat *m; -00724 <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) -00725 <span class="keywordflow">return</span> NULL; -00726 dbug (<span class="stringliteral">"%lx\n"</span>, (<span class="keywordtype">long</span>)map-><a class="code" href="structmap__root.html#o6">key</a>); -00727 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00728 <span class="keywordflow">return</span> &m-><a class="code" href="structmap__node__stat.html#o1">stats</a>; -00729 } -00730 <span class="comment"></span> -00731 <span class="comment">/** Add to the current element's statistics.</span> -00732 <span class="comment"> * Increments the statistics counter by one and the sum by <i>val</i>.</span> -00733 <span class="comment"> * Adjusts minimum, maximum, and histogram.</span> -00734 <span class="comment"> *</span> -00735 <span class="comment"> * If the element doesn't exist, it is created. If no current element (key)</span> -00736 <span class="comment"> * is set for the map, this function does nothing.</span> -00737 <span class="comment"> * @param map</span> -00738 <span class="comment"> * @param val value to add to the statistics</span> -00739 <span class="comment"> * @todo Histograms don't work yet.</span> -00740 <span class="comment"> */</span> -00741 -<a name="l00742"></a><a class="code" href="map_8c.html#a24">00742</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a24">_stp_map_stat_add</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00743 { -00744 <span class="keyword">struct </span>map_node_stat *m; -00745 <span class="keywordflow">if</span> (map == NULL) -00746 <span class="keywordflow">return</span>; -00747 -00748 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o7">create</a>) { -00749 <a class="code" href="structstat.html">stat</a> st = { 1, val, val, val }; -00750 <span class="comment">/* histogram */</span> -00751 <a class="code" href="map_8c.html#a22">_stp_map_set_stat</a>(map, &st); -00752 <span class="keywordflow">return</span>; -00753 } -00754 -00755 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o6">key</a> == NULL) -00756 <span class="keywordflow">return</span>; -00757 -00758 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>); -00759 m = (<span class="keyword">struct </span>map_node_stat *)map-><a class="code" href="structmap__root.html#o6">key</a>; -00760 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o0">count</a>++; -00761 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o1">sum</a> += val; -00762 <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>) -00763 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o3">max</a> = val; -00764 <span class="keywordflow">if</span> (val < m->stats.min) -00765 m-><a class="code" href="structmap__node__stat.html#o1">stats</a>.<a class="code" href="structstat.html#o2">min</a> = val; -00766 <span class="comment">/* histogram */</span> -00767 } +<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 <span class="comment">/********************** List Functions *********************/</span> -00770 <span class="comment"></span> -00771 <span class="comment">/** Create a new list.</span> -00772 <span class="comment"> * A list is a map that internally has an incrementing long key for each member.</span> -00773 <span class="comment"> * Lists do not wrap if elements are added to exceed their maximum size.</span> -00774 <span class="comment"> * @param max_entries The maximum number of entries allowed. Currently that number will</span> -00775 <span class="comment"> * be preallocated. If max_entries is 0, there will be no maximum and entries</span> -00776 <span class="comment"> * will be allocated dynamically.</span> -00777 <span class="comment"> * @param type Type of values stored in this list. </span> -00778 <span class="comment"> * @return A MAP on success or NULL on failure.</span> -00779 <span class="comment"> * @sa foreach</span> -00780 <span class="comment"> */</span> +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 -<a name="l00782"></a><a class="code" href="map_8c.html#a25">00782</a> <a class="code" href="structmap__root.html">MAP</a> <a class="code" href="map_8c.html#a25">_stp_list_new</a>(<span class="keywordtype">unsigned</span> max_entries, <span class="keyword">enum</span> valtype type) -00783 { -00784 <a class="code" href="structmap__root.html">MAP</a> map = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (max_entries, type); -00785 map-><a class="code" href="structmap__root.html#o3">no_wrap</a> = 1; -00786 <span class="keywordflow">return</span> map; -00787 } -00788 <span class="comment"></span> -00789 <span class="comment">/** Clears a list.</span> -00790 <span class="comment"> * All elements in the list are deleted.</span> -00791 <span class="comment"> * @param map </span> -00792 <span class="comment"> */</span> -00793 -<a name="l00794"></a><a class="code" href="map_8c.html#a26">00794</a> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a26">_stp_list_clear</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00795 { -00796 <span class="keywordflow">if</span> (map == NULL) -00797 <span class="keywordflow">return</span>; -00798 -00799 <span class="keywordflow">if</span> (!list_empty(&map-><a class="code" href="structmap__root.html#o4">head</a>)) { -00800 <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; -00801 -00802 <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>) { -00803 <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; -00804 -00805 <span class="comment">/* remove node from old hash list */</span> -00806 hlist_del_init(&ptr-><a class="code" href="structmap__node.html#o1">hnode</a>); -00807 -00808 <span class="comment">/* remove from entry list */</span> -00809 list_del(&ptr-><a class="code" href="structmap__node.html#o0">lnode</a>); -00810 -00811 <span class="comment">/* remove any allocated string storage */</span> -00812 map_free_strings(map, ptr); -00813 -00814 <span class="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o1">maxnum</a>) -00815 list_add(&ptr-><a class="code" href="structmap__node.html#o0">lnode</a>, &map-><a class="code" href="structmap__root.html#o5">pool</a>); -00816 <span class="keywordflow">else</span> -00817 <a class="code" href="alloc_8h.html#a6">_stp_free</a>(ptr); -00818 -00819 map-><a class="code" href="structmap__root.html#o2">num</a>--; -00820 ptr = next; -00821 } -00822 } +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 } +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="keywordflow">if</span> (map-><a class="code" href="structmap__root.html#o2">num</a> != 0) { -00825 <a class="code" href="io_8c.html#a4">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>); -00826 } -00827 } -00828 <span class="comment"></span> -00829 <span class="comment">/** Adds a string to a list.</span> -00830 <span class="comment"> * @param map</span> -00831 <span class="comment"> * @param str</span> -00832 <span class="comment"> */</span> -00833 -<a name="l00834"></a><a class="code" href="map_8c.html#a27">00834</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a27">_stp_list_add_str</a>(<a class="code" href="structmap__root.html">MAP</a> map, <span class="keywordtype">char</span> *str) -00835 { -00836 <a class="code" href="map_8c.html#a14">_stp_map_key_long</a>(map, map-><a class="code" href="structmap__root.html#o2">num</a>); -00837 <a class="code" href="map_8c.html#a20">_stp_map_set_str</a>(map, str); -00838 } -00839 <span class="comment"></span> -00840 <span class="comment">/** Adds an int64 to a list.</span> -00841 <span class="comment"> * @param map</span> -00842 <span class="comment"> * @param val</span> -00843 <span class="comment"> */</span> -00844 -<a name="l00845"></a><a class="code" href="map_8c.html#a28">00845</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="map_8c.html#a28">_stp_list_add_int64</a>(<a class="code" href="structmap__root.html">MAP</a> map, int64_t val) -00846 { -00847 <a class="code" href="map_8c.html#a14">_stp_map_key_long</a>(map, map-><a class="code" href="structmap__root.html#o2">num</a>); -00848 <a class="code" href="map_8c.html#a17">_stp_map_set_int64</a>(map, val); -00849 } -00850 <span class="comment"></span> -00851 <span class="comment">/** Get the number of elements in a list.</span> -00852 <span class="comment"> * @param map</span> -00853 <span class="comment"> * @returns The number of elements in a list.</span> -00854 <span class="comment"> */</span> -00855 -<a name="l00856"></a><a class="code" href="map_8c.html#a29">00856</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="map_8c.html#a29">_stp_list_size</a>(<a class="code" href="structmap__root.html">MAP</a> map) -00857 { -00858 <span class="keywordflow">return</span> map-><a class="code" href="structmap__root.html#o2">num</a>; -00859 } -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +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> +</pre></div></body></html> diff --git a/runtime/docs/html/map_8c.html b/runtime/docs/html/map_8c.html index 6865ae63..f9bb262d 100644 --- a/runtime/docs/html/map_8c.html +++ b/runtime/docs/html/map_8c.html @@ -4,1301 +4,92 @@ <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> +<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 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> <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="anchor" name="a1" doxytag="map.c::string_hash"></a> -static unsigned </td><td class="memItemRight" valign="bottom"><b>string_hash</b> (const char *key1, const char *key2)</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="anchor" name="a2" doxytag="map.c::mixed_hash"></a> -static unsigned </td><td class="memItemRight" valign="bottom"><b>mixed_hash</b> (const char *key1, long key2)</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"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a3">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="map_8h.html#a19">valtype</a> type)</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="mdescLeft"> </td><td class="mdescRight">Create a new map. <a href="#a3"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4" doxytag="map.c::map_free_strings"></a> -static void </td><td class="memItemRight" valign="bottom"><b>map_free_strings</b> (<a class="el" href="structmap__root.html">MAP</a> map, struct <a class="el" href="structmap__node.html">map_node</a> *n)</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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a5">_stp_map_key_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</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="mdescLeft"> </td><td class="mdescRight">Deletes the current element. <a href="#a5"></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="map_8c.html#a6">_stp_map_start</a> (<a class="el" href="structmap__root.html">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="mdescLeft"> </td><td class="mdescRight">Get the first element in a map. <a href="#a6"></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="map_8c.html#a7">_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="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="mdescLeft"> </td><td class="mdescRight">Get the next element in a map. <a href="#a7"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a8">_stp_map_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</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="mdescLeft"> </td><td class="mdescRight">Deletes a map. <a href="#a8"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a9">_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="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="mdescLeft"> </td><td class="mdescRight">Set the map's key to two longs. <a href="#a9"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a10">_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="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="mdescLeft"> </td><td class="mdescRight">Set the map's key to two strings. <a href="#a10"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a11">_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="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="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string and a long. <a href="#a11"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a12">_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="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="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long and a string. <a href="#a12"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a13">_stp_map_key_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key)</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="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string. <a href="#a13"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a14">_stp_map_key_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key)</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="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long. <a href="#a14"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a15" doxytag="map.c::map_copy_keys"></a> -static void </td><td class="memItemRight" valign="bottom"><b>map_copy_keys</b> (<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="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"><a class="anchor" name="a16" doxytag="map.c::__stp_map_set_int64"></a> -static void </td><td class="memItemRight" valign="bottom"><b>__stp_map_set_int64</b> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val, int add)</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="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a17">_stp_map_set_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">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 an int64. <a href="#a17"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a18">_stp_map_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">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">Adds an int64 to the current element's value. <a href="#a18"></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="map_8c.html#a19">_stp_map_get_int64</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#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">Gets the current element's value. <a href="#a19"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a20">_stp_map_set_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *val)</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">Set the current element's value to a string. <a href="#a20"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a21">_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">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="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#a21"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a22">_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">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="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="#a22"></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="map_8c.html#a23">_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">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">Gets the current element's value. <a href="#a23"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a24">_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">Add to the current element's statistics. <a href="#a24"></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="map_8c.html#a25">_stp_list_new</a> (unsigned max_entries, enum <a class="el" href="map_8h.html#a19">valtype</a> type)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new list. <a href="#a25"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a26">_stp_list_clear</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Clears a list. <a href="#a26"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a27">_stp_list_add_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *str)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a string to a list. <a href="#a27"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a28">_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 an int64 to a list. <a href="#a28"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8c.html#a29">_stp_list_size</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of elements in a list. <a href="#a29"></a><br></td></tr> -<tr><td colspan="2"><br><h2>Variables</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><b>map_sizes</b> []</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">Get the number of elements in a list. <a href="group__lists.html#ga4"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Implements maps (associative arrays) and lists. <p> <p> -Definition in file <a class="el" href="map_8c-source.html">map.c</a>.<hr><h2>Function Documentation</h2> -<a class="anchor" name="a28" doxytag="map.c::_stp_list_add_int64"></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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>int64_t </td> - <td class="mdname" nowrap> <em>val</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 an int64 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>val</em> </td><td></td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00845">845</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00419">_stp_map_key_long()</a>, <a class="el" href="map_8c-source.html#l00530">_stp_map_set_int64()</a>, and <a class="el" href="map_8h-source.html#l00069">map_root::num</a>. </td> - </tr> -</table> -<a class="anchor" name="a27" doxytag="map.c::_stp_list_add_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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </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></td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00834">834</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00419">_stp_map_key_long()</a>, <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>, and <a class="el" href="map_8h-source.html#l00069">map_root::num</a>. -<p> -Referenced by <a class="el" href="copy_8c-source.html#l00119">_stp_copy_argv_from_user()</a>. </td> - </tr> -</table> -<a class="anchor" name="a26" doxytag="map.c::_stp_list_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">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="mdname1" valign="top" nowrap> <em>map</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> -Clears a list. -<p> -All elements in the list are deleted. <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> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00794">794</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00063">_stp_free()</a>, <a class="el" href="io_8c-source.html#l00016">dlog()</a>, <a class="el" href="map_8h-source.html#l00075">map_root::head</a>, <a class="el" href="map_8h-source.html#l00033">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00066">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00069">map_root::num</a>, and <a class="el" href="map_8h-source.html#l00079">map_root::pool</a>. </td> - </tr> -</table> -<a class="anchor" name="a25" doxytag="map.c::_stp_list_new"></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="structmap__root.html">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> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>enum <a class="el" href="map_8h.html#a19">valtype</a> </td> - <td class="mdname" nowrap> <em>type</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> -Create a new list. -<p> -A list is a map that internally has an incrementing long key for each member. Lists do not wrap if elements are added to exceed their maximum size. <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>max_entries</em> </td><td>The maximum number of entries allowed. Currently that number will be preallocated. If max_entries is 0, there will be no maximum and entries will be allocated dynamically. </td></tr> - <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Type of values stored in this list. </td></tr> - </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="map_8h.html#a8">foreach</a> </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00782">782</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00046">_stp_map_new()</a>, and <a class="el" href="map_8h-source.html#l00072">map_root::no_wrap</a>. </td> - </tr> -</table> -<a class="anchor" name="a29" doxytag="map.c::_stp_list_size"></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">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="mdname1" valign="top" nowrap> <em>map</em> </td> - <td class="md" valign="top"> ) </td> - <td class="md" nowrap><code> [inline]</code></td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Get the number of elements in 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> - </table> -</dl> -<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#l00856">856</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00069">map_root::num</a>. </td> - </tr> -</table> -<a class="anchor" name="a18" doxytag="map.c::_stp_map_add_int64"></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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>int64_t </td> - <td class="mdname" nowrap> <em>val</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> -Adds an int64 to the current element's value. -<p> -This adds an int64 to the current element's value. The map must have been created to hold int64s using <a class="el" href="map_8c.html#a3">_stp_map_new()</a><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>value </td></tr> - </table> -</dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="map_8c.html#a17">_stp_map_set_int64</a> </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00547">547</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> - </tr> -</table> -<a class="anchor" name="a8" doxytag="map.c::_stp_map_del"></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_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="mdname1" valign="top" nowrap> <em>map</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> -Deletes a map. -<p> -Deletes a map, freeing all memory in all elements. Normally done only when the module exits. <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> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00194">194</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00073">_stp_vfree()</a>, <a class="el" href="map_8h-source.html#l00075">map_root::head</a>, <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>, and <a class="el" href="map_8h-source.html#l00098">map_root::membuf</a>. </td> - </tr> -</table> -<a class="anchor" name="a19" doxytag="map.c::_stp_map_get_int64"></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">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="mdname1" valign="top" nowrap> <em>map</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> -Gets the current element's value. -<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> - </table> -</dl> -<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#l00557">557</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00043">map_node_int64::val</a>. </td> - </tr> -</table> -<a class="anchor" name="a23" 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" valign="top">( </td> - <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> - <td class="mdname1" valign="top" nowrap> <em>map</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> -Gets the current element's value. -<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> - </table> -</dl> -<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#l00721">721</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_stat::stats</a>. </td> - </tr> -</table> -<a class="anchor" name="a21" doxytag="map.c::_stp_map_get_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">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="mdname1" valign="top" nowrap> <em>map</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> -Gets the current element's value. -<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> - </table> -</dl> -<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#l00638">638</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00049">map_node_str::str</a>. </td> - </tr> -</table> -<a class="anchor" name="a7" doxytag="map.c::_stp_map_iter"></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 <a class="el" href="structmap__node.html">map_node</a>* _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="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="mdname" nowrap> <em>m</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> -Get the next element in a map. -<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>m</em> </td><td>a pointer to the current element, returned from <a class="el" href="map_8c.html#a6">_stp_map_start()</a> or <a class="el" href="map_8c.html#a7">_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="map_8c.html#a6">_stp_map_start()</a>. See the <a class="el" href="map_8h.html#a8">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="map_8h.html#a8">foreach</a> </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00175">175</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::head</a>, and <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>. </td> - </tr> -</table> -<a class="anchor" name="a5" doxytag="map.c::_stp_map_key_del"></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_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="mdname1" valign="top" nowrap> <em>map</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> -Deletes the current element. -<p> -If no current element (key) for this map is set, 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> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00107">107</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00063">_stp_free()</a>, <a class="el" href="map_8h-source.html#l00033">map_node::hnode</a>, and <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00662">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a14" doxytag="map.c::_stp_map_key_long"></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_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="mdname" nowrap> <em>map</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>key</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 map's key to a long. -<p> -This sets the current element based on a long key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00419">419</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00222">_stp_map_key_long_long()</a>, and <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00845">_stp_list_add_int64()</a>, and <a class="el" href="map_8c-source.html#l00834">_stp_list_add_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a9" doxytag="map.c::_stp_map_key_long_long"></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_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="mdname" nowrap> <em>map</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>key1</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>key2</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 map's key to two longs. -<p> -This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> - <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00222">222</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00091">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00088">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00092">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00090">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00095">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00034">map_node::key1</a>, and <a class="el" href="map_8h-source.html#l00018">key_data::val</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00419">_stp_map_key_long()</a>. </td> - </tr> -</table> -<a class="anchor" name="a12" doxytag="map.c::_stp_map_key_long_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_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="mdname" nowrap> <em>map</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>key1</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>key2</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 map's key to a long and a string. -<p> -This sets the current element based on a key of a long and a string. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> - <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00362">362</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00091">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00088">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00092">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00090">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00095">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00034">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00035">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00019">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00018">key_data::val</a>. </td> - </tr> -</table> -<a class="anchor" name="a13" doxytag="map.c::_stp_map_key_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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>key</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 map's key to a string. -<p> -This sets the current element based on a string key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00403">403</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00265">_stp_map_key_str_str()</a>, and <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>. </td> - </tr> -</table> -<a class="anchor" name="a11" doxytag="map.c::_stp_map_key_str_long"></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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>key1</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>key2</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 map's key to a string and a long. -<p> -This sets the current element based on a key of a string and a long. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> - <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00314">314</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00091">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00088">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00092">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00090">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00095">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00034">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00035">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00019">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00018">key_data::val</a>. </td> - </tr> -</table> -<a class="anchor" name="a10" doxytag="map.c::_stp_map_key_str_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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>key1</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>key2</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 map's key to two strings. -<p> -This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> 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>map</em> </td><td></td></tr> - <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> - <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> - </table> -</dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00265">265</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8h-source.html#l00091">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00088">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00092">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00089">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00090">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00095">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00034">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00035">map_node::key2</a>, and <a class="el" href="map_8h-source.html#l00019">key_data::str</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00403">_stp_map_key_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a3" doxytag="map.c::_stp_map_new"></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="structmap__root.html">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> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>enum <a class="el" href="map_8h.html#a19">valtype</a> </td> - <td class="mdname" nowrap> <em>type</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> -Create a new map. -<p> -Maps must be created at module initialization time. <dl compact><dt><b>Parameters:</b></dt><dd> - <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em>max_entries</em> </td><td>The maximum number of entries allowed. Currently that number will be preallocated. If more entries are required, the oldest ones will be deleted. This makes it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries will be allocated dynamically. </td></tr> - <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Type of values stored in this map. </td></tr> - </table> -</dl> -<dl compact><dt><b>Returns:</b></dt><dd>A MAP on success or NULL on failure. </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00046">46</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00049">_stp_valloc()</a>, <a class="el" href="map_8h-source.html#l00075">map_root::head</a>, <a class="el" href="map_8h-source.html#l00066">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00098">map_root::membuf</a>, <a class="el" href="map_8h-source.html#l00079">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00063">map_root::type</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00782">_stp_list_new()</a>. </td> - </tr> -</table> -<a class="anchor" name="a17" doxytag="map.c::_stp_map_set_int64"></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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>int64_t </td> - <td class="mdname" nowrap> <em>val</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 an int64. -<p> -This sets the current element's value to an int64. The map must have been created to hold int64s using <a class="el" href="map_8c.html#a3">_stp_map_new()</a><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 value </td></tr> - </table> -</dl> -<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="map_8c.html#a18">_stp_map_add_int64</a> </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00530">530</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#l00845">_stp_list_add_int64()</a>. </td> - </tr> -</table> -<a class="anchor" name="a22" doxytag="map.c::_stp_map_set_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">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="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="mdname" nowrap> <em>stats</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 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="map_8c.html#a24">_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#_todo000003">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00662">662</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00034">_stp_calloc()</a>, <a class="el" href="map_8c-source.html#l00107">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00075">map_root::head</a>, <a class="el" href="map_8h-source.html#l00033">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00066">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00054">map_node_stat::n</a>, <a class="el" href="map_8h-source.html#l00072">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00079">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_stat::stats</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00742">_stp_map_stat_add()</a>. </td> - </tr> -</table> -<a class="anchor" name="a20" doxytag="map.c::_stp_map_set_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_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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>char * </td> - <td class="mdname" nowrap> <em>val</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 a 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> -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> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00577">577</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="alloc_8h-source.html#l00018">_stp_alloc()</a>, <a class="el" href="alloc_8h-source.html#l00034">_stp_calloc()</a>, <a class="el" href="alloc_8h-source.html#l00063">_stp_free()</a>, <a class="el" href="map_8c-source.html#l00107">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00075">map_root::head</a>, <a class="el" href="map_8h-source.html#l00033">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00031">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00066">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00048">map_node_str::n</a>, <a class="el" href="map_8h-source.html#l00072">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00079">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00049">map_node_str::str</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00834">_stp_list_add_str()</a>. </td> - </tr> -</table> -<a class="anchor" name="a6" doxytag="map.c::_stp_map_start"></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 <a class="el" href="structmap__node.html">map_node</a>* _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="mdname1" valign="top" nowrap> <em>map</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 the first element in a map. -<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> - </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="map_8c.html#a7">_stp_map_iter()</a>. See the <a class="el" href="map_8h.html#a8">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="map_8h.html#a8">foreach</a> </dd></dl> - -<p> -Definition at line <a class="el" href="map_8c-source.html#l00152">152</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::head</a>. </td> - </tr> -</table> -<a class="anchor" name="a24" doxytag="map.c::_stp_map_stat_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">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="mdname" nowrap> <em>map</em>, </td> - </tr> - <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>int64_t </td> - <td class="mdname" nowrap> <em>val</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> -Add to the current element's statistics. -<p> -Increments the statistics counter by one and the sum by <em>val</em>. Adjusts minimum, maximum, and histogram.<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>value to add to the statistics </td></tr> - </table> -</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#l00742">742</a> of file <a class="el" href="map_8c-source.html">map.c</a>. -<p> -References <a class="el" href="map_8c-source.html#l00662">_stp_map_set_stat()</a>, <a class="el" href="map_8h-source.html#l00010">stat::count</a>, <a class="el" href="map_8h-source.html#l00087">map_root::create</a>, <a class="el" href="map_8h-source.html#l00082">map_root::key</a>, <a class="el" href="map_8h-source.html#l00012">stat::max</a>, <a class="el" href="map_8h-source.html#l00012">stat::min</a>, <a class="el" href="map_8h-source.html#l00055">map_node_stat::stats</a>, and <a class="el" href="map_8h-source.html#l00011">stat::sum</a>. </td> - </tr> -</table> -<hr><h2>Variable Documentation</h2> -<a class="anchor" name="a0" doxytag="map.c::map_sizes"></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">int map_sizes[]<code> [static]</code> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -<b>Initial value:</b><div class="fragment"><pre class="fragment"> { - <span class="keyword">sizeof</span>(<span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a>), - sizeof(struct map_node_stat), - sizeof(struct map_node_str), - 0 -} -</pre></div> -<p> -Definition at line <a class="el" href="map_8c-source.html#l00006">6</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> - </tr> -</table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +Definition in file <a class="el" href="map_8c-source.html">map.c</a>.</body></html> diff --git a/runtime/docs/html/map_8h-source.html b/runtime/docs/html/map_8h-source.html index 26b210d2..94c29074 100644 --- a/runtime/docs/html/map_8h-source.html +++ b/runtime/docs/html/map_8h-source.html @@ -4,186 +4,194 @@ <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>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="comment">/* -*- linux-c -*- */</span><span class="comment"></span> -00002 <span class="comment">/** @file map.h</span> -00003 <span class="comment"> * @brief Header file for maps and lists</span> -00004 <span class="comment"> */</span> -00005 -00006 <span class="preprocessor">#include <linux/types.h></span> -00007 <span class="comment"></span> -00008 <span class="comment">/** Statistics are stored in this struct */</span> -<a name="l00009"></a><a class="code" href="structstat.html">00009</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -00010 int64_t count; -00011 int64_t sum; -00012 int64_t min, max; -00013 int64_t histogram[BUCKETS]; -00014 } <a class="code" href="structstat.html">stat</a>; -00015 <span class="comment"></span> -00016 <span class="comment">/** Keys are either longs or char * */</span> -<a name="l00017"></a><a class="code" href="unionkey__data.html">00017</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> { -00018 <span class="keywordtype">long</span> val; -00019 <span class="keywordtype">char</span> *str; -00020 }; +<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> +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>{ +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 can be longs or strings */</span> -<a name="l00023"></a><a class="code" href="map_8h.html#a18">00023</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> { NONE, LONG, STR } __attribute__ ((packed));<span class="comment"></span> -00024 <span class="comment">/** values can be either int64, stats or strings */</span> -<a name="l00025"></a><a class="code" href="map_8h.html#a19">00025</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a19">valtype</a> { INT64, STAT, STRING, END }; -00026 +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> { +00024 <span class="keywordtype">long</span> val; +00025 <span class="keywordtype">char</span> *str; +00026 }; 00027 <span class="comment"></span> -00028 <span class="comment">/** basic map element */</span> -<a name="l00029"></a><a class="code" href="structmap__node.html">00029</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> {<span class="comment"></span> -00030 <span class="comment"> /** list of other nodes in the map */</span> -<a name="l00031"></a><a class="code" href="structmap__node.html#o0">00031</a> <span class="keyword">struct </span>list_head lnode;<span class="comment"></span> -00032 <span class="comment"> /** list of nodes with the same hash value */</span> -<a name="l00033"></a><a class="code" href="structmap__node.html#o1">00033</a> <span class="keyword">struct </span>hlist_node hnode; -00034 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key1; -00035 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key2; -00036 <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> key1type; -00037 <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> key2type; -00038 }; -00039 <span class="comment"></span> -00040 <span class="comment">/** map element containing int64 */</span> -<a name="l00041"></a><a class="code" href="structmap__node__int64.html">00041</a> <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> { -00042 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; -00043 int64_t val; +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> +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 }; +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; 00044 }; 00045 <span class="comment"></span> -00046 <span class="comment">/** map element containing string */</span> -<a name="l00047"></a><a class="code" href="structmap__node__str.html">00047</a> <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> { +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; -00049 <span class="keywordtype">char</span> *str; +00049 int64_t val; 00050 }; 00051 <span class="comment"></span> -00052 <span class="comment">/** map element containing stats */</span> -<a name="l00053"></a><a class="code" href="structmap__node__stat.html">00053</a> <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> { +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; -00055 <a class="code" href="structstat.html">stat</a> stats; +00055 <span class="keywordtype">char</span> *str; 00056 }; 00057 <span class="comment"></span> -00058 <span class="comment">/** This structure contains all information about a map.</span> -00059 <span class="comment"> * It is allocated once when _stp_map_new() is called. </span> -00060 <span class="comment"> */</span> -<a name="l00061"></a><a class="code" href="structmap__root.html">00061</a> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> {<span class="comment"></span> -00062 <span class="comment"> /** type of the values stored in the array */</span> -<a name="l00063"></a><a class="code" href="structmap__root.html#o0">00063</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a19">valtype</a> <a class="code" href="structmap__root.html#o0">type</a>; -00064 <span class="comment"></span> -00065 <span class="comment"> /** maximum number of elements allowed in the array. */</span> -<a name="l00066"></a><a class="code" href="structmap__root.html#o1">00066</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o1">maxnum</a>; -00067 <span class="comment"></span> -00068 <span class="comment"> /** current number of used elements */</span> -<a name="l00069"></a><a class="code" href="structmap__root.html#o2">00069</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o2">num</a>; -00070 <span class="comment"></span> -00071 <span class="comment"> /** when more than maxnum elements, wrap or discard? */</span> -<a name="l00072"></a><a class="code" href="structmap__root.html#o3">00072</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o3">no_wrap</a>; +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; +00062 }; +00063 <span class="comment"></span> +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"> /** linked list of current entries */</span> -<a name="l00075"></a><a class="code" href="structmap__root.html#o4">00075</a> <span class="keyword">struct </span>list_head head; +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"> /** pool of unused entries. Used only when entries are statically allocated</span> -00078 <span class="comment"> at startup. */</span> -<a name="l00079"></a><a class="code" href="structmap__root.html#o5">00079</a> <span class="keyword">struct </span>list_head pool; -00080 <span class="comment"></span> -00081 <span class="comment"> /** saved key entry for lookups */</span> -<a name="l00082"></a><a class="code" href="structmap__root.html#o6">00082</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>; -00083 <span class="comment"></span> -00084 <span class="comment"> /** this is the creation data saved between the key functions and the</span> -00085 <span class="comment"> set/get functions </span> -00086 <span class="comment"> @todo Needs to be per-cpu data for SMP support */</span> -<a name="l00087"></a><a class="code" href="structmap__root.html#o7">00087</a> u_int8_t <a class="code" href="structmap__root.html#o7">create</a>; -00088 <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> c_key1type; -00089 <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> c_key2type; -00090 <span class="keyword">struct </span>hlist_head *c_keyhead; -00091 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key1; -00092 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key2; -00093 <span class="comment"></span> -00094 <span class="comment"> /** the hash table for this array */</span> -<a name="l00095"></a><a class="code" href="structmap__root.html#o13">00095</a> <span class="keyword">struct </span>hlist_head hashes[HASH_TABLE_SIZE]; -00096 <span class="comment"></span> -00097 <span class="comment"> /** pointer to allocated memory space. Used for freeing memory. */</span> -<a name="l00098"></a><a class="code" href="structmap__root.html#o14">00098</a> <span class="keywordtype">void</span> *<a class="code" href="structmap__root.html#o14">membuf</a>; -00099 }; -00100 <span class="comment"></span> -00101 <span class="comment">/** All maps are of this type. */</span> -<a name="l00102"></a><a class="code" href="map_8h.html#a10">00102</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>; -00103 <span class="comment"></span> -00104 <span class="comment">/** Extracts string from key1 union */</span> -<a name="l00105"></a><a class="code" href="map_8h.html#a0">00105</a> <span class="preprocessor">#define key1str(ptr) (ptr->n.key1.str)</span> -00106 <span class="preprocessor"></span><span class="comment">/** Extracts string from key2 union */</span> -<a name="l00107"></a><a class="code" href="map_8h.html#a1">00107</a> <span class="preprocessor">#define key2str(ptr) (ptr->n.key2.str)</span> -00108 <span class="preprocessor"></span><span class="comment">/** Extracts int from key1 union */</span> -<a name="l00109"></a><a class="code" href="map_8h.html#a2">00109</a> <span class="preprocessor">#define key1int(ptr) (ptr->n.key1.val)</span> -00110 <span class="preprocessor"></span><span class="comment">/** Extracts int from key2 union */</span> -<a name="l00111"></a><a class="code" href="map_8h.html#a3">00111</a> <span class="preprocessor">#define key2int(ptr) (ptr->n.key2.val)</span> -00112 <span class="preprocessor"></span><span class="comment"></span> -00113 <span class="comment">/** Macro to call the proper _stp_map_key functions based on the</span> -00114 <span class="comment"> * types of the arguments. </span> -00115 <span class="comment"> * @note May cause compiler warning on some GCCs </span> -00116 <span class="comment"> */</span> -<a name="l00117"></a><a class="code" href="map_8h.html#a4">00117</a> <span class="preprocessor">#define _stp_map_key2(map, key1, key2) \</span> -00118 <span class="preprocessor"> ({ \</span> -00119 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key1), char[])) \</span> -00120 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> -00121 <span class="preprocessor"> _stp_map_key_str_str (map, (char *)(key1), (char *)(key2)); \</span> -00122 <span class="preprocessor"> else \</span> -00123 <span class="preprocessor"> _stp_map_key_str_long (map, (char *)(key1), (long)(key2)); \</span> -00124 <span class="preprocessor"> else \</span> -00125 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> -00126 <span class="preprocessor"> _stp_map_key_long_str (map, (long)(key1), (char *)(key2)); \</span> -00127 <span class="preprocessor"> else \</span> -00128 <span class="preprocessor"> _stp_map_key_long_long (map, (long)(key1), (long)(key2)); \</span> -00129 <span class="preprocessor"> })</span> -00130 <span class="preprocessor"></span><span class="comment"></span> -00131 <span class="comment">/** Macro to call the proper _stp_map_key function based on the</span> -00132 <span class="comment"> * type of the argument. </span> -00133 <span class="comment"> * @note May cause compiler warning on some GCCs </span> -00134 <span class="comment"> */</span> -<a name="l00135"></a><a class="code" href="map_8h.html#a5">00135</a> <span class="preprocessor">#define _stp_map_key(map, key) \</span> -00136 <span class="preprocessor"> ({ \</span> -00137 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key), char[])) \</span> -00138 <span class="preprocessor"> _stp_map_key_str (map, (char *)(key)); \</span> -00139 <span class="preprocessor"> else \</span> -00140 <span class="preprocessor"> _stp_map_key_long (map, (long)(key)); \</span> -00141 <span class="preprocessor"> })</span> -00142 <span class="preprocessor"></span><span class="comment"></span> -00143 <span class="comment">/** Macro to call the proper _stp_map_set function based on the</span> -00144 <span class="comment"> * type of the argument. </span> -00145 <span class="comment"> * @note May cause compiler warning on some GCCs </span> -00146 <span class="comment"> */</span> -<a name="l00147"></a><a class="code" href="map_8h.html#a6">00147</a> <span class="preprocessor">#define _stp_map_set(map, val) \</span> -00148 <span class="preprocessor"> ({ \</span> -00149 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> -00150 <span class="preprocessor"> _stp_map_set_str (map, (char *)(val)); \</span> -00151 <span class="preprocessor"> else \</span> -00152 <span class="preprocessor"> _stp_map_set_int64 (map, (int64_t)(val)); \</span> -00153 <span class="preprocessor"> })</span> -00154 <span class="preprocessor"></span><span class="comment"></span> -00155 <span class="comment">/** Macro to call the proper _stp_list_add function based on the</span> -00156 <span class="comment"> * types of the argument. </span> -00157 <span class="comment"> * @note May cause compiler warning on some GCCs </span> -00158 <span class="comment"> */</span> -<a name="l00159"></a><a class="code" href="map_8h.html#a7">00159</a> <span class="preprocessor">#define _stp_list_add(map, val) \</span> -00160 <span class="preprocessor"> ({ \</span> -00161 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> -00162 <span class="preprocessor"> _stp_list_add_str (map, (char *)(val)); \</span> -00163 <span class="preprocessor"> else \</span> -00164 <span class="preprocessor"> _stp_list_add_int64 (map, (int64_t)(val)); \</span> -00165 <span class="preprocessor"> })</span> -00166 <span class="preprocessor"></span> -00167 <span class="comment"></span> -00168 <span class="comment">/** Loop through all elements of a map.</span> -00169 <span class="comment"> * @param map </span> -00170 <span class="comment"> * @param ptr pointer to a map_node_stat, map_node_int64 or map_node_str</span> -00171 <span class="comment"> *</span> -00172 <span class="comment"> * @b Example:</span> -00173 <span class="comment"> * @include foreach.c</span> -00174 <span class="comment"> */</span> -00175 -<a name="l00176"></a><a class="code" href="map_8h.html#a8">00176</a> <span class="preprocessor">#define foreach(map, ptr) \</span> -00177 <span class="preprocessor"> for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \</span> -00178 <span class="preprocessor"> ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))</span> -00179 <span class="preprocessor"></span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +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> +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>; +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; +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; +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]; +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>; +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>; +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> +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> +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> +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> +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> +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> +00127 <span class="preprocessor"> _stp_map_key_str_str (map, (char *)(key1), (char *)(key2)); \</span> +00128 <span class="preprocessor"> else \</span> +00129 <span class="preprocessor"> _stp_map_key_str_long (map, (char *)(key1), (long)(key2)); \</span> +00130 <span class="preprocessor"> else \</span> +00131 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> +00132 <span class="preprocessor"> _stp_map_key_long_str (map, (long)(key1), (char *)(key2)); \</span> +00133 <span class="preprocessor"> else \</span> +00134 <span class="preprocessor"> _stp_map_key_long_long (map, (long)(key1), (long)(key2)); \</span> +00135 <span class="preprocessor"> })</span> +00136 <span class="preprocessor"></span><span class="comment"></span> +00137 <span class="comment">/** Macro to call the proper _stp_map_key function based on the</span> +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> +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> +00145 <span class="preprocessor"> else \</span> +00146 <span class="preprocessor"> _stp_map_key_long (map, (long)(key)); \</span> +00147 <span class="preprocessor"> })</span> +00148 <span class="preprocessor"></span><span class="comment"></span> +00149 <span class="comment">/** Macro to call the proper _stp_map_set function based on the</span> +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> +00154 <span class="preprocessor"> ({ \</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> +</pre></div></body></html> diff --git a/runtime/docs/html/map_8h.html b/runtime/docs/html/map_8h.html index 849dfff4..8bede3a0 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="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="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 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="a0" doxytag="map.h::key1str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a0">key1str</a>(ptr) (ptr->n.key1.str)</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="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="a1" doxytag="map.h::key2str"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a1">key2str</a>(ptr) (ptr->n.key2.str)</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="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="a2" doxytag="map.h::key1int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a2">key1int</a>(ptr) (ptr->n.key1.val)</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="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="a3" doxytag="map.h::key2int"></a> -#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a3">key2int</a>(ptr) (ptr->n.key2.val)</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="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="map_8h.html#a4">_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#ga28">_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="#a4"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a5">_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#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 function based on the type of the argument. <a href="#a5"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a6">_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#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_set function based on the type of the argument. <a href="#a6"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a7">_stp_list_add</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_list_add function based on the types of the argument. <a href="#a7"></a><br></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a8">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. <a href="#a8"></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#ga5"></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="a10" 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="map_8h.html#a10">MAP</a></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> <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="map_8h.html#a18">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#ga32">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="map_8h.html#a19">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#ga33">valtype</a> { <b>INT64</b>, <b>STAT</b>, <b>STRING</b>, <b>END</b> @@ -64,8 +64,8 @@ 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="a9" doxytag="map.h::packed"></a> -enum <a class="el" href="map_8h.html#a18">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="map_8h.html#a9">packed</a></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> <tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> </table> @@ -74,236 +74,4 @@ Header file for maps and lists. <p> <p> -Definition in file <a class="el" href="map_8h-source.html">map.h</a>.<hr><h2>Define Documentation</h2> -<a class="anchor" name="a7" 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="map_8c.html#a27">_stp_list_add_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="map_8c.html#a28">_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#l00159">159</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -<a class="anchor" name="a5" doxytag="map.h::_stp_map_key"></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_map_key </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>key </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 (key), <span class="keywordtype">char</span>[])) \ - <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (map, (<span class="keywordtype">char</span> *)(key)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="map_8c.html#a14">_stp_map_key_long</a> (map, (<span class="keywordtype">long</span>)(key)); \ - }) -</pre></div>Macro to call the proper _stp_map_key function based on the type 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#l00135">135</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -<a class="anchor" name="a4" doxytag="map.h::_stp_map_key2"></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_map_key2 </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>key1, <tr> - <td class="md" nowrap align="right"></td> - <td class="md"></td> - <td class="md" nowrap>key2 </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 (key1), <span class="keywordtype">char</span>[])) \ - <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ - <a class="code" href="map_8c.html#a10">_stp_map_key_str_str</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">char</span> *)(key2)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="map_8c.html#a11">_stp_map_key_str_long</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">long</span>)(key2)); \ - <span class="keywordflow">else</span> \ - <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ - <a class="code" href="map_8c.html#a12">_stp_map_key_long_str</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">char</span> *)(key2)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="map_8c.html#a9">_stp_map_key_long_long</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">long</span>)(key2)); \ - }) -</pre></div>Macro to call the proper _stp_map_key functions based on the types of the arguments. -<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#l00117">117</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -<a class="anchor" name="a6" doxytag="map.h::_stp_map_set"></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_map_set </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="map_8c.html#a20">_stp_map_set_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ - <span class="keywordflow">else</span> \ - <a class="code" href="map_8c.html#a17">_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> -<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#l00147">147</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -<a class="anchor" name="a8" doxytag="map.h::foreach"></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 foreach </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>ptr </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">for</span> (ptr = (typeof(ptr))<a class="code" href="map_8c.html#a6">_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)) -</pre></div>Loop through all elements of a map. -<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> - </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; - -<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> -<p> -Definition at line <a class="el" href="map_8h-source.html#l00176">176</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> - </tr> -</table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +Definition in file <a class="el" href="map_8h-source.html">map.h</a>.</body></html> diff --git a/runtime/docs/html/modules.html b/runtime/docs/html/modules.html new file mode 100644 index 00000000..32f1541b --- /dev/null +++ b/runtime/docs/html/modules.html @@ -0,0 +1,19 @@ +<!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: Module Index</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="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> +<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> +<li><a class="el" href="group__current.html">Current State</a> +<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__stack.html">Stack Tracing 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 1357fe26..bca54ad4 100644 --- a/runtime/docs/html/pages.html +++ b/runtime/docs/html/pages.html @@ -4,13 +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="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="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> <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> </ul> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/probes_2README-source.html b/runtime/docs/html/probes_2README-source.html index 9f0d714a..572047bc 100644 --- a/runtime/docs/html/probes_2README-source.html +++ b/runtime/docs/html/probes_2README-source.html @@ -4,13 +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="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="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="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> 00002 <span class="comment">This directory contains working example probes that demonstrate and test</span> 00003 <span class="comment">the runtime library. They are tested on i386 and x86_64.</span> 00004 <span class="comment">*/</span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_2shellsnoop_2README-source.html b/runtime/docs/html/probes_2shellsnoop_2README-source.html index 25dfde60..f629ded8 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="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="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="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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); +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); 00029 @pids[current->pid] = 1; 00030 00031 <span class="comment">/* print out argv, ignoring argv[0] */</span> @@ -74,12 +74,10 @@ 00065 else len = 64; 00066 if (len = dtr_strncpy_from_user(str, buf, len)) { 00067 str[len] = 0; -00068 <a class="code" href="io_8c.html#a4">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tW %s\n"</span>, current->pid, current->parent->pid, current->comm, str); +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); 00069 } 00070 } 00071 } 00072 \endverbatim 00073 */ -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_2tasklet_2README-source.html b/runtime/docs/html/probes_2tasklet_2README-source.html index c42d0a1a..7d09aa4e 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="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="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="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> @@ -17,6 +17,4 @@ 00008 <span class="comment">\endverbatim</span> 00009 <span class="comment"></span> 00010 <span class="comment">*/</span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_2test4_2README-source.html b/runtime/docs/html/probes_2test4_2README-source.html index 17cd7350..69aa4539 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="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="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="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> @@ -31,6 +31,4 @@ 00022 <span class="comment">}</span> 00023 <span class="comment">\endverbatim</span> 00024 <span class="comment">*/</span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_2where__func_2README-source.html b/runtime/docs/html/probes_2where__func_2README-source.html index 7752c02d..6f9699ad 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="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="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="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> @@ -33,6 +33,4 @@ 00024 <span class="comment">\endcode</span> 00025 <span class="comment">-Will Cohen</span> 00026 <span class="comment">*/</span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_8c-source.html b/runtime/docs/html/probes_8c-source.html index 5fe6164c..ab2b831b 100644 --- a/runtime/docs/html/probes_8c-source.html +++ b/runtime/docs/html/probes_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="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="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> @@ -15,7 +15,7 @@ 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> -<a name="l00011"></a><a class="code" href="probes_8c.html#a0">00011</a> <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; +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> @@ -27,7 +27,7 @@ 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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"All jprobes removed\n"</span>); +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> @@ -42,14 +42,14 @@ 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 =<a class="code" href="probes_8c.html#a0">_stp_lookup_name</a>((<span class="keywordtype">char</span> *)probes[i].kp.addr); +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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, +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="io_8c.html#a4">dlog</a>(<span class="stringliteral">"inserting jprobe at %s (%p)\n"</span>, probes[i].kp.addr, addr); +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) @@ -57,7 +57,7 @@ 00050 } 00051 <span class="keywordflow">return</span> 0; 00052 out: -00053 <a class="code" href="io_8c.html#a4">dlog</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); +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 } @@ -72,7 +72,7 @@ 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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"All kprobes removed\n"</span>); +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> @@ -87,14 +87,14 @@ 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 =<a class="code" href="probes_8c.html#a0">_stp_lookup_name</a>((<span class="keywordtype">char</span> *)probes[i].addr); +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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"ERROR: function %s not found!\n"</span>, +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="io_8c.html#a4">dlog</a>(<span class="stringliteral">"inserting kprobe at %s (%p)\n"</span>, probes[i].addr, addr); +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) @@ -102,11 +102,9 @@ 00095 } 00096 <span class="keywordflow">return</span> 0; 00097 out: -00098 <a class="code" href="io_8c.html#a4">dlog</a> (<span class="stringliteral">"probe module initialization failed. Exiting...\n"</span>); +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 -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/probes_8c.html b/runtime/docs/html/probes_8c.html index 8a13bb24..5bdbeb43 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="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="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 File Reference</h1>Functions to assist loading and unloading groups of probes. <a href="#_details">More...</a> <p> @@ -24,10 +24,6 @@ <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">Register a group of kprobes. <a href="#a4"></a><br></td></tr> -<tr><td colspan="2"><br><h2>Variables</h2></td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned long(* </td><td class="memItemRight" valign="bottom"><a class="el" href="probes_8c.html#a0">_stp_lookup_name</a> )(char *name) = (void *)KALLSYMS_LOOKUP_NAME</td></tr> - -<tr><td class="mdescLeft"> </td><td class="mdescRight">Lookup name. <a href="#a0"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Functions to assist loading and unloading groups of probes. @@ -82,7 +78,7 @@ Register a group of jprobes. <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>. <p> -References <a class="el" href="probes_8c-source.html#l00011">_stp_lookup_name</a>, <a class="el" href="probes_8c-source.html#l00018">_stp_unregister_jprobes()</a>, and <a class="el" href="io_8c-source.html#l00016">dlog()</a>. </td> +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> </tr> </table> <a class="anchor" name="a4" doxytag="probes.c::_stp_register_kprobes"></a><p> @@ -132,7 +128,7 @@ Register a group of kprobes. <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>. <p> -References <a class="el" href="probes_8c-source.html#l00011">_stp_lookup_name</a>, <a class="el" href="probes_8c-source.html#l00063">_stp_unregister_kprobes()</a>, and <a class="el" href="io_8c-source.html#l00016">dlog()</a>. </td> +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> </tr> </table> <a class="anchor" name="a1" doxytag="probes.c::_stp_unregister_jprobes"></a><p> @@ -181,7 +177,7 @@ Unregister a group of jprobes. <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>. <p> -References <a class="el" href="io_8c-source.html#l00016">dlog()</a>. +References <a class="el" href="io_8c-source.html#l00025">dlog()</a>. <p> Referenced by <a class="el" href="probes_8c-source.html#l00032">_stp_register_jprobes()</a>. </td> </tr> @@ -232,41 +228,9 @@ Unregister a group of kprobes. <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>. <p> -References <a class="el" href="io_8c-source.html#l00016">dlog()</a>. +References <a class="el" href="io_8c-source.html#l00025">dlog()</a>. <p> Referenced by <a class="el" href="probes_8c-source.html#l00077">_stp_register_kprobes()</a>. </td> </tr> </table> -<hr><h2>Variable Documentation</h2> -<a class="anchor" name="a0" doxytag="probes.c::_stp_lookup_name"></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">unsigned long(* <a class="el" href="probes_8c.html#a0">_stp_lookup_name</a>)(char *name) = (void *)KALLSYMS_LOOKUP_NAME<code> [static]</code> </td> - </tr> - </table> - </td> - </tr> -</table> -<table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td> - - </td> - <td> - -<p> -Lookup name. -<p> -This simply calls the kernel function kallsyms_lookup_name(). That function is not exported, so this workaround is required. See the kernel source, kernel/kallsyms.c for more information. -<p> -Definition at line <a class="el" href="probes_8c-source.html#l00011">11</a> of file <a class="el" href="probes_8c-source.html">probes.c</a>. -<p> -Referenced by <a class="el" href="probes_8c-source.html#l00032">_stp_register_jprobes()</a>, and <a class="el" href="probes_8c-source.html#l00077">_stp_register_kprobes()</a>. </td> - </tr> -</table> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/runtime_8h-source.html b/runtime/docs/html/runtime_8h-source.html index 00feb2d8..a0f00a36 100644 --- a/runtime/docs/html/runtime_8h-source.html +++ b/runtime/docs/html/runtime_8h-source.html @@ -4,28 +4,29 @@ <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>runtime.h</h1><div class="fragment"><pre class="fragment">00001 -00002 <span class="preprocessor">#include <linux/module.h></span> -00003 <span class="preprocessor">#include <linux/kernel.h></span> -00004 <span class="preprocessor">#include <linux/miscdevice.h></span> -00005 <span class="preprocessor">#include <linux/init.h></span> -00006 <span class="preprocessor">#include <linux/hash.h></span> -00007 <span class="preprocessor">#include <linux/string.h></span> -00008 <span class="preprocessor">#include <linux/kprobes.h></span> -00009 <span class="preprocessor">#include <linux/proc_fs.h></span> -00010 <span class="preprocessor">#include <linux/vmalloc.h></span> -00011 <span class="preprocessor">#include <linux/time.h></span> -00012 <span class="preprocessor">#include <linux/spinlock.h></span> -00013 <span class="preprocessor">#include <linux/hardirq.h></span> -00014 <span class="preprocessor">#include <asm/uaccess.h></span> -00015 <span class="preprocessor">#include <linux/kallsyms.h></span> -00016 -00017 <span class="preprocessor">#include "<a class="code" href="alloc_8h.html">alloc.h</a>"</span> -00018 <span class="preprocessor">#include "<a class="code" href="map_8h.html">map.h</a>"</span> -00019 -00020 <span class="preprocessor">#define dbug(args...) ;</span> -00021 <span class="preprocessor"></span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<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>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> +00004 <span class="comment"> * @brief Main include file for runtime functions.</span> +00005 <span class="comment"> */</span> +00006 +00007 <span class="preprocessor">#include <linux/module.h></span> +00008 <span class="preprocessor">#include <linux/kernel.h></span> +00009 <span class="preprocessor">#include <linux/miscdevice.h></span> +00010 <span class="preprocessor">#include <linux/init.h></span> +00011 <span class="preprocessor">#include <linux/hash.h></span> +00012 <span class="preprocessor">#include <linux/string.h></span> +00013 <span class="preprocessor">#include <linux/kprobes.h></span> +00014 <span class="preprocessor">#include <linux/proc_fs.h></span> +00015 <span class="preprocessor">#include <linux/vmalloc.h></span> +00016 <span class="preprocessor">#include <linux/time.h></span> +00017 <span class="preprocessor">#include <linux/spinlock.h></span> +00018 <span class="preprocessor">#include <linux/hardirq.h></span> +00019 <span class="preprocessor">#include <asm/uaccess.h></span> +00020 <span class="preprocessor">#include <linux/kallsyms.h></span> +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> +</pre></div></body></html> diff --git a/runtime/docs/html/runtime_8h.html b/runtime/docs/html/runtime_8h.html index 43b0f402..450661ad 100644 --- a/runtime/docs/html/runtime_8h.html +++ b/runtime/docs/html/runtime_8h.html @@ -1,12 +1,13 @@ <!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: runtime.h File Reference</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>runtime.h File Reference</h1><code>#include <linux/module.h></code><br> +<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>runtime.h File Reference</h1>Main include file for runtime functions. <a href="#_details">More...</a> +<p> +<code>#include <linux/module.h></code><br> <code>#include <linux/kernel.h></code><br> <code>#include <linux/miscdevice.h></code><br> <code>#include <linux/init.h></code><br> @@ -20,51 +21,18 @@ <code>#include <linux/hardirq.h></code><br> <code>#include <asm/uaccess.h></code><br> <code>#include <linux/kallsyms.h></code><br> -<code>#include "<a class="el" href="alloc_8h-source.html">alloc.h</a>"</code><br> -<code>#include "<a class="el" href="map_8h-source.html">map.h</a>"</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"> <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="runtime_8h.html#a0">dbug</a>(args...) ;</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0" doxytag="runtime.h::dbug"></a> +#define </td><td class="memItemRight" valign="bottom"><b>dbug</b>(args...) ;</td></tr> </table> -<hr><h2>Define Documentation</h2> -<a class="anchor" name="a0" doxytag="runtime.h::dbug"></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 dbug </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">args... </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> - +<hr><a name="_details"></a><h2>Detailed Description</h2> +Main include file for runtime functions. <p> <p> -Definition at line <a class="el" href="runtime_8h-source.html#l00020">20</a> of file <a class="el" href="runtime_8h-source.html">runtime.h</a>. -<p> -Referenced by <a class="el" href="map_8c-source.html#l00551">_stp_map_get_int64()</a>, <a class="el" href="map_8c-source.html#l00715">_stp_map_get_stat()</a>, <a class="el" href="map_8c-source.html#l00632">_stp_map_get_str()</a>, <a class="el" href="map_8c-source.html#l00172">_stp_map_iter()</a>, <a class="el" href="map_8c-source.html#l00104">_stp_map_key_del()</a>, <a class="el" href="map_8c-source.html#l00218">_stp_map_key_long_long()</a>, <a class="el" href="map_8c-source.html#l00358">_stp_map_key_long_str()</a>, <a class="el" href="map_8c-source.html#l00310">_stp_map_key_str_long()</a>, <a class="el" href="map_8c-source.html#l00261">_stp_map_key_str_str()</a>, <a class="el" href="map_8c-source.html#l00043">_stp_map_new()</a>, <a class="el" href="map_8c-source.html#l00656">_stp_map_set_stat()</a>, <a class="el" href="map_8c-source.html#l00571">_stp_map_set_str()</a>, <a class="el" href="map_8c-source.html#l00149">_stp_map_start()</a>, and <a class="el" href="map_8c-source.html#l00736">_stp_map_stat_add()</a>. </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> +Definition in file <a class="el" href="runtime_8h-source.html">runtime.h</a>.</body></html> diff --git a/runtime/docs/html/scbuf_8c-source.html b/runtime/docs/html/scbuf_8c-source.html new file mode 100644 index 00000000..a9e9ddc8 --- /dev/null +++ b/runtime/docs/html/scbuf_8c-source.html @@ -0,0 +1,79 @@ +<!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> +00002 <span class="preprocessor"></span><span class="preprocessor">#define _SCBUF_C_</span> +00003 <span class="preprocessor"></span> +00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> +00005 <span class="comment">/** @file scbuf.c</span> +00006 <span class="comment"> * @addtogroup scbuf Scratch Buffer</span> +00007 <span class="comment"> * Scratch Buffer Functions.</span> +00008 <span class="comment"> * The scratch buffer is for collecting output before storing in a map,</span> +00009 <span class="comment"> * printing, etc. This is a per-cpu static buffer. It is necessary because </span> +00010 <span class="comment"> * of the limited stack space available in the kernel.</span> +00011 <span class="comment"> * @{</span> +00012 <span class="comment"> */</span> +00013 <span class="comment"></span> +00014 <span class="comment">/** Maximum size of buffer, not including terminating NULL */</span> +<a name="l00015"></a><a class="code" href="group__scbuf.html#ga6">00015</a> <span class="preprocessor">#define STP_BUF_LEN 8191</span> +00016 <span class="preprocessor"></span><span class="comment"></span> +00017 <span class="comment">/** Scratch buffer for printing, building strings, etc */</span> +<a name="l00018"></a><a class="code" href="group__scbuf.html#ga0">00018</a> <span class="keywordtype">char</span> <a class="code" href="group__scbuf.html#ga0">_stp_scbuf</a>[<a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a>+1]; +00019 <span class="keyword">static</span> <span class="keywordtype">int</span> _stp_scbuf_len = <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a>; +00020 <span class="comment"></span> +00021 <span class="comment">/** Sprint into the scratch buffer.</span> +00022 <span class="comment"> * Like printf, except output goes into #_stp_scbuf,</span> +00023 <span class="comment"> * which will contain the null-terminated output.</span> +00024 <span class="comment"> * Safe because overflowing #_stp_scbuf is not allowed.</span> +00025 <span class="comment"> * Size is limited by length of scratch buffer, STP_BUF_LEN.</span> +00026 <span class="comment"> *</span> +00027 <span class="comment"> * @param fmt A printf-style format string followed by a </span> +00028 <span class="comment"> * variable number of args.</span> +00029 <span class="comment"> * @sa _stp_scbuf_clear</span> +00030 <span class="comment"> */</span> +00031 +<a name="l00032"></a><a class="code" href="group__scbuf.html#ga2">00032</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, ...) +00033 { +00034 <span class="keywordtype">int</span> num; +00035 va_list args; +00036 <span class="keywordtype">char</span> *buf = <a class="code" href="group__scbuf.html#ga0">_stp_scbuf</a> + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len; +00037 va_start(args, fmt); +00038 num = vscnprintf(buf, _stp_scbuf_len, fmt, args); +00039 va_end(args); +00040 <span class="keywordflow">if</span> (num > 0) +00041 _stp_scbuf_len -= num; +00042 } +00043 +00044 <span class="keywordtype">void</span> _stp_sprint_str (<span class="keyword">const</span> <span class="keywordtype">char</span> *str) +00045 { +00046 <span class="keywordtype">char</span> *buf = <a class="code" href="group__scbuf.html#ga0">_stp_scbuf</a> + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len; +00047 <span class="keywordtype">int</span> num = strlen (str); +00048 <span class="keywordflow">if</span> (num > _stp_scbuf_len) +00049 num = _stp_scbuf_len; +00050 strncpy (buf, str, num); +00051 _stp_scbuf_len -= num; +00052 } +00053 <span class="comment"></span> +00054 <span class="comment">/** Clear the scratch buffer.</span> +00055 <span class="comment"> * Output from _stp_sprint() will accumulate in the buffer</span> +00056 <span class="comment"> * until this is called.</span> +00057 <span class="comment"> */</span> +00058 +<a name="l00059"></a><a class="code" href="group__scbuf.html#ga4">00059</a> <span class="keywordtype">void</span> _stp_scbuf_clear (<span class="keywordtype">void</span>) +00060 { +00061 _stp_scbuf_len = <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a>; +00062 <a class="code" href="group__scbuf.html#ga0">_stp_scbuf</a>[0] = 0; +00063 } +00064 +00065 <span class="keyword">static</span> <span class="keywordtype">char</span> *_stp_scbuf_cur (<span class="keywordtype">void</span>) +00066 { +00067 <span class="keywordflow">return</span> <a class="code" href="group__scbuf.html#ga0">_stp_scbuf</a> + <a class="code" href="group__scbuf.html#ga6">STP_BUF_LEN</a> - _stp_scbuf_len; +00068 } +00069 <span class="comment"></span> +00070 <span class="comment">/** @} */</span> +00071 <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 64f58859..7391b8ce 100644 --- a/runtime/docs/html/shellsnoop_2dtr_8c-source.html +++ b/runtime/docs/html/shellsnoop_2dtr_8c-source.html @@ -4,14 +4,14 @@ <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> +<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="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 "runtime.h"</span> +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> @@ -32,14 +32,14 @@ 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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"%d\t%d\t%d\t%s "</span>, current->uid, current->pid, current->parent->pid, filename); +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="map_8c.html#a14">_stp_map_key_long</a> (pids, current->pid); -00029 <a class="code" href="map_8c.html#a17">_stp_map_set_int64</a> (pids, 1); +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="map_8c.html#a26">_stp_list_clear</a> (arglist); -00032 <a class="code" href="copy_8c.html#a2">_stp_copy_argv_from_user</a> (arglist, argv); -00033 <a class="code" href="map_8h.html#a8">foreach</a> (arglist, ptr) +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 } @@ -49,9 +49,9 @@ 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="map_8c.html#a14">_stp_map_key_long</a> (pids, current->pid); +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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tO %s\n"</span>, current->pid, current->parent->pid, current->comm, filename); +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; @@ -59,9 +59,9 @@ 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="map_8c.html#a14">_stp_map_key_long</a> (pids, current->pid); +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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"%d\t%d\t%s\tR %d\n"</span>, current->pid, current->parent->pid, current->comm, fd); +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; @@ -71,7 +71,7 @@ 00062 { 00063 size_t len; 00064 <span class="keywordtype">char</span> str[256]; -00065 <a class="code" href="map_8c.html#a14">_stp_map_key_long</a> (pids, current->pid); +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) @@ -113,26 +113,24 @@ 00104 { 00105 <span class="keywordtype">int</span> ret; 00106 -00107 pids = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (10000, INT64); -00108 arglist = <a class="code" href="map_8c.html#a25">_stp_list_new</a> (10, STRING); +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); 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="io_8c.html#a4">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); +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="map_8c.html#a8">_stp_map_del</a> (pids); -00120 <a class="code" href="io_8c.html#a4">dlog</a>(<span class="stringliteral">"EXIT\n"</span>); +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 } 00122 00123 module_init(init_dtr); 00124 module_exit(cleanup_dtr); 00125 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); 00126 -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/stack_8c-source.html b/runtime/docs/html/stack_8c-source.html index dda3013a..f4df8413 100644 --- a/runtime/docs/html/stack_8c-source.html +++ b/runtime/docs/html/stack_8c-source.html @@ -4,181 +4,166 @@ <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>stack.c</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/* -*- linux-c -*- */</span> -00002 -00003 <span class="preprocessor">#ifdef __x86_64__</span> -00004 <span class="preprocessor"></span><span class="comment">/* ripped out of arch/x86_64/kernel/traps.c */</span> -00005 <span class="preprocessor">#include <linux/kallsyms.h></span> -00006 -00007 <span class="keyword">static</span> <span class="keywordtype">int</span> _stp_printk_address(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> address) -00008 { -00009 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset = 0, symsize; -00010 <span class="keyword">const</span> <span class="keywordtype">char</span> *symname; -00011 <span class="keywordtype">char</span> *modname; -00012 <span class="keywordtype">char</span> *delim = <span class="stringliteral">":"</span>; -00013 <span class="keywordtype">char</span> namebuf[128]; -00014 -00015 symname = <a class="code" href="io_8c.html#a1">_stp_kallsyms_lookup</a>(address, &symsize, &offset, &modname, namebuf); -00016 <span class="keywordflow">if</span> (!symname) -00017 return printk("[<%016lx>]", address); -00018 if (!modname) -00019 modname = delim = ""; -00020 return printk("<%016lx>{%s%s%s%s%+ld}<span class="stringliteral">",</span> -00021 <span class="stringliteral"> address,delim,modname,delim,symname,offset); </span> -00022 <span class="stringliteral">}</span> -00023 <span class="stringliteral"></span> -00024 <span class="stringliteral">void _stp_show_trace(unsigned long *stack)</span> -00025 <span class="stringliteral">{</span> -00026 <span class="stringliteral"> unsigned long addr;</span> -00027 <span class="stringliteral"> unsigned long *irqstack, *irqstack_end, *estack_end;</span> -00028 <span class="stringliteral"> const int cpu = safe_smp_processor_id();</span> -00029 <span class="stringliteral"> int i;</span> -00030 <span class="stringliteral"></span> -00031 <span class="stringliteral"> printk("</span>\nCall Trace:<span class="stringliteral">");</span> -00032 <span class="stringliteral"> i = 0; </span> -00033 <span class="stringliteral"> </span> -00034 <span class="stringliteral"> estack_end = in_exception_stack(cpu, (unsigned long)stack); </span> -00035 <span class="stringliteral"> if (estack_end) { </span> -00036 <span class="stringliteral"> while (stack < estack_end) { </span> -00037 <span class="stringliteral"> addr = *stack++; </span> -00038 <span class="stringliteral"> if (__kernel_text_address(addr)) {</span> -00039 <span class="stringliteral"> i += printk_address(addr);</span> -00040 <span class="stringliteral"> i += printk("</span> <span class="stringliteral">"); </span> -00041 <span class="stringliteral"> if (i > 50) {</span> -00042 <span class="stringliteral"> printk("</span>\n<span class="stringliteral">"); </span> -00043 <span class="stringliteral"> i = 0;</span> -00044 <span class="stringliteral"> }</span> -00045 <span class="stringliteral"> }</span> -00046 <span class="stringliteral"> }</span> -00047 <span class="stringliteral"> i += printk("</span> <EOE> <span class="stringliteral">"); </span> -00048 <span class="stringliteral"> i += 7;</span> -00049 <span class="stringliteral"> stack = (unsigned long *) estack_end[-2]; </span> -00050 <span class="stringliteral"> } </span> -00051 <span class="stringliteral"></span> -00052 <span class="stringliteral"> irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);</span> -00053 <span class="stringliteral"> irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE + 64);</span> -00054 <span class="stringliteral"></span> -00055 <span class="stringliteral"> if (stack >= irqstack && stack < irqstack_end) {</span> -00056 <span class="stringliteral"> printk("</span><IRQ> <span class="stringliteral">"); </span> -00057 <span class="stringliteral"> while (stack < irqstack_end) {</span> -00058 <span class="stringliteral"> addr = *stack++;</span> -00059 <span class="stringliteral"> /*</span> -00060 <span class="stringliteral"> * If the address is either in the text segment of the</span> -00061 <span class="stringliteral"> * kernel, or in the region which contains vmalloc'ed</span> -00062 <span class="stringliteral"> * memory, it *may* be the address of a calling</span> -00063 <span class="stringliteral"> * routine; if so, print it so that someone tracing</span> -00064 <span class="stringliteral"> * down the cause of the crash will be able to figure</span> -00065 <span class="stringliteral"> * out the call path that was taken.</span> -00066 <span class="stringliteral"> */</span> -00067 <span class="stringliteral"> if (__kernel_text_address(addr)) {</span> -00068 <span class="stringliteral"> i += printk_address(addr);</span> -00069 <span class="stringliteral"> i += printk("</span> <span class="stringliteral">"); </span> -00070 <span class="stringliteral"> if (i > 50) { </span> -00071 <span class="stringliteral"> printk("</span>\n <span class="stringliteral">");</span> -00072 <span class="stringliteral"> i = 0;</span> -00073 <span class="stringliteral"> } </span> -00074 <span class="stringliteral"> }</span> -00075 <span class="stringliteral"> } </span> -00076 <span class="stringliteral"> stack = (unsigned long *) (irqstack_end[-1]);</span> -00077 <span class="stringliteral"> printk("</span> <EOI> <span class="stringliteral">");</span> -00078 <span class="stringliteral"> i += 7;</span> -00079 <span class="stringliteral"> } </span> -00080 <span class="stringliteral"></span> -00081 <span class="stringliteral"> while (((long) stack & (THREAD_SIZE-1)) != 0) {</span> -00082 <span class="stringliteral"> addr = *stack++;</span> -00083 <span class="stringliteral"> if (__kernel_text_address(addr)) {</span> -00084 <span class="stringliteral"> i += printk_address(addr);</span> -00085 <span class="stringliteral"> i += printk("</span> <span class="stringliteral">"); </span> -00086 <span class="stringliteral"> if (i > 50) { </span> -00087 <span class="stringliteral"> printk("</span>\n <span class="stringliteral">");</span> -00088 <span class="stringliteral"> i = 0;</span> -00089 <span class="stringliteral"> } </span> -00090 <span class="stringliteral"> }</span> -00091 <span class="stringliteral"> }</span> -00092 <span class="stringliteral"> printk("</span>\n<span class="stringliteral">");</span> -00093 <span class="stringliteral">}</span> -00094 <span class="stringliteral"></span> -00095 <span class="stringliteral">void _stp_dump_stack(void)</span> -00096 <span class="stringliteral">{</span> -00097 <span class="stringliteral"> unsigned long dummy;</span> -00098 <span class="stringliteral"> show_trace(&dummy);</span> -00099 <span class="stringliteral">}</span> -00100 <span class="stringliteral"></span> -00101 <span class="stringliteral">#else /* i386 */</span> -00102 <span class="stringliteral"></span> -00103 <span class="stringliteral">static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)</span> -00104 <span class="stringliteral">{</span> -00105 <span class="stringliteral"> return p > (void *)tinfo &&</span> -00106 <span class="stringliteral"> p < (void *)tinfo + THREAD_SIZE - 3;</span> -00107 <span class="stringliteral">}</span> -00108 <span class="stringliteral"></span> -00109 <span class="stringliteral">int __kernel_text_address(unsigned long addr)</span> -00110 <span class="stringliteral">{</span> -00111 <span class="stringliteral"> if (core_kernel_text(addr))</span> -00112 <span class="stringliteral"> return 1;</span> -00113 <span class="stringliteral"> return __module_text_address(addr) != NULL;</span> -00114 <span class="stringliteral">}</span> -00115 <span class="stringliteral"></span> -00116 <span class="stringliteral">static inline unsigned long _stp_print_context_stack(struct thread_info *tinfo,</span> -00117 <span class="stringliteral"> unsigned long *stack, unsigned long ebp)</span> -00118 <span class="stringliteral">{</span> -00119 <span class="stringliteral"> unsigned long addr;</span> -00120 <span class="stringliteral"></span> -00121 <span class="stringliteral">#ifdef CONFIG_FRAME_POINTER</span> -00122 <span class="stringliteral"> while (valid_stack_ptr(tinfo, (void *)ebp)) {</span> -00123 <span class="stringliteral"> addr = *(unsigned long *)(ebp + 4);</span> -00124 <span class="stringliteral"> _stp_print_buf("</span> [<%08lx>] <span class="stringliteral">", addr);</span> -00125 <span class="stringliteral"> _stp_print_symbol("</span>%s<span class="stringliteral">", addr);</span> -00126 <span class="stringliteral"> _stp_print_buf("</span>\n<span class="stringliteral">");</span> -00127 <span class="stringliteral"> ebp = *(unsigned long *)ebp;</span> -00128 <span class="stringliteral"> }</span> -00129 <span class="stringliteral">#else</span> -00130 <span class="stringliteral"> while (valid_stack_ptr(tinfo, stack)) {</span> -00131 <span class="stringliteral"> addr = *stack++;</span> -00132 <span class="stringliteral"> if (__kernel_text_address(addr)) {</span> -00133 <span class="stringliteral"> _stp_print_buf("</span> [<%08lx>]<span class="stringliteral">", addr);</span> -00134 <span class="stringliteral"> _stp_print_symbol("</span> %s<span class="stringliteral">", addr);</span> -00135 <span class="stringliteral"> _stp_print_buf("</span>\n<span class="stringliteral">");</span> -00136 <span class="stringliteral"> }</span> -00137 <span class="stringliteral"> }</span> -00138 <span class="stringliteral">#endif</span> -00139 <span class="stringliteral"> return ebp;</span> -00140 <span class="stringliteral">}</span> -00141 <span class="stringliteral"></span> -00142 <span class="stringliteral">void show_trace(struct task_struct *task, unsigned long * stack)</span> -00143 <span class="stringliteral">{</span> -00144 <span class="stringliteral"> unsigned long ebp;</span> -00145 <span class="stringliteral"></span> -00146 <span class="stringliteral"> if (!task)</span> -00147 <span class="stringliteral"> task = current;</span> -00148 <span class="stringliteral"></span> -00149 <span class="stringliteral"> if (task == current) {</span> -00150 <span class="stringliteral"> /* Grab ebp right from our regs */</span> -00151 <span class="stringliteral"> asm ("</span>movl %%ebp, %0<span class="stringliteral">" : "</span>=r<span class="stringliteral">" (ebp) : );</span> -00152 <span class="stringliteral"> } else {</span> -00153 <span class="stringliteral"> /* ebp is the last reg pushed by switch_to */</span> -00154 <span class="stringliteral"> ebp = *(unsigned long *) task->thread.esp;</span> -00155 <span class="stringliteral"> }</span> -00156 <span class="stringliteral"></span> -00157 <span class="stringliteral"> while (1) {</span> -00158 <span class="stringliteral"> struct thread_info *context;</span> -00159 <span class="stringliteral"> context = (struct thread_info *)</span> -00160 <span class="stringliteral"> ((unsigned long)stack & (~(THREAD_SIZE - 1)));</span> -00161 <span class="stringliteral"> ebp = _stp_print_context_stack(context, stack, ebp);</span> -00162 <span class="stringliteral"> stack = (unsigned long*)context->previous_esp;</span> -00163 <span class="stringliteral"> if (!stack)</span> -00164 <span class="stringliteral"> break;</span> -00165 <span class="stringliteral"> _stp_print_buf("</span> =======================\n<span class="stringliteral">");</span> -00166 <span class="stringliteral"> }</span> -00167 <span class="stringliteral">}</span> -00168 <span class="stringliteral"></span> -00169 <span class="stringliteral">void dump_stack(void)</span> -00170 <span class="stringliteral">{</span> -00171 <span class="stringliteral"> unsigned long stack;</span> -00172 <span class="stringliteral"> show_trace(current, &stack);</span> -00173 <span class="stringliteral">}</span> -00174 <span class="stringliteral">#endif</span> -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +<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> +00004 <span class="comment"></span> +00005 <span class="comment">/** @file stack.c</span> +00006 <span class="comment"> * @brief Stack Tracing Functions</span> +00007 <span class="comment"> */</span> +00008 <span class="comment"></span> +00009 <span class="comment">/** @addtogroup stack Stack Tracing Functions</span> +00010 <span class="comment"> * @{</span> +00011 <span class="comment"> */</span> +00012 +00013 <span class="preprocessor">#include "sym.c"</span> +00014 +00015 <span class="keyword">static</span> int (*_stp_kta)(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr)=(<span class="keywordtype">void</span> *)KTA; +00016 +00017 <span class="preprocessor">#ifdef __x86_64__</span> +00018 <span class="preprocessor"></span><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) +00019 { +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); +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 +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(); +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); +00047 else +00048 _stp_sprint ("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; +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 _stp_sprint_str(<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 _stp_sprint_str (<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 +00146 <span class="keywordtype">void</span> _stp_stack_print (<span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00147 { +00148 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; +00149 <span class="keywordflow">return</span> __stp_stack_print (&stack, verbose, levels); +00150 } +00151 +00152 <span class="keywordtype">char</span> *_stp_stack_sprint (<span class="keywordtype">int</span> verbose, <span class="keywordtype">int</span> levels) +00153 { +00154 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stack; +00155 <span class="keywordtype">char</span> *ptr = _stp_scbuf_cur(); +00156 __stp_stack_sprint (&stack, verbose, levels); +00157 <span class="keywordflow">return</span> ptr; +00158 } +00159 <span class="comment"></span> +00160 <span class="comment">/** @} */</span> +00161 <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 0b8cc43d..65cb258e 100644 --- a/runtime/docs/html/stack_8c.html +++ b/runtime/docs/html/stack_8c.html @@ -1,125 +1,28 @@ <!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: stack.c File Reference</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>stack.c File Reference</h1> +<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 File Reference</h1>Stack Tracing Functions. <a href="#_details">More...</a> +<p> +<code>#include "sym.c"</code><br> + <p> <a href="stack_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">int </td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8c.html#a1">__kernel_text_address</a> (unsigned long addr)</td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="stack.c::_stp_stack_print"></a> +void </td><td class="memItemRight" valign="bottom"><b>_stp_stack_print</b> (int verbose, int levels)</td></tr> -<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8c.html#a3">show_trace</a> (struct task_struct *task, unsigned long *stack)</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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8c.html#a4">dump_stack</a> (void)</td></tr> - -</table> -<hr><h2>Function Documentation</h2> -<a class="anchor" name="a1" doxytag="stack.c::__kernel_text_address"></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">int __kernel_text_address </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">unsigned long </td> - <td class="mdname1" valign="top" nowrap> <em>addr</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> - +<hr><a name="_details"></a><h2>Detailed Description</h2> +Stack Tracing Functions. <p> -Definition at line <a class="el" href="stack_8c-source.html#l00109">109</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. </td> - </tr> -</table> -<a class="anchor" name="a4" doxytag="stack.c::dump_stack"></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 dump_stack </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> - -<p> -Definition at line <a class="el" href="stack_8c-source.html#l00169">169</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. </td> - </tr> -</table> -<a class="anchor" name="a3" doxytag="stack.c::show_trace"></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 show_trace </td> - <td class="md" valign="top">( </td> - <td class="md" nowrap valign="top">struct task_struct * </td> - <td class="mdname" nowrap> <em>task</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>stack</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> - -<p> -Definition at line <a class="el" href="stack_8c-source.html#l00142">142</a> of file <a class="el" href="stack_8c-source.html">stack.c</a>. </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> +Definition in file <a class="el" href="stack_8c-source.html">stack.c</a>.</body></html> diff --git a/runtime/docs/html/stp__tasklet_8c-source.html b/runtime/docs/html/stp__tasklet_8c-source.html index 93f8b84c..1156b265 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="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="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="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,7 +15,7 @@ 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 "runtime.h"</span> +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 @@ -25,7 +25,7 @@ 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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"interrupt=%d\n"</span>, in_interrupt()); +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 @@ -41,20 +41,18 @@ 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="io_8c.html#a4">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); +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="io_8c.html#a4">dlog</a> (<span class="stringliteral">"EXIT\n"</span>); +00042 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"EXIT\n"</span>); 00043 } 00044 00045 module_init(init_stp); 00046 module_exit(cleanup_stp); 00047 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>); 00048 -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</pre></div></body></html> diff --git a/runtime/docs/html/structmap__node.html b/runtime/docs/html/structmap__node.html index d2fc751c..c4c387ee 100644 --- a/runtime/docs/html/structmap__node.html +++ b/runtime/docs/html/structmap__node.html @@ -4,8 +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="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</h1>basic map element +<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> @@ -28,10 +31,10 @@ hlist_node </td><td class="memItemRight" valign="bottom"><a class="el" href <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="map_8h.html#a18">keytype</a> </td><td class="memItemRight" valign="bottom"><b>key1type</b></td></tr> +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="map_8h.html#a18">keytype</a> </td><td class="memItemRight" valign="bottom"><b>key2type</b></td></tr> +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> @@ -39,8 +42,6 @@ basic map element <p> <p> -Definition at line <a class="el" href="map_8h-source.html#l00029">29</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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/structmap__node__int64.html b/runtime/docs/html/structmap__node__int64.html index 7dc8e5e6..4a8c3edc 100644 --- a/runtime/docs/html/structmap__node__int64.html +++ b/runtime/docs/html/structmap__node__int64.html @@ -4,8 +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="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</h1>map element containing int64 +<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> @@ -25,8 +28,6 @@ map element containing int64 <p> <p> -Definition at line <a class="el" href="map_8h-source.html#l00041">41</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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/structmap__node__stat.html b/runtime/docs/html/structmap__node__stat.html index a094c11d..fe581573 100644 --- a/runtime/docs/html/structmap__node__stat.html +++ b/runtime/docs/html/structmap__node__stat.html @@ -4,8 +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="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</h1>map element containing stats +<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> @@ -25,8 +28,6 @@ map element containing stats <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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/structmap__node__str.html b/runtime/docs/html/structmap__node__str.html index 6aa4ef38..fa970680 100644 --- a/runtime/docs/html/structmap__node__str.html +++ b/runtime/docs/html/structmap__node__str.html @@ -4,8 +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="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</h1>map element containing string +<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> @@ -25,8 +28,6 @@ map element containing string <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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/structmap__root.html b/runtime/docs/html/structmap__root.html index 0fdd005f..d6e95bd6 100644 --- a/runtime/docs/html/structmap__root.html +++ b/runtime/docs/html/structmap__root.html @@ -4,8 +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="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</h1>This structure contains all information about a map. +<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> @@ -14,7 +17,7 @@ <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="map_8h.html#a19">valtype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html#o0">type</a></td></tr> +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> @@ -44,10 +47,10 @@ list_head </td><td class="memItemRight" valign="bottom"><a class="el" href= <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="map_8h.html#a18">keytype</a> </td><td class="memItemRight" valign="bottom"><b>c_key1type</b></td></tr> +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="map_8h.html#a18">keytype</a> </td><td class="memItemRight" valign="bottom"><b>c_key2type</b></td></tr> +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> @@ -69,11 +72,11 @@ hlist_head </td><td class="memItemRight" valign="bottom"><a class="el" href <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="map_8c.html#a3">_stp_map_new()</a> is called. +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#l00061">61</a> of file <a class="el" href="map_8h-source.html">map.h</a>.<hr><h2>Field Documentation</h2> +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> @@ -96,12 +99,12 @@ Definition at line <a class="el" href="map_8h-source.html#l00061">61</a> of file <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#_todo000005">Todo:</a></b></dt><dd>Needs to be per-cpu data for SMP support</dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000008">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#l00087">87</a> of file <a class="el" href="map_8h-source.html">map.h</a>. +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#l00557">_stp_map_get_int64()</a>, <a class="el" href="map_8c-source.html#l00721">_stp_map_get_stat()</a>, <a class="el" href="map_8c-source.html#l00638">_stp_map_get_str()</a>, <a class="el" href="map_8c-source.html#l00222">_stp_map_key_long_long()</a>, <a class="el" href="map_8c-source.html#l00362">_stp_map_key_long_str()</a>, <a class="el" href="map_8c-source.html#l00314">_stp_map_key_str_long()</a>, <a class="el" href="map_8c-source.html#l00265">_stp_map_key_str_str()</a>, <a class="el" href="map_8c-source.html#l00662">_stp_map_set_stat()</a>, <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>, and <a class="el" href="map_8c-source.html#l00742">_stp_map_stat_add()</a>. </td> +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> @@ -128,9 +131,9 @@ pointer to allocated memory space. <p> Used for freeing memory. <p> -Definition at line <a class="el" href="map_8h-source.html#l00098">98</a> of file <a class="el" href="map_8h-source.html">map.h</a>. +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#l00194">_stp_map_del()</a>, and <a class="el" href="map_8c-source.html#l00046">_stp_map_new()</a>. </td> +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> @@ -157,13 +160,11 @@ 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#l00079">79</a> of file <a class="el" href="map_8h-source.html">map.h</a>. +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#l00794">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00046">_stp_map_new()</a>, <a class="el" href="map_8c-source.html#l00662">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00577">_stp_map_set_str()</a>. </td> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/structstat.html b/runtime/docs/html/structstat.html index ef5b86e0..16155517 100644 --- a/runtime/docs/html/structstat.html +++ b/runtime/docs/html/structstat.html @@ -4,8 +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="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</h1>Statistics are stored in this struct. +<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> @@ -34,8 +37,6 @@ Statistics are stored in this struct. <p> <p> -Definition at line <a class="el" href="map_8h-source.html#l00009">9</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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/sym_8c-source.html b/runtime/docs/html/sym_8c-source.html new file mode 100644 index 00000000..2e8ffc8a --- /dev/null +++ b/runtime/docs/html/sym_8c-source.html @@ -0,0 +1,73 @@ +<!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: sym.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>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> +00005 <span class="comment"></span> +00006 <span class="comment">/** @file sym.c</span> +00007 <span class="comment"> * @addtogroup sym Symbolic Functions</span> +00008 <span class="comment"> * Symbolic Lookup Functions</span> +00009 <span class="comment"> * @{</span> +00010 <span class="comment"> */</span> +00011 <span class="comment"></span> +00012 <span class="comment">/** Lookup symbol.</span> +00013 <span class="comment"> * This simply calls the kernel function kallsyms_lookup().</span> +00014 <span class="comment"> * That function is not exported, so this workaround is required.</span> +00015 <span class="comment"> * See the kernel source, kernel/kallsyms.c for more information.</span> +00016 <span class="comment"> */</span> +00017 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * (*_stp_kallsyms_lookup)(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> addr, +00018 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *symbolsize, +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> +</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 47241e71..2847b88a 100644 --- a/runtime/docs/html/test4_2dtr_8c-source.html +++ b/runtime/docs/html/test4_2dtr_8c-source.html @@ -4,114 +4,147 @@ <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> +<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="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 -00005 <span class="preprocessor">#include "runtime.h"</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="probes_8c.html">probes.c</a>"</span> -00009 -00010 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: test4"</span>); -00011 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); -00012 -00013 <a class="code" href="structmap__root.html">MAP</a> opens, reads, writes; -00014 -00015 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) -00016 { -00017 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (opens, current->comm); -00018 <a class="code" href="map_8c.html#a18">_stp_map_add_int64</a> (opens, 1); -00019 jprobe_return(); -00020 <span class="keywordflow">return</span> 0; -00021 } -00022 -00023 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) -00024 { -00025 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (reads, current->comm); -00026 <a class="code" href="map_8c.html#a24">_stp_map_stat_add</a> (reads, count); -00027 jprobe_return(); -00028 <span class="keywordflow">return</span> 0; -00029 } -00030 -00031 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) -00032 { -00033 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (writes, current->comm); -00034 <a class="code" href="map_8c.html#a24">_stp_map_stat_add</a> (writes, count); -00035 jprobe_return(); -00036 <span class="keywordflow">return</span> 0; -00037 } -00038 -00039 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe dtr_probes[] = { -00040 { -00041 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_open"</span>, -00042 .entry = (kprobe_opcode_t *) inst_sys_open -00043 }, -00044 { -00045 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_read"</span>, -00046 .entry = (kprobe_opcode_t *) inst_sys_read -00047 }, -00048 { -00049 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>, -00050 .entry = (kprobe_opcode_t *) inst_sys_write -00051 }, -00052 }; -00053 -00054 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span> -00055 <span class="preprocessor"></span> -00056 <span class="keyword">static</span> <span class="keywordtype">int</span> init_dtr(<span class="keywordtype">void</span>) -00057 { -00058 <span class="keywordtype">int</span> ret; -00059 -00060 opens = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, INT64); -00061 reads = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, STAT); -00062 writes = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, STAT); -00063 -00064 ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00065 -00066 <a class="code" href="io_8c.html#a4">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); -00067 <span class="keywordflow">return</span> ret; -00068 -00069 } -00070 -00071 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) -00072 { -00073 <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> *st; -00074 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *ptr; -00075 -00076 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); -00077 -00078 <span class="keywordflow">for</span> (ptr = (<span class="keyword">struct</span> <a class="code" href="structmap__node__int64.html">map_node_int64</a> *)<a class="code" href="map_8c.html#a6">_stp_map_start</a>(opens); ptr; -00079 ptr = (<span class="keyword">struct</span> <a class="code" href="structmap__node__int64.html">map_node_int64</a> *)_stp_map_iter (opens,(<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)ptr)) -00080 dlog ("opens[%s] = %lld\n", key1str(ptr), ptr->val); -00081 dlog ("\n"); -00082 -00083 for (st = (struct <a class="code" href="structmap__node__stat.html">map_node_stat</a> *)_stp_map_start(reads); st; -00084 st = (struct <a class="code" href="structmap__node__stat.html">map_node_stat</a> *)_stp_map_iter (reads,(struct <a class="code" href="structmap__node.html">map_node</a> *)st)) -00085 dlog ("reads[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), st->stats.count, st->stats.sum, -00086 st->stats.min, st->stats.max); -00087 dlog ("\n"); -00088 -00089 for (st = (struct <a class="code" href="structmap__node__stat.html">map_node_stat</a> *)_stp_map_start(writes); st; -00090 st = (struct <a class="code" href="structmap__node__stat.html">map_node_stat</a> *)_stp_map_iter (writes,(struct <a class="code" href="structmap__node.html">map_node</a> *)st)) -00091 dlog ("writes[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), st->stats.count, st->stats.sum, -00092 st->stats.min, st->stats.max); -00093 dlog ("\n"); -00094 -00095 _stp_map_del (opens); -00096 _stp_map_del (reads); -00097 _stp_map_del (writes); -00098 -00099 dlog("EXIT\n"); -00100 } -00101 -00102 module_init(init_dtr); -00103 module_exit(cleanup_dtr); -00104 MODULE_LICENSE("GPL"); -00105 -</pre></div><hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +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 +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="io_8c.html">io.c</a>"</span> +00010 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span> +00011 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span> +00012 <span class="preprocessor">#include "<a class="code" href="stack_8c.html">stack.c</a>"</span> +00013 +00014 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: test4"</span>); +00015 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt <hunt@redhat.com>"</span>); +00016 +00017 <span class="keyword">static</span> <span class="keywordtype">char</span> tbuffer[2][50000]; +00018 <span class="keyword">static</span> <span class="keywordtype">void</span> stp_helper(<span class="keywordtype">void</span> *); +00019 <span class="keyword">static</span> DECLARE_WORK(stp_work, stp_helper, tbuffer); +00020 +00021 <a class="code" href="structmap__root.html">MAP</a> opens, reads, writes, traces; +00022 <span class="keyword">static</span> <span class="keywordtype">int</span> bufcount = 0; +00023 +00024 <span class="keyword">static</span> <span class="keywordtype">void</span> stp_helper (<span class="keywordtype">void</span> *data) +00025 { +00026 <a class="code" href="group__io.html#ga0">dlog</a> (<span class="stringliteral">"HELPER\n"</span>); +00027 } +00028 +00029 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) +00030 { +00031 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (opens, current->comm); +00032 <a class="code" href="group__maps.html#ga17">_stp_map_add_int64</a> (opens, 1); +00033 jprobe_return(); +00034 <span class="keywordflow">return</span> 0; +00035 } +00036 +00037 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) +00038 { +00039 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (reads, current->comm); +00040 <a class="code" href="group__maps.html#ga23">_stp_map_stat_add</a> (reads, count); +00041 jprobe_return(); +00042 <span class="keywordflow">return</span> 0; +00043 } +00044 +00045 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) +00046 { +00047 <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (writes, current->comm); +00048 <a class="code" href="group__maps.html#ga23">_stp_map_stat_add</a> (writes, count); +00049 jprobe_return(); +00050 <span class="keywordflow">return</span> 0; +00051 } +00052 +00053 <span class="keywordtype">int</span> inst_show_cpuinfo(<span class="keyword">struct</span> seq_file *m, <span class="keywordtype">void</span> *v) +00054 { +00055 _stp_stack_print (0,0); +00056 _stp_stack_print (1,0); +00057 +00058 <a class="code" href="group__scbuf.html#ga4">_stp_scbuf_clear</a>(); +00059 <a class="code" href="group__lists.html#ga5">_stp_list_add</a> (traces, _stp_stack_sprint(0,0)); +00060 <span class="keywordflow">if</span> (bufcount++ == 0) +00061 schedule_work (&stp_work); +00062 +00063 jprobe_return(); +00064 return 0; +00065 } +00066 +00067 +00068 static struct jprobe dtr_probes[] = { +00069 { +00070 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_open"</span>, +00071 .entry = (kprobe_opcode_t *) inst_sys_open +00072 }, +00073 { +00074 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_read"</span>, +00075 .entry = (kprobe_opcode_t *) inst_sys_read +00076 }, +00077 { +00078 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>, +00079 .entry = (kprobe_opcode_t *) inst_sys_write +00080 }, +00081 { +00082 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"show_cpuinfo"</span>, +00083 .entry = (kprobe_opcode_t *) inst_show_cpuinfo, +00084 }, +00085 }; +00086 +00087 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span> +00088 <span class="preprocessor"></span> +00089 <span class="keyword">static</span> <span class="keywordtype">int</span> init_dtr(<span class="keywordtype">void</span>) +00090 { +00091 <span class="keywordtype">int</span> ret; +00092 +00093 opens = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, INT64); +00094 reads = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, STAT); +00095 writes = <a class="code" href="group__maps.html#ga2">_stp_map_new</a> (1000, STAT); +00096 traces = <a class="code" href="group__lists.html#ga0">_stp_list_new</a> (1000, STRING); +00097 +00098 ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); +00099 +00100 <a class="code" href="group__io.html#ga0">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>); +00101 <span class="keywordflow">return</span> ret; +00102 +00103 } +00104 +00105 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>) +00106 { +00107 <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> *st; +00108 <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> *ptr; +00109 <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> *sptr; +00110 +00111 <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (dtr_probes, MAX_DTR_ROUTINE); +00112 +00113 <a class="code" href="group__maps.html#ga31">foreach</a> (traces, sptr) +00114 dlog ("trace: %s\n", sptr->str); +00115 +00116 foreach (opens, ptr) +00117 dlog ("opens[%s] = %lld\n", key1str(ptr), ptr->val); +00118 dlog ("\n"); +00119 +00120 foreach (reads, st) +00121 dlog ("reads[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), +00122 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); +00123 dlog ("\n"); +00124 +00125 foreach (writes, st) +00126 dlog ("writes[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), +00127 st->stats.count, st->stats.sum, st->stats.min, st->stats.max); +00128 dlog ("\n"); +00129 +00130 _stp_map_del (opens); +00131 _stp_map_del (reads); +00132 _stp_map_del (writes); +00133 +00134 dlog("EXIT\n"); +00135 } +00136 +00137 module_init(init_dtr); +00138 module_exit(cleanup_dtr); +00139 MODULE_LICENSE("GPL"); +00140 +</pre></div></body></html> diff --git a/runtime/docs/html/todo.html b/runtime/docs/html/todo.html index e3973e18..7435d106 100644 --- a/runtime/docs/html/todo.html +++ b/runtime/docs/html/todo.html @@ -4,31 +4,44 @@ <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="todo">Todo List</a></h1><a class="anchor" name="_todo000005"></a> <dl> +<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="_todo000008"></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> </dl> <p> <a class="anchor" name="_todo000001"></a> <dl> -<dt>File <a class="el" href="alloc_8h.html">alloc.h</a> </dt> -<dd>Should really be alloc.c for consistency. </dd> +<dt>Group <a class="el" href="group__alloc.html">alloc</a> </dt> +<dd>Need error handling for memory allocations</dd> </dl> <p> -<a class="anchor" name="_todo000002"></a> <dl> -<dt>Global <a class="el" href="io_8c.html#a4">dlog</a> (const char *fmt,...) </dt> +<a class="anchor" name="_todo000001"></a> <dl> +<dt>Group <a class="el" href="group__alloc.html">alloc</a> </dt> +<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> +</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> </dl> <p> <a class="anchor" name="_todo000003"></a> <dl> -<dt>Global <a class="el" href="map_8c.html#a22">_stp_map_set_stat</a> (MAP map, stat *stats) </dt> +<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> +</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> <dd>Histograms don't work yet. </dd> </dl> <p> -<a class="anchor" name="_todo000004"></a> <dl> -<dt>Global <a class="el" href="map_8c.html#a24">_stp_map_stat_add</a> (MAP map, int64_t val) </dt> +<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> </dl> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> diff --git a/runtime/docs/html/unionkey__data.html b/runtime/docs/html/unionkey__data.html index 92d878af..f6fed5cb 100644 --- a/runtime/docs/html/unionkey__data.html +++ b/runtime/docs/html/unionkey__data.html @@ -4,8 +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="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</h1>Keys are either longs or char *. +<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> @@ -25,8 +28,6 @@ Keys are either longs or char *. <p> <p> -Definition at line <a class="el" href="map_8h-source.html#l00017">17</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> +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> -<hr size="1"><address style="align: right;"><small> -Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body> -</html> +</body></html> |