From: hunt Date: Mon, 21 Mar 2005 21:47:54 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release-0.2.2~235 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=33776f4955fa52ae3e4dc87ab6ac484a3ebc9a71;p=systemtap.git *** empty log message *** --- diff --git a/runtime/ChangeLog b/runtime/ChangeLog new file mode 100644 index 000000000..979815804 --- /dev/null +++ b/runtime/ChangeLog @@ -0,0 +1,9 @@ +2005-03-21 Martin Hunt + + * io.c (_stp_print_buf): Add print buffer stuff and other misc. + Will move later. + + * map.c (_stp_map_add_int64): New function. + + * probes: Directory of example probes. + diff --git a/runtime/Doxyfile b/runtime/Doxyfile index 050d44499..da7b57fb8 100644 --- a/runtime/Doxyfile +++ b/runtime/Doxyfile @@ -461,7 +461,7 @@ EXCLUDE_PATTERNS = # directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = docs/examples +EXAMPLE_PATH = docs/examples probes # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/runtime/README b/runtime/README index d71466556..824d35c34 100644 --- a/runtime/README +++ b/runtime/README @@ -37,9 +37,15 @@ * If maps overflow or memory runs out for some reason, globals are set but nothing is done yet. * I expect to implement a function to tell the system to either ignore it or unload the module and quit. * - * Working sample probe code using the runtime is in tests/test4_probe and tests/shellprobe. + * @section probe_sec Example Probes + * + * Working sample probe code using the runtime is in runtime/probes. * - * @todo The Runtime Library is not actually a library yet. It is just a collection of functions - * included in the probe boilerplate. + * + * @section todo_sec ToDo + * \link todo Click Here for Complete List \endlink + * The Runtime Library is not actually a library yet. It is just a collection of functions + * included in the probe boilerplate. Maybe it should stay that way to allow the translator + * more flexibility in what is included. * */ diff --git a/runtime/docs/html/README-source.html b/runtime/docs/html/README-source.html index 2b8a1dfd8..32a5d7a84 100644 --- a/runtime/docs/html/README-source.html +++ b/runtime/docs/html/README-source.html @@ -5,10 +5,10 @@ - +

README

Go to the documentation of this file.
00001 
-

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/README.html b/runtime/docs/html/README.html index 0da9fbaf6..d4ddc4347 100644 --- a/runtime/docs/html/README.html +++ b/runtime/docs/html/README.html @@ -5,14 +5,14 @@ - +

README File Reference

Go to the source code of this file.
-


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/alloc_8h-source.html b/runtime/docs/html/alloc_8h-source.html index ba908655e..42be2b627 100644 --- a/runtime/docs/html/alloc_8h-source.html +++ b/runtime/docs/html/alloc_8h-source.html @@ -5,49 +5,49 @@ - -

alloc.h

Go to the documentation of this file.
00001 enum errorcode { ERR_NONE=0, ERR_NO_MEM };
-00002 enum errorcode _stp_error = ERR_NONE;
+
+

alloc.h

Go to the documentation of this file.
00001 enum errorcode { ERR_NONE=0, ERR_NO_MEM };
+00002 enum errorcode _stp_error = ERR_NONE;
 00003 
-00012 inline void *_stp_alloc(size_t len)
+00012 inline void *_stp_alloc(size_t len)
 00013 {
 00014         void *ptr = kmalloc(len, GFP_ATOMIC);
 00015         if (ptr == NULL)
-00016                 _stp_error = ERR_NO_MEM;
+00016                 _stp_error = ERR_NO_MEM;
 00017         return ptr;
 00018 }
 00019 
-00028 inline void *_stp_calloc(size_t len)
+00028 inline void *_stp_calloc(size_t len)
 00029 {
-00030         void *ptr = _stp_alloc(len);
+00030         void *ptr = _stp_alloc(len);
 00031         if (ptr)
 00032                 memset(ptr, 0, len);
 00033         return ptr;
 00034 }
 00035 
-00043 inline void *_stp_valloc(size_t len)
+00043 inline void *_stp_valloc(size_t len)
 00044 {
 00045         void *ptr = vmalloc(len);
 00046         if (ptr)
 00047                 memset(ptr, 0, len);
 00048         else
-00049                 _stp_error = ERR_NO_MEM;
+00049                 _stp_error = ERR_NO_MEM;
 00050         return ptr;
 00051 }
 00052 
-00057 inline void _stp_free(void *ptr)
+00057 inline void _stp_free(void *ptr)
 00058 {
 00059         if (ptr)
 00060                 kfree(ptr);
 00061 }
 00062 
-00067 inline void _stp_vfree(void *ptr)
+00067 inline void _stp_vfree(void *ptr)
 00068 {
 00069         if (ptr)
 00070                 vfree(ptr);
 00071 }
-

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +

Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1 diff --git a/runtime/docs/html/alloc_8h.html b/runtime/docs/html/alloc_8h.html index 6a5db5ab2..0bab6a97c 100644 --- a/runtime/docs/html/alloc_8h.html +++ b/runtime/docs/html/alloc_8h.html @@ -5,41 +5,44 @@ - +

alloc.h File Reference

Go to the source code of this file. - - + - - + + - - + + - - + + - - + + + + + + -

Enumerations

enum  errorcode { ERR_NONE = 0, -ERR_NO_MEM +
enum  errorcode { ERR_NONE = 0, +ERR_NO_MEM }

Functions

void * _stp_alloc (size_t len)
void * _stp_alloc (size_t len)
 Allocates memory within a probe.
void * _stp_calloc (size_t len)
 Allocates memory within a probe.
void * _stp_calloc (size_t len)
 Allocates and clears memory within a probe.
void * _stp_valloc (size_t len)
 Allocates and clears memory within a probe.
void * _stp_valloc (size_t len)
 Allocates and clears memory outside a probe.
void _stp_free (void *ptr)
 Allocates and clears memory outside a probe.
void _stp_free (void *ptr)
 Frees memory allocated by _stp_alloc or _stp_calloc.
void _stp_vfree (void *ptr)
 Frees memory allocated by _stp_alloc or _stp_calloc.
void _stp_vfree (void *ptr)
 Frees memory allocated by _stp_valloc.

Variables

enum errorcode _stp_error = ERR_NONE
 Frees memory allocated by _stp_valloc.


Enumeration Type Documentation

-

- +

+

@@ -55,9 +58,9 @@

Enumeration values:
- +
enum errorcode enum errorcode
- -
ERR_NONE  +
ERR_NONE 
ERR_NO_MEM  +
ERR_NO_MEM 
@@ -67,8 +70,8 @@ Definition at line 1 of fil


Function Documentation

-

- +

+

@@ -105,11 +108,13 @@ This is used for small allocations from within a running probe where the process

Definition at line 12 of file alloc.h.

-Referenced by _stp_calloc(), and _stp_map_set_str(). +References _stp_error, and ERR_NO_MEM. +

+Referenced by _stp_calloc(), and _stp_map_set_str().

-

- +

+

@@ -148,11 +153,11 @@ Definition at line 28 of fi

References _stp_alloc().

-Referenced by _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_map_set_stat(), and _stp_map_set_str().

-

- +

+

@@ -187,11 +192,11 @@ Frees memory allocated by _stp_alloc or _stp_calloc.

Definition at line 57 of file alloc.h.

-Referenced by _stp_list_clear(), _stp_map_key_del(), and _stp_map_set_str(). +Referenced by _stp_list_clear(), _stp_map_key_del(), and _stp_map_set_str().

-

- +

+

@@ -227,11 +232,13 @@ This is typically used in the module initialization to allocate new maps, lists,

Definition at line 43 of file alloc.h.

+References _stp_error, and ERR_NO_MEM. +

Referenced by _stp_map_new().

-

- +

+

@@ -269,8 +276,36 @@ Definition at line 67 of fi Referenced by _stp_map_del().
-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +

Variable Documentation

+

+ + + + +
+ + + + +
enum errorcode _stp_error = ERR_NONE
+
+ + + + + +
+   + + +

+ +

+Definition at line 2 of file alloc.h. +

+Referenced by _stp_alloc(), and _stp_valloc().

+


Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/annotated.html b/runtime/docs/html/annotated.html index 77bc2e381..cec81d584 100644 --- a/runtime/docs/html/annotated.html +++ b/runtime/docs/html/annotated.html @@ -5,7 +5,7 @@ - +

SystemTap Data Structures

Here are the data structures with brief descriptions: @@ -15,8 +15,8 @@
key_data
map_node
map_root
stat
-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/bug.html b/runtime/docs/html/bug.html index a2be5f086..30f41ef4a 100644 --- a/runtime/docs/html/bug.html +++ b/runtime/docs/html/bug.html @@ -5,23 +5,23 @@ - +

Bug List

-
Global _stp_alloc (size_t len)
+
Global _stp_alloc (size_t len)
Currently uses kmalloc (GFP_ATOMIC).

-
Global _stp_calloc (size_t len)
+
Global _stp_calloc (size_t len)
Currently uses kmalloc (GFP_ATOMIC).

-
Global dlog (const char *fmt,...)
+
Global dlog (const char *fmt,...)
Lines are limited in length by printk buffer.
-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/copy_8c-source.html b/runtime/docs/html/copy_8c-source.html index 2e21314cd..3d70030b7 100644 --- a/runtime/docs/html/copy_8c-source.html +++ b/runtime/docs/html/copy_8c-source.html @@ -5,7 +5,7 @@ - +

copy.c

Go to the documentation of this file.
00001 long _stp_strncpy_from_user(char *dst, const char __user *src, long count);
 00002 //static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);
 00003 
@@ -99,13 +99,13 @@
 00130                 
 00131                 len = _stp_strncpy_from_user(str, vstr, 128);
 00132                 str[len] = 0;
-00133                 _stp_list_add_str (list, str);
+00133                 _stp_list_add_str (list, str);
 00134                 argv++;
 00135         }
-00136         return list->num;
+00136         return list->num;
 00137 }
-

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/copy_8c.html b/runtime/docs/html/copy_8c.html index 0febb9ab4..75a632373 100644 --- a/runtime/docs/html/copy_8c.html +++ b/runtime/docs/html/copy_8c.html @@ -5,7 +5,7 @@ - +

copy.c File Reference

Go to the source code of this file. @@ -23,7 +23,7 @@


Function Documentation

- +
@@ -81,11 +81,11 @@ Copy an argv from user space to a List.

Definition at line 115 of file copy.c.

-References _stp_list_add_str(), _stp_strncpy_from_user(), MAP, and map_root::num. +References _stp_list_add_str(), _stp_strncpy_from_user(), and map_root::num.

- +
@@ -141,7 +141,7 @@ Definition at line 100 of fi

- +
@@ -197,8 +197,8 @@ Definition at line 79 of fil Referenced by _stp_copy_argv_from_user().
-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/doxygen.css b/runtime/docs/html/doxygen.css index 1d4d63117..e5272cd12 100644 --- a/runtime/docs/html/doxygen.css +++ b/runtime/docs/html/doxygen.css @@ -1,8 +1,18 @@ BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { font-family: Geneva, Arial, Helvetica, sans-serif; } +BODY,TD { + font-size: 90%; +} H1 { text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 110%; } CAPTION { font-weight: bold } DIV.qindex { @@ -75,6 +85,11 @@ PRE.fragment { } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } TD.md { background-color: #F4F4FB; font-weight: bold; } +TD.mdPrefix { + background-color: #F4F4FB; + color: #606060; + font-size: 80%; +} TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } DIV.groupHeader { @@ -83,7 +98,7 @@ DIV.groupHeader { margin-bottom: 6px; font-weight: bold; } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px } +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; @@ -138,7 +153,7 @@ SPAN.charliteral { color: #008080 } } .mdescLeft { padding: 0px 8px 4px 8px; - font-size: 12px; + font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; @@ -149,7 +164,7 @@ SPAN.charliteral { color: #008080 } } .mdescRight { padding: 0px 8px 4px 8px; - font-size: 12px; + font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; @@ -174,7 +189,7 @@ SPAN.charliteral { color: #008080 } border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; - font-size: 12px; + font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; @@ -192,7 +207,7 @@ SPAN.charliteral { color: #008080 } border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; - font-size: 13px; + font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; @@ -210,7 +225,7 @@ SPAN.charliteral { color: #008080 } border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; - font-size: 12px; + font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; @@ -228,7 +243,7 @@ SPAN.charliteral { color: #008080 } border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; - font-size: 13px; + font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; @@ -247,7 +262,7 @@ SPAN.charliteral { color: #008080 } border-left-style: none; color: #606060; background-color: #FAFAFA; - font-size: 12px; + font-size: 80%; } .search { color: #003399; font-weight: bold; @@ -269,3 +284,14 @@ a { a:visited { color: #3D2185; } +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #b0b0b0; +} +TH.dirtab { background: #eeeeff; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} diff --git a/runtime/docs/html/files.html b/runtime/docs/html/files.html index 599ee02da..61d4d78fb 100644 --- a/runtime/docs/html/files.html +++ b/runtime/docs/html/files.html @@ -5,18 +5,20 @@ - +

SystemTap File List

Here is a list of all files with brief descriptions: + +
alloc.h [code]
copy.c [code]
io.c [code]
map.c [code]
map.h [code]
probes.c [code]
README [code]
runtime.h [code]
stack.c [code]
-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/functions.html b/runtime/docs/html/functions.html index 60b6cf164..57e3e3fa1 100644 --- a/runtime/docs/html/functions.html +++ b/runtime/docs/html/functions.html @@ -5,39 +5,44 @@ - +

Here is a list of all struct and union fields with links to the structures/unions they belong to:

-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/functions_vars.html b/runtime/docs/html/functions_vars.html index aa0ebe5a6..9b26f0537 100644 --- a/runtime/docs/html/functions_vars.html +++ b/runtime/docs/html/functions_vars.html @@ -5,39 +5,44 @@ - +

-
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
+doxygen 1.4.1
diff --git a/runtime/docs/html/globals.html b/runtime/docs/html/globals.html index 9c4c693fd..8e03810f3 100644 --- a/runtime/docs/html/globals.html +++ b/runtime/docs/html/globals.html @@ -5,30 +5,33 @@ - + -
_ | d | e | f | i | k | l | m | n | p | s | v
+
_ | c | d | e | f | i | k | l | m | n | p | s | v

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

    -
  • _stp_alloc() -: alloc.h
  • _stp_calloc() -: alloc.h
  • _stp_copy_argv_from_user() +
  • __kernel_text_address() +: stack.c
  • _stp_alloc() +: alloc.h
  • _stp_calloc() +: alloc.h
  • _stp_copy_argv_from_user() : copy.c
  • _stp_copy_from_user() -: copy.c
  • _stp_free() -: alloc.h
  • _stp_list_add +: copy.c
  • _stp_error +: alloc.h
  • _stp_free() +: alloc.h
  • _stp_list_add : map.h
  • _stp_list_add_int64() -: map.c
  • _stp_list_add_str() -: map.c
  • _stp_list_clear() -: map.c
  • _stp_list_new() -: map.c
  • _stp_list_size() -: map.c
  • _stp_map_del() +: map.c
  • _stp_list_add_str() +: map.c
  • _stp_list_clear() +: map.c
  • _stp_list_new() +: map.c
  • _stp_list_size() +: map.c
  • _stp_map_add_int64() +: map.c
  • _stp_map_del() : map.c
  • _stp_map_get_int64() -: map.c
  • _stp_map_get_stat() -: map.c
  • _stp_map_get_str() -: map.c
  • _stp_map_iter() +: map.c
  • _stp_map_get_stat() +: map.c
  • _stp_map_get_str() +: map.c
  • _stp_map_iter() : map.c
  • _stp_map_key : map.h
  • _stp_map_key2 : map.h
  • _stp_map_key_del() @@ -41,24 +44,35 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : map.c
  • _stp_map_new() : map.c
  • _stp_map_set : map.h
  • _stp_map_set_int64() -: map.c
  • _stp_map_set_stat() -: map.c
  • _stp_map_set_str() -: map.c
  • _stp_map_start() +: map.c
  • _stp_map_set_stat() +: map.c
  • _stp_map_set_str() +: map.c
  • _stp_map_start() : map.c
  • _stp_map_stat_add() -: map.c
  • _stp_strncpy_from_user() -: copy.c
  • _stp_valloc() -: alloc.h
  • _stp_vfree() -: alloc.h
+: map.c
  • _stp_print_buf() +: io.c
  • _stp_print_buf_init() +: io.c
  • _stp_print_symbol() +: io.c
  • _stp_register_jprobes() +: probes.c
  • _stp_register_kprobes() +: probes.c
  • _stp_strncpy_from_user() +: copy.c
  • _stp_unregister_jprobes() +: probes.c
  • _stp_unregister_kprobes() +: probes.c
  • _stp_valloc() +: alloc.h
  • _stp_vfree() +: alloc.h +

    - c -

      +
    • cur_ret_addr() +: io.c

    - d -

    +: io.c
  • dump_stack() +: stack.c

    - e -

    +: alloc.h
  • ERR_NONE +: alloc.h
  • errorcode +: alloc.h

    - f -

    @@ -85,15 +99,17 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
  • packed : map.h

    - s -

    - v -

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_defs.html b/runtime/docs/html/globals_defs.html index ed1d24244..5f1ecf345 100644 --- a/runtime/docs/html/globals_defs.html +++ b/runtime/docs/html/globals_defs.html @@ -5,7 +5,7 @@ - +

    @@ -20,9 +20,10 @@ : map.h

  • key1str : map.h
  • key2int : map.h
  • key2str -: map.h -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +: map.h
  • STP_BUF_LEN +: io.c +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_enum.html b/runtime/docs/html/globals_enum.html index f12861a2a..4bc2a02e2 100644 --- a/runtime/docs/html/globals_enum.html +++ b/runtime/docs/html/globals_enum.html @@ -5,17 +5,17 @@ - +

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_eval.html b/runtime/docs/html/globals_eval.html index f697e2e02..4771c4a5d 100644 --- a/runtime/docs/html/globals_eval.html +++ b/runtime/docs/html/globals_eval.html @@ -5,23 +5,23 @@ - +

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_func.html b/runtime/docs/html/globals_func.html index 3ef3fd400..c1cde956d 100644 --- a/runtime/docs/html/globals_func.html +++ b/runtime/docs/html/globals_func.html @@ -5,29 +5,31 @@ - + -
    _ | d
    +
    _ | c | d | s

    - _ -

      -
    • _stp_alloc() -: alloc.h
    • _stp_calloc() -: alloc.h
    • _stp_copy_argv_from_user() +
    • __kernel_text_address() +: stack.c
    • _stp_alloc() +: alloc.h
    • _stp_calloc() +: alloc.h
    • _stp_copy_argv_from_user() : copy.c
    • _stp_copy_from_user() : copy.c
    • _stp_free() -: alloc.h
    • _stp_list_add_int64() -: map.c
    • _stp_list_add_str() -: map.c
    • _stp_list_clear() -: map.c
    • _stp_list_new() -: map.c
    • _stp_list_size() -: map.c
    • _stp_map_del() +: alloc.h
    • _stp_list_add_int64() +: map.c
    • _stp_list_add_str() +: map.c
    • _stp_list_clear() +: map.c
    • _stp_list_new() +: map.c
    • _stp_list_size() +: map.c
    • _stp_map_add_int64() +: map.c
    • _stp_map_del() : map.c
    • _stp_map_get_int64() -: map.c
    • _stp_map_get_stat() -: map.c
    • _stp_map_get_str() -: map.c
    • _stp_map_iter() +: map.c
    • _stp_map_get_stat() +: map.c
    • _stp_map_get_str() +: map.c
    • _stp_map_iter() : map.c
    • _stp_map_key_del() : map.c
    • _stp_map_key_long() : map.c
    • _stp_map_key_long_long() @@ -37,19 +39,33 @@ : map.c
    • _stp_map_key_str_str() : map.c
    • _stp_map_new() : map.c
    • _stp_map_set_int64() -: map.c
    • _stp_map_set_stat() -: map.c
    • _stp_map_set_str() -: map.c
    • _stp_map_start() +: map.c
    • _stp_map_set_stat() +: map.c
    • _stp_map_set_str() +: map.c
    • _stp_map_start() : map.c
    • _stp_map_stat_add() -: map.c
    • _stp_strncpy_from_user() -: copy.c
    • _stp_valloc() -: alloc.h
    • _stp_vfree() -: alloc.h
    +: map.c
  • _stp_print_buf() +: io.c
  • _stp_print_buf_init() +: io.c
  • _stp_print_symbol() +: io.c
  • _stp_register_jprobes() +: probes.c
  • _stp_register_kprobes() +: probes.c
  • _stp_strncpy_from_user() +: copy.c
  • _stp_unregister_jprobes() +: probes.c
  • _stp_unregister_kprobes() +: probes.c
  • _stp_valloc() +: alloc.h
  • _stp_vfree() +: alloc.h +

    - c -

      +
    • cur_ret_addr() +: io.c

    - d -

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +: io.c
  • dump_stack() +: stack.c +

    - s -

    +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_type.html b/runtime/docs/html/globals_type.html index 194983d0a..69817e46f 100644 --- a/runtime/docs/html/globals_type.html +++ b/runtime/docs/html/globals_type.html @@ -5,15 +5,15 @@ - +

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/globals_vars.html b/runtime/docs/html/globals_vars.html index f0282f637..883ff4eec 100644 --- a/runtime/docs/html/globals_vars.html +++ b/runtime/docs/html/globals_vars.html @@ -5,15 +5,16 @@ - +

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/index.html b/runtime/docs/html/index.html index 3796e861f..dd4edd274 100644 --- a/runtime/docs/html/index.html +++ b/runtime/docs/html/index.html @@ -5,7 +5,7 @@ - +

    SystemTap Runtime Library

    0.1

    @@ -26,15 +26,16 @@ map_key_str (mymap, "birth year"); map_set_int64 (mymap, 2000);

    All elements have a default value of 0 (or NULL). Elements are only saved to the map when their value is set to something nonzero. This means that querying for the existance of a key is inexpensive because no element is created, just a hash table lookup.

    -A list is a special map which has internally ascending long integer keys. Adding a value to a list does not require setting a key first. See _stp_list_add_str() and _stp_list_add_int64().

    +A list is a special map which has internally ascending long integer keys. Adding a value to a list does not require setting a key first. See _stp_list_add_str() and _stp_list_add_int64().

    Status

    Maps are implemented and tested. Histograms are not yet finished.

    Copy_From_User functions are done.

    -If maps overflow or memory runs out for some reason, globals are set but nothing is done yet. I expect to implement a function to tell the system to either ignore it or unload the module and quit.

    -Working sample probe code using the runtime is in tests/test4_probe and tests/shellprobe.

    -

    Todo:
    The Runtime Library is not actually a library yet. It is just a collection of functions included in the probe boilerplate.
    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +If maps overflow or memory runs out for some reason, globals are set but nothing is done yet. I expect to implement a function to tell the system to either ignore it or unload the module and quit.

    +Example Probes

    +Working sample probe code using the runtime is in runtime/probes.

    +ToDo

    +Click Here for Complete List The Runtime Library is not actually a library yet. It is just a collection of functions included in the probe boilerplate. Maybe it should stay that way to allow the translator more flexibility in what is included.
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/io_8c-source.html b/runtime/docs/html/io_8c-source.html index 5a5c1fe39..a152c946b 100644 --- a/runtime/docs/html/io_8c-source.html +++ b/runtime/docs/html/io_8c-source.html @@ -5,9 +5,9 @@ - +

    io.c

    Go to the documentation of this file.
    00001 
    -00011 void dlog (const char *fmt, ...)
    +00011 void dlog (const char *fmt, ...)
     00012 {
     00013   va_list args;
     00014   printk("STP: ");
    @@ -16,8 +16,72 @@
     00017   va_end(args);
     00018 }
     00019 
    -

    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +00020 +00021 static const char * (*_stp_kallsyms_lookup)(unsigned long addr, +00022 unsigned long *symbolsize, +00023 unsigned long *offset, +00024 char **modname, char *namebuf)=(void *)KALLSYMS_LOOKUP; +00025 +00026 +00027 #define STP_BUF_LEN 8191 +00028 +00029 /* FIXME. These need to be per-cpu */ +00030 static char _stp_pbuf[STP_BUF_LEN+1]; +00031 static int _stp_pbuf_len = STP_BUF_LEN; +00032 +00033 void _stp_print_buf (const char *fmt, ...) +00034 { +00035 int num; +00036 va_list args; +00037 char *buf = _stp_pbuf + STP_BUF_LEN - _stp_pbuf_len; +00038 va_start(args, fmt); +00039 num = vscnprintf(buf, _stp_pbuf_len, fmt, args); +00040 va_end(args); +00041 if (num > 0) +00042 _stp_pbuf_len -= num; +00043 } +00044 +00045 void _stp_print_buf_init (void) +00046 { +00047 _stp_pbuf_len = STP_BUF_LEN; +00048 _stp_pbuf[0] = 0; +00049 } +00050 +00051 void _stp_print_symbol(const char *fmt, unsigned long address) +00052 { +00053 char *modname; +00054 const char *name; +00055 unsigned long offset, size; +00056 char namebuf[KSYM_NAME_LEN+1]; +00057 +00058 name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); +00059 +00060 if (!name) +00061 _stp_print_buf("0x%lx", address); +00062 else { +00063 if (modname) +00064 _stp_print_buf("%s+%#lx/%#lx [%s]", name, offset, +00065 size, modname); +00066 else +00067 _stp_print_buf("%s+%#lx/%#lx", name, offset, size); +00068 } +00069 } +00070 +00071 +00072 unsigned long cur_ret_addr (struct pt_regs *regs) +00073 { +00074 #ifdef __x86_64__ +00075 unsigned long *ra = (unsigned long *)regs->rsp; +00076 #else +00077 unsigned long *ra = (unsigned long *)regs->esp; +00078 #endif +00079 if (ra) +00080 return *ra; +00081 else +00082 return 0; +00083 } +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/io_8c.html b/runtime/docs/html/io_8c.html index 1419497c2..85784820f 100644 --- a/runtime/docs/html/io_8c.html +++ b/runtime/docs/html/io_8c.html @@ -5,19 +5,204 @@ - +

    io.c File Reference

    Go to the source code of this file. + + + - + + + + + + + + + + + +

    Defines

    #define STP_BUF_LEN   8191

    Functions

    void dlog (const char *fmt,...)
    void dlog (const char *fmt,...)
     Logs data.
    void _stp_print_buf (const char *fmt,...)
    void _stp_print_buf_init (void)
    void _stp_print_symbol (const char *fmt, unsigned long address)
    unsigned long cur_ret_addr (struct pt_regs *regs)
    +


    Define Documentation

    +

    + + + + +
    + + + + +
    #define STP_BUF_LEN   8191
    +
    + + + + +

    + +

    +Definition at line 27 of file io.c. +

    +Referenced by _stp_print_buf(), and _stp_print_buf_init(). +

    +   + -
     Logs data.


    Function Documentation

    -

    - +

    +

    + + + +
    + + + + + + + + + + + + + + + + + + +
    void _stp_print_buf const char *  fmt,
      ...
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 33 of file io.c. +

    +References STP_BUF_LEN. +

    +Referenced by _stp_print_symbol().

    +

    + + + + +
    + + + + + + + + + +
    void _stp_print_buf_init void   ) 
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 45 of file io.c. +

    +References STP_BUF_LEN.

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    void _stp_print_symbol const char *  fmt,
    unsigned long  address
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 51 of file io.c. +

    +References _stp_print_buf().

    +

    + + + + +
    + + + + + + + + + +
    unsigned long cur_ret_addr struct pt_regs *  regs  ) 
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 72 of file io.c.

    +

    +
    @@ -65,11 +250,11 @@ This function is compatible with printk. In fact it currently sends all output t

    Definition at line 11 of file io.c.

    -Referenced by _stp_list_clear(). +Referenced by _stp_list_clear(), _stp_register_jprobes(), _stp_register_kprobes(), _stp_unregister_jprobes(), and _stp_unregister_kprobes().

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/map_8c-source.html b/runtime/docs/html/map_8c-source.html index 301087fbb..03aa6f476 100644 --- a/runtime/docs/html/map_8c-source.html +++ b/runtime/docs/html/map_8c-source.html @@ -5,7 +5,7 @@ - +

    map.c

    Go to the documentation of this file.
    00001 /* -*- linux-c -*- */
     00002 
     00003 static int map_sizes[] = {
    @@ -35,21 +35,21 @@
     00027         char *v = (char *)key1;
     00028         while (v && *v && count++ < 5)
     00029                 hash += *v++;
    -00030         return hash_long((unsigned long)(hash ^ key2), HASH_TABLE_BITS);
    +00030         return hash_long((unsigned long)(hash ^ key2), HASH_TABLE_BITS);
     00031 }
     00032 
    -00043 MAP _stp_map_new(unsigned max_entries, enum valtype type)
    +00043 MAP _stp_map_new(unsigned max_entries, enum valtype type)
     00044 {
     00045         size_t size;
    -00046         MAP m = (MAP) _stp_valloc(sizeof(struct map_root));
    +00046         MAP m = (MAP) _stp_valloc(sizeof(struct map_root));
     00047         if (m == NULL)
     00048                 return NULL;
     00049 
    -00050         INIT_LIST_HEAD(&m->head);
    +00050         INIT_LIST_HEAD(&m->head);
     00051 
    -00052         m->maxnum = max_entries;
    -00053         m->type = type;
    -00054         if (type >= END) {
    +00052         m->maxnum = max_entries;
    +00053         m->type = type;
    +00054         if (type >= END) {
     00055                 dbug ("map_new: unknown type %d\n", type);
     00056                 return NULL;
     00057         }
    @@ -59,16 +59,16 @@
     00061                 int i;
     00062                 struct list_head *e;
     00063 
    -00064                 INIT_LIST_HEAD(&m->pool);
    +00064                 INIT_LIST_HEAD(&m->pool);
     00065                 size = map_sizes[type];
    -00066                 tmp = _stp_valloc(max_entries * size);
    +00066                 tmp = _stp_valloc(max_entries * size);
     00067 
     00068                 for (i = max_entries - 1; i >= 0; i--) {
     00069                         e = i * size + tmp;
     00070                         dbug ("e=%lx\n", (long)e);
    -00071                         list_add(e, &m->pool);
    +00071                         list_add(e, &m->pool);
     00072                 }
    -00073                 m->membuf = tmp;
    +00073                 m->membuf = tmp;
     00074         }
     00075         return m;
     00076 }
    @@ -77,41 +77,41 @@
     00079 {
     00080         struct map_node_str *m = (struct map_node_str *)n;
     00081         dbug ("n = %lx\n", (long)n);
    -00082         if (map->type == STRING) {
    +00082         if (map->type == STRING) {
     00083                 dbug ("val STRING %lx\n", (long)m->str);
     00084                 if (m->str)
    -00085                         _stp_free(m->str);
    +00085                         _stp_free(m->str);
     00086         }
    -00087         if (m->n.key1type == STR) {
    +00087         if (m->n.key1type == STR) {
     00088                 dbug ("key1 STR %lx\n", (long)key1str(m));
     00089                 if (key1str(m))
    -00090                         _stp_free(key1str(m));
    +00090                         _stp_free(key1str(m));
     00091         }
    -00092         if (m->n.key2type == STR) {
    +00092         if (m->n.key2type == STR) {
     00093                 dbug ("key2 STR %lx\n", (long)key2str(m));
     00094                 if (key2str(m))
    -00095                         _stp_free(key2str(m));
    +00095                         _stp_free(key2str(m));
     00096         }
     00097 }
     00098 
    -00104 void _stp_map_key_del(MAP map)
    +00104 void _stp_map_key_del(MAP map)
     00105 {
     00106         struct map_node *m;
     00107 
    -00108         dbug ("create=%d key=%lx\n", map->create, (long)map->key);
    +00108         dbug ("create=%d key=%lx\n", map->create, (long)map->key);
     00109         if (map == NULL)
     00110                 return;
     00111 
    -00112         if (map->create) {
    -00113                 map->create = 0;
    -00114                 map->key = NULL;
    +00112         if (map->create) {
    +00113                 map->create = 0;
    +00114                 map->key = NULL;
     00115                 return;
     00116         }
     00117 
    -00118         if (map->key == NULL)
    +00118         if (map->key == NULL)
     00119                 return;
     00120 
    -00121         m = (struct map_node *)map->key;
    +00121         m = (struct map_node *)map->key;
     00122 
     00123         /* remove node from old hash list */
     00124         hlist_del_init(&m->hnode);
    @@ -120,15 +120,15 @@
     00127         list_del(&m->lnode);
     00128 
     00129         /* remove any allocated string storage */
    -00130         map_free_strings(map, (struct map_node *)map->key);
    +00130         map_free_strings(map, (struct map_node *)map->key);
     00131 
    -00132         if (map->maxnum)
    -00133                 list_add(&m->lnode, &map->pool);
    +00132         if (map->maxnum)
    +00133                 list_add(&m->lnode, &map->pool);
     00134         else
    -00135                 _stp_free(m);
    +00135                 _stp_free(m);
     00136 
    -00137         map->key = NULL;
    -00138         map->num--;
    +00137         map->key = NULL;
    +00138         map->num--;
     00139 }
     00140 
     00149 struct map_node *_stp_map_start(MAP map)
    @@ -136,12 +136,12 @@
     00151         if (map == NULL)
     00152                 return NULL;
     00153 
    -00154         dbug ("%lx\n", (long)map->head.next);
    +00154         dbug ("%lx\n", (long)map->head.next);
     00155 
    -00156         if (list_empty(&map->head))
    +00156         if (list_empty(&map->head))
     00157                 return NULL;
     00158 
    -00159         return (struct map_node *)map->head.next;
    +00159         return (struct map_node *)map->head.next;
     00160 }
     00161 
     00172 struct map_node *_stp_map_iter(MAP map, struct map_node *m)
    @@ -149,12 +149,12 @@
     00174         if (map == NULL)
     00175                 return NULL;
     00176 
    -00177         dbug ("%lx next=%lx  prev=%lx  map->head.next=%lx\n", (long)m, (long)m->lnode.next, (long)m->lnode.prev, (long)map->head.next);
    +00177         dbug ("%lx next=%lx  prev=%lx  map->head.next=%lx\n", (long)m, (long)m->lnode.next, (long)m->lnode.prev, (long)map->head.next);
     00178 
    -00179         if (m->lnode.next == &map->head)
    +00179         if (m->lnode.next == &map->head)
     00180                 return NULL;
     00181 
    -00182         return (struct map_node *)m->lnode.next;
    +00182         return (struct map_node *)m->lnode.next;
     00183 }
     00184 
     00190 void _stp_map_del(MAP map)
    @@ -162,15 +162,15 @@
     00192         if (map == NULL)
     00193                 return;
     00194 
    -00195         if (!list_empty(&map->head)) {
    -00196                 struct map_node *ptr = (struct map_node *)map->head.next;
    -00197                 while (ptr && ptr != (struct map_node *)&map->head) {
    +00195         if (!list_empty(&map->head)) {
    +00196                 struct map_node *ptr = (struct map_node *)map->head.next;
    +00197                 while (ptr && ptr != (struct map_node *)&map->head) {
     00198                         map_free_strings(map, ptr);
     00199                         ptr = (struct map_node *)ptr->lnode.next;
     00200                 }
     00201         }
    -00202         _stp_vfree(map->membuf);
    -00203         _stp_vfree(map);
    +00202         _stp_vfree(map->membuf);
    +00203         _stp_vfree(map);
     00204 }
     00205 
     00206 /**********************  KEY FUNCTIONS *********************/
    @@ -186,7 +186,7 @@
     00225                 return;
     00226 
     00227         hv = hash_long(key1 ^ key2, HASH_TABLE_BITS);
    -00228         head = &map->hashes[hv];
    +00228         head = &map->hashes[hv];
     00229 
     00230         dbug ("hash for %ld,%ld is %d\n", key1, key2, hv);
     00231 
    @@ -195,19 +195,19 @@
     00234                         (struct map_node *)((long)e - sizeof(struct hlist_node));
     00235                 dbug ("n =%lx  key=%ld,%ld\n", (long)n, n->key1.val, n->key2.val);
     00236                 if (key1 == n->key1.val && key2 == n->key2.val) {
    -00237                         map->key = n;
    -00238                         dbug ("saving key %lx\n", (long)map->key);
    -00239                         map->create = 0;
    +00237                         map->key = n;
    +00238                         dbug ("saving key %lx\n", (long)map->key);
    +00239                         map->create = 0;
     00240                         return;
     00241                 }
     00242         }
     00243 
    -00244         map->c_key1.val = key1;
    -00245         map->c_key2.val = key2;
    -00246         map->c_key1type = LONG;
    -00247         map->c_key2type = LONG;
    -00248         map->c_keyhead = head;
    -00249         map->create = 1;
    +00244         map->c_key1.val = key1;
    +00245         map->c_key2.val = key2;
    +00246         map->c_key1type = LONG;
    +00247         map->c_key2type = LONG;
    +00248         map->c_keyhead = head;
    +00249         map->create = 1;
     00250 }
     00251 
     00261 void _stp_map_key_str_str(MAP map, char *key1, char *key2)
    @@ -220,12 +220,12 @@
     00268                 return;
     00269 
     00270         if (key1 == NULL) {
    -00271                 map->key = NULL;
    +00271                 map->key = NULL;
     00272                 return;
     00273         }
     00274 
     00275         hv = string_hash(key1, key2);
    -00276         head = &map->hashes[hv];
    +00276         head = &map->hashes[hv];
     00277 
     00278         dbug ("hash for %s,%s is %d\n", key1, key2, hv);
     00279 
    @@ -235,19 +235,19 @@
     00283                 dbug ("e =%lx  key=%s,%s\n", (long)e, n->key1.str,n->key2.str);
     00284                 if (strcmp(key1, n->key1.str) == 0
     00285                     && (key2 == NULL || strcmp(key2, n->key2.str) == 0)) {
    -00286                         map->key = n;
    -00287                         dbug ("saving key %lx\n", (long)map->key);
    -00288                         map->create = 0;
    +00286                         map->key = n;
    +00287                         dbug ("saving key %lx\n", (long)map->key);
    +00288                         map->create = 0;
     00289                         return;
     00290                 }
     00291         }
     00292 
    -00293         map->c_key1.str = key1;
    -00294         map->c_key2.str = key2;
    -00295         map->c_key1type = STR;
    -00296         map->c_key2type = STR;
    -00297         map->c_keyhead = head;
    -00298         map->create = 1;
    +00293         map->c_key1.str = key1;
    +00294         map->c_key2.str = key2;
    +00295         map->c_key1type = STR;
    +00296         map->c_key2type = STR;
    +00297         map->c_keyhead = head;
    +00298         map->create = 1;
     00299 }
     00300 
     00310 void _stp_map_key_str_long(MAP map, char *key1, long key2)
    @@ -260,12 +260,12 @@
     00317                 return;
     00318 
     00319         if (key1 == NULL) {
    -00320                 map->key = NULL;
    +00320                 map->key = NULL;
     00321                 return;
     00322         }
     00323 
     00324         hv = mixed_hash(key1, key2);
    -00325         head = &map->hashes[hv];
    +00325         head = &map->hashes[hv];
     00326 
     00327         dbug ("hash for %s,%ld is %d\n", key1, key2, hv);
     00328 
    @@ -274,19 +274,19 @@
     00331                         (struct map_node *)((long)e - sizeof(struct hlist_node));
     00332                 dbug ("e =%lx  key=%s,%ld\n", (long)e, n->key1.str,(long)n->key2.val);
     00333                 if (strcmp(key1, n->key1.str) == 0 && key2 == n->key2.val) {
    -00334                         map->key = n;
    -00335                         dbug ("saving key %lx\n", (long)map->key);
    -00336                         map->create = 0;
    +00334                         map->key = n;
    +00335                         dbug ("saving key %lx\n", (long)map->key);
    +00336                         map->create = 0;
     00337                         return;
     00338                 }
     00339         }
     00340 
    -00341         map->c_key1.str = key1;
    -00342         map->c_key2.val = key2;
    -00343         map->c_key1type = STR;
    -00344         map->c_key2type = LONG;
    -00345         map->c_keyhead = head;
    -00346         map->create = 1;
    +00341         map->c_key1.str = key1;
    +00342         map->c_key2.val = key2;
    +00343         map->c_key1type = STR;
    +00344         map->c_key2type = LONG;
    +00345         map->c_keyhead = head;
    +00346         map->create = 1;
     00347 }
     00348 
     00358 void _stp_map_key_long_str(MAP map, long key1, char *key2)
    @@ -299,7 +299,7 @@
     00365                 return;
     00366 
     00367         hv = mixed_hash(key2, key1);
    -00368         head = &map->hashes[hv];
    +00368         head = &map->hashes[hv];
     00369         dbug ("hash for %ld,%s is %d\n", key1, key2, hv);
     00370 
     00371         hlist_for_each(e, head) {
    @@ -307,19 +307,19 @@
     00373                         (struct map_node *)((long)e - sizeof(struct hlist_node));
     00374                 dbug ("e =%lx  key=%ld,%s\n", (long)e, n->key1.val,n->key2.str);
     00375                 if (key1 == n->key1.val && strcmp(key2, n->key2.str) == 0) {
    -00376                         map->key = n;
    -00377                         dbug ("saving key %lx\n", (long)map->key);
    -00378                         map->create = 0;
    +00376                         map->key = n;
    +00377                         dbug ("saving key %lx\n", (long)map->key);
    +00378                         map->create = 0;
     00379                         return;
     00380                 }
     00381         }
     00382 
    -00383         map->c_key1.val = key1;
    -00384         map->c_key2.str = key2;
    -00385         map->c_key1type = LONG;
    -00386         map->c_key2type = STR;
    -00387         map->c_keyhead = head;
    -00388         map->create = 1;
    +00383         map->c_key1.val = key1;
    +00384         map->c_key2.str = key2;
    +00385         map->c_key1type = LONG;
    +00386         map->c_key2type = STR;
    +00387         map->c_keyhead = head;
    +00388         map->create = 1;
     00389 }
     00390 
     00399 void _stp_map_key_str(MAP map, char *key)
    @@ -327,7 +327,7 @@
     00401         if (map == NULL)
     00402                 return;
     00403         _stp_map_key_str_str(map, key, NULL);
    -00404         map->c_key2type = NONE;
    +00404         map->c_key2type = NONE;
     00405 }
     00406 
     00415 void _stp_map_key_long(MAP map, long key)
    @@ -335,327 +335,341 @@
     00417         if (map == NULL)
     00418                 return;
     00419         _stp_map_key_long_long(map, key, 0);
    -00420         map->c_key2type = NONE;
    +00420         map->c_key2type = NONE;
     00421 }
     00422 
     00423 /**********************  SET/GET VALUES *********************/
     00424 
     00425 static void map_copy_keys(MAP map, struct map_node *m)
     00426 {
    -00427         m->key1type = map->c_key1type;
    -00428         m->key2type = map->c_key2type;
    -00429         switch (map->c_key1type) {
    +00427         m->key1type = map->c_key1type;
    +00428         m->key2type = map->c_key2type;
    +00429         switch (map->c_key1type) {
     00430         case STR:
    -00431                 m->key1.str = _stp_alloc(strlen(map->c_key1.str) + 1);
    -00432                 strcpy(m->key1.str, map->c_key1.str);
    +00431                 m->key1.str = _stp_alloc(strlen(map->c_key1.str) + 1);
    +00432                 strcpy(m->key1.str, map->c_key1.str);
     00433                 break;
     00434         case LONG:
    -00435                 m->key1.val = map->c_key1.val;
    +00435                 m->key1.val = map->c_key1.val;
     00436                 break;
     00437         case NONE:
     00438                 /* ERROR */
     00439                 break;
     00440         }
    -00441         switch (map->c_key2type) {
    +00441         switch (map->c_key2type) {
     00442         case STR:
    -00443                 m->key2.str = _stp_alloc(strlen(map->c_key2.str) + 1);
    -00444                 strcpy(m->key2.str, map->c_key2.str);
    +00443                 m->key2.str = _stp_alloc(strlen(map->c_key2.str) + 1);
    +00444                 strcpy(m->key2.str, map->c_key2.str);
     00445                 break;
     00446         case LONG:
    -00447                 m->key2.val = map->c_key2.val;
    +00447                 m->key2.val = map->c_key2.val;
     00448                 break;
     00449         case NONE:
     00450                 break;
     00451         }
     00452 
     00453         /* add node to new hash list */
    -00454         hlist_add_head(&m->hnode, map->c_keyhead);
    +00454         hlist_add_head(&m->hnode, map->c_keyhead);
     00455         
    -00456         map->key = m;
    -00457         map->create = 0;
    -00458         map->num++;
    +00456         map->key = m;
    +00457         map->create = 0;
    +00458         map->num++;
     00459 }
     00460 
    -00471 void _stp_map_set_int64(MAP map, int64_t val)
    -00472 {
    -00473         struct map_node_int64 *m;
    -00474 
    -00475         if (map == NULL)
    -00476                 return;
    -00477 
    -00478         if (map->create) {
    -00479                 if (val == 0)
    -00480                         return;
    -00481 
    -00482                 if (map->maxnum) {
    -00483                         if (list_empty(&map->pool)) {
    -00484                                 if (map->no_wrap) {
    -00485                                         /* ERROR. FIXME */
    -00486                                         return;
    -00487                                 }
    -00488                                 m = (struct map_node_int64 *)map->head.next;
    -00489                                 hlist_del_init(&m->n.hnode);
    -00490                                 map_free_strings(map, (struct map_node *)m);
    -00491                                 dbug ("got %lx off head\n", (long)m);
    -00492                         } else {
    -00493                                 m = (struct map_node_int64 *)map->pool.next;
    -00494                                 dbug ("got %lx off pool\n", (long)m);
    -00495                         }
    -00496                         list_move_tail(&m->n.lnode, &map->head);
    -00497                 } else {
    -00498                         m = (struct map_node_int64 *)
    -00499                             _stp_calloc(sizeof(struct map_node_int64));
    -00500                         /* add node to list */
    -00501                         list_add_tail(&m->n.lnode, &map->head);
    -00502                 }
    -00503 
    -00504                 /* copy the key(s) */
    -00505                 map_copy_keys(map, &m->n);
    -00506 
    -00507                 /* set the value */
    -00508                 m->val = val;
    -00509         } else {
    -00510                 if (map->key == NULL)
    -00511                         return;
    -00512 
    -00513                 if (val) {
    -00514                         m = (struct map_node_int64 *)map->key;
    -00515                         m->val = val;
    -00516                 } else {
    -00517                         /* setting value to 0 is the same as deleting */
    -00518                         _stp_map_key_del(map);
    -00519                 }
    -00520         }
    -00521 }
    -00522 
    -00528 int64_t _stp_map_get_int64(MAP map)
    -00529 {
    -00530         struct map_node_int64 *m;
    -00531         if (map == NULL || map->create || map->key == NULL)
    -00532                 return 0;
    -00533         dbug ("%lx\n", (long)map->key);
    -00534         m = (struct map_node_int64 *)map->key;
    -00535         return m->val;
    -00536 }
    -00537 
    -00548 void _stp_map_set_str(MAP map, char *val)
    -00549 {
    -00550         struct map_node_str *m;
    -00551 
    -00552         if (map == NULL)
    -00553                 return;
    -00554 
    -00555         if (map->create) {
    -00556                 if (val == NULL)
    -00557                         return;
    -00558 
    -00559                 if (map->maxnum) {
    -00560                         if (list_empty(&map->pool)) {
    -00561                                 if (map->no_wrap) {
    -00562                                         /* ERROR. FIXME */
    -00563                                         return;
    -00564                                 }
    -00565                                 m = (struct map_node_str *)map->head.next;
    -00566                                 hlist_del_init(&m->n.hnode);
    -00567                                 map_free_strings(map, (struct map_node *)m);
    -00568                                 dbug ("got %lx off head\n", (long)m);
    -00569                         } else {
    -00570                                 m = (struct map_node_str *)map->pool.next;
    -00571                                 dbug ("got %lx off pool\n", (long)m);
    -00572                         }
    -00573                         list_move_tail(&m->n.lnode, &map->head);
    -00574                 } else {
    -00575                         m = (struct map_node_str *)
    -00576                             _stp_calloc(sizeof(struct map_node_str));
    -00577                         /* add node to list */
    -00578                         list_add_tail(&m->n.lnode, &map->head);
    -00579                 }
    -00580 
    -00581                 /* copy the key(s) */
    -00582                 map_copy_keys(map, &m->n);
    -00583 
    -00584                 /* set the value */
    -00585                 m->str = _stp_alloc(strlen(val) + 1);
    -00586                 strcpy(m->str, val);
    -00587         } else {
    -00588                 if (map->key == NULL)
    -00589                         return;
    -00590 
    -00591                 if (val) {
    -00592                         m = (struct map_node_str *)map->key;
    -00593                         if (m->str)
    -00594                                 _stp_free(m->str);
    -00595                         m->str = _stp_alloc(strlen(val) + 1);
    -00596                         strcpy(m->str, val);
    +00461 static void __stp_map_set_int64(MAP map, int64_t val, int add)
    +00462 {
    +00463         struct map_node_int64 *m;
    +00464 
    +00465         if (map == NULL)
    +00466                 return;
    +00467 
    +00468         if (map->create) {
    +00469                 if (val == 0)
    +00470                         return;
    +00471 
    +00472                 if (map->maxnum) {
    +00473                         if (list_empty(&map->pool)) {
    +00474                                 if (map->no_wrap) {
    +00475                                         /* ERROR. FIXME */
    +00476                                         return;
    +00477                                 }
    +00478                                 m = (struct map_node_int64 *)map->head.next;
    +00479                                 hlist_del_init(&m->n.hnode);
    +00480                                 map_free_strings(map, (struct map_node *)m);
    +00481                                 dbug ("got %lx off head\n", (long)m);
    +00482                         } else {
    +00483                                 m = (struct map_node_int64 *)map->pool.next;
    +00484                                 dbug ("got %lx off pool\n", (long)m);
    +00485                         }
    +00486                         list_move_tail(&m->n.lnode, &map->head);
    +00487                 } else {
    +00488                         m = (struct map_node_int64 *)
    +00489                             _stp_calloc(sizeof(struct map_node_int64));
    +00490                         /* add node to list */
    +00491                         list_add_tail(&m->n.lnode, &map->head);
    +00492                 }
    +00493 
    +00494                 /* copy the key(s) */
    +00495                 map_copy_keys(map, &m->n);
    +00496 
    +00497                 /* set the value */
    +00498                 m->val = val;
    +00499         } else {
    +00500                 if (map->key == NULL)
    +00501                         return;
    +00502 
    +00503                 if (val) {
    +00504                         m = (struct map_node_int64 *)map->key;
    +00505                         if (add)
    +00506                                 m->val += val;
    +00507                         else
    +00508                                 m->val = val;
    +00509                 } else if (!add) {
    +00510                         /* setting value to 0 is the same as deleting */
    +00511                         _stp_map_key_del(map);
    +00512                 }
    +00513         }
    +00514 }
    +00515 
    +00525 void _stp_map_set_int64(MAP map, int64_t val)
    +00526 {
    +00527         __stp_map_set_int64 (map, val, 0);
    +00528 }
    +00529 
    +00530 
    +00541 void _stp_map_add_int64(MAP map, int64_t val)
    +00542 {
    +00543         __stp_map_set_int64 (map, val, 1);
    +00544 }
    +00545 
    +00551 int64_t _stp_map_get_int64(MAP map)
    +00552 {
    +00553         struct map_node_int64 *m;
    +00554         if (map == NULL || map->create || map->key == NULL)
    +00555                 return 0;
    +00556         dbug ("%lx\n", (long)map->key);
    +00557         m = (struct map_node_int64 *)map->key;
    +00558         return m->val;
    +00559 }
    +00560 
    +00571 void _stp_map_set_str(MAP map, char *val)
    +00572 {
    +00573         struct map_node_str *m;
    +00574 
    +00575         if (map == NULL)
    +00576                 return;
    +00577 
    +00578         if (map->create) {
    +00579                 if (val == NULL)
    +00580                         return;
    +00581 
    +00582                 if (map->maxnum) {
    +00583                         if (list_empty(&map->pool)) {
    +00584                                 if (map->no_wrap) {
    +00585                                         /* ERROR. FIXME */
    +00586                                         return;
    +00587                                 }
    +00588                                 m = (struct map_node_str *)map->head.next;
    +00589                                 hlist_del_init(&m->n.hnode);
    +00590                                 map_free_strings(map, (struct map_node *)m);
    +00591                                 dbug ("got %lx off head\n", (long)m);
    +00592                         } else {
    +00593                                 m = (struct map_node_str *)map->pool.next;
    +00594                                 dbug ("got %lx off pool\n", (long)m);
    +00595                         }
    +00596                         list_move_tail(&m->n.lnode, &map->head);
     00597                 } else {
    -00598                         /* setting value to 0 is the same as deleting */
    -00599                         _stp_map_key_del(map);
    -00600                 }
    -00601         }
    -00602 }
    +00598                         m = (struct map_node_str *)
    +00599                             _stp_calloc(sizeof(struct map_node_str));
    +00600                         /* add node to list */
    +00601                         list_add_tail(&m->n.lnode, &map->head);
    +00602                 }
     00603 
    -00609 char *_stp_map_get_str(MAP map)
    -00610 {
    -00611         struct map_node_str *m;
    -00612         if (map == NULL || map->create || map->key == NULL)
    -00613                 return NULL;
    -00614         dbug ("%lx\n", (long)map->key);
    -00615         m = (struct map_node_str *)map->key;
    -00616         return m->str;
    -00617 }
    -00618 
    -00633 void _stp_map_set_stat(MAP map, stat * stats)
    -00634 {
    -00635         struct map_node_stat *m;
    -00636 
    -00637         if (map == NULL)
    -00638                 return;
    -00639         dbug ("set_stat %lx\n", (long)map->key);
    -00640 
    -00641         if (map->create) {
    -00642                 if (stats == NULL)
    -00643                         return;
    -00644 
    -00645                 if (map->maxnum) {
    -00646                         if (list_empty(&map->pool)) {
    -00647                                 if (map->no_wrap) {
    -00648                                         /* ERROR. FIXME */
    -00649                                         return;
    -00650                                 }
    -00651                                 m = (struct map_node_stat *)map->head.next;
    -00652                                 hlist_del_init(&m->n.hnode);
    -00653                                 map_free_strings(map, (struct map_node *)m);
    -00654                                 dbug ("got %lx off head\n", (long)m);
    -00655                         } else {
    -00656                                 m = (struct map_node_stat *)map->pool.next;
    -00657                                 dbug ("got %lx off pool\n", (long)m);
    -00658                         }
    -00659                         list_move_tail(&m->n.lnode, &map->head);
    -00660                 } else {
    -00661                         m = (struct map_node_stat *)
    -00662                             _stp_calloc(sizeof(struct map_node_stat));
    -00663                         /* add node to list */
    -00664                         list_add_tail(&m->n.lnode, &map->head);
    -00665                 }
    -00666 
    -00667                 /* copy the key(s) */
    -00668                 map_copy_keys(map, &m->n);
    -00669 
    -00670                 /* set the value */
    -00671                 memcpy(&m->stats, stats, sizeof(stat));
    -00672         } else {
    -00673                 if (map->key == NULL)
    -00674                         return;
    -00675 
    -00676                 if (stats) {
    -00677                         m = (struct map_node_stat *)map->key;
    -00678                         memcpy(&m->stats, stats, sizeof(stat));
    -00679                 } else {
    -00680                         /* setting value to NULL is the same as deleting */
    -00681                         _stp_map_key_del(map);
    -00682                 }
    -00683         }
    -00684 }
    -00685 
    -00692 stat *_stp_map_get_stat(MAP map)
    -00693 {
    -00694         struct map_node_stat *m;
    -00695         if (map == NULL || map->create || map->key == NULL)
    -00696                 return NULL;
    -00697         dbug ("%lx\n", (long)map->key);
    -00698         m = (struct map_node_stat *)map->key;
    -00699         return &m->stats;
    -00700 }
    -00701 
    -00713 void _stp_map_stat_add(MAP map, int64_t val)
    -00714 {
    -00715         struct map_node_stat *m;
    -00716         if (map == NULL)
    -00717                 return;
    -00718 
    -00719         if (map->create) {
    -00720                 stat st = { 1, val, val, val };
    -00721                 /* histogram */
    -00722                 _stp_map_set_stat(map, &st);
    -00723                 return;
    -00724         }
    -00725 
    -00726         if (map->key == NULL)
    -00727                 return;
    -00728 
    -00729         dbug ("add_stat %lx\n", (long)map->key);
    -00730         m = (struct map_node_stat *)map->key;
    -00731         m->stats.count++;
    -00732         m->stats.sum += val;
    -00733         if (val > m->stats.max)
    -00734                 m->stats.max = val;
    -00735         if (val < m->stats.min)
    -00736                 m->stats.min = val;
    -00737         /* histogram */
    -00738 }
    -00739 
    -00740 /**********************  List Functions *********************/
    +00604                 /* copy the key(s) */
    +00605                 map_copy_keys(map, &m->n);
    +00606 
    +00607                 /* set the value */
    +00608                 m->str = _stp_alloc(strlen(val) + 1);
    +00609                 strcpy(m->str, val);
    +00610         } else {
    +00611                 if (map->key == NULL)
    +00612                         return;
    +00613 
    +00614                 if (val) {
    +00615                         m = (struct map_node_str *)map->key;
    +00616                         if (m->str)
    +00617                                 _stp_free(m->str);
    +00618                         m->str = _stp_alloc(strlen(val) + 1);
    +00619                         strcpy(m->str, val);
    +00620                 } else {
    +00621                         /* setting value to 0 is the same as deleting */
    +00622                         _stp_map_key_del(map);
    +00623                 }
    +00624         }
    +00625 }
    +00626 
    +00632 char *_stp_map_get_str(MAP map)
    +00633 {
    +00634         struct map_node_str *m;
    +00635         if (map == NULL || map->create || map->key == NULL)
    +00636                 return NULL;
    +00637         dbug ("%lx\n", (long)map->key);
    +00638         m = (struct map_node_str *)map->key;
    +00639         return m->str;
    +00640 }
    +00641 
    +00656 void _stp_map_set_stat(MAP map, stat * stats)
    +00657 {
    +00658         struct map_node_stat *m;
    +00659 
    +00660         if (map == NULL)
    +00661                 return;
    +00662         dbug ("set_stat %lx\n", (long)map->key);
    +00663 
    +00664         if (map->create) {
    +00665                 if (stats == NULL)
    +00666                         return;
    +00667 
    +00668                 if (map->maxnum) {
    +00669                         if (list_empty(&map->pool)) {
    +00670                                 if (map->no_wrap) {
    +00671                                         /* ERROR. FIXME */
    +00672                                         return;
    +00673                                 }
    +00674                                 m = (struct map_node_stat *)map->head.next;
    +00675                                 hlist_del_init(&m->n.hnode);
    +00676                                 map_free_strings(map, (struct map_node *)m);
    +00677                                 dbug ("got %lx off head\n", (long)m);
    +00678                         } else {
    +00679                                 m = (struct map_node_stat *)map->pool.next;
    +00680                                 dbug ("got %lx off pool\n", (long)m);
    +00681                         }
    +00682                         list_move_tail(&m->n.lnode, &map->head);
    +00683                 } else {
    +00684                         m = (struct map_node_stat *)
    +00685                             _stp_calloc(sizeof(struct map_node_stat));
    +00686                         /* add node to list */
    +00687                         list_add_tail(&m->n.lnode, &map->head);
    +00688                 }
    +00689 
    +00690                 /* copy the key(s) */
    +00691                 map_copy_keys(map, &m->n);
    +00692 
    +00693                 /* set the value */
    +00694                 memcpy(&m->stats, stats, sizeof(stat));
    +00695         } else {
    +00696                 if (map->key == NULL)
    +00697                         return;
    +00698 
    +00699                 if (stats) {
    +00700                         m = (struct map_node_stat *)map->key;
    +00701                         memcpy(&m->stats, stats, sizeof(stat));
    +00702                 } else {
    +00703                         /* setting value to NULL is the same as deleting */
    +00704                         _stp_map_key_del(map);
    +00705                 }
    +00706         }
    +00707 }
    +00708 
    +00715 stat *_stp_map_get_stat(MAP map)
    +00716 {
    +00717         struct map_node_stat *m;
    +00718         if (map == NULL || map->create || map->key == NULL)
    +00719                 return NULL;
    +00720         dbug ("%lx\n", (long)map->key);
    +00721         m = (struct map_node_stat *)map->key;
    +00722         return &m->stats;
    +00723 }
    +00724 
    +00736 void _stp_map_stat_add(MAP map, int64_t val)
    +00737 {
    +00738         struct map_node_stat *m;
    +00739         if (map == NULL)
    +00740                 return;
     00741 
    -00753 MAP _stp_list_new(unsigned max_entries, enum valtype type)
    -00754 {
    -00755   MAP map = _stp_map_new (max_entries, type);
    -00756   map->no_wrap = 1;
    -00757   return map;
    -00758 }
    -00759 
    -00765 inline void _stp_list_clear(MAP map)
    -00766 {
    -00767         if (map == NULL)
    -00768                 return;
    -00769 
    -00770         if (!list_empty(&map->head)) {
    -00771                 struct map_node *ptr = (struct map_node *)map->head.next;
    -00772 
    -00773                 while (ptr && ptr != (struct map_node *)&map->head) {
    -00774                         struct map_node *next = (struct map_node *)ptr->lnode.next;
    -00775 
    -00776                         /* remove node from old hash list */
    -00777                         hlist_del_init(&ptr->hnode);
    -00778 
    -00779                         /* remove from entry list */
    -00780                         list_del(&ptr->lnode);
    -00781                         
    -00782                         /* remove any allocated string storage */
    -00783                         map_free_strings(map, ptr);
    -00784                         
    -00785                         if (map->maxnum)
    -00786                                 list_add(&ptr->lnode, &map->pool);
    -00787                         else
    -00788                                 _stp_free(ptr);
    -00789 
    -00790                         map->num--;
    -00791                         ptr = next;
    -00792                 }
    -00793         }
    -00794 
    -00795         if (map->num != 0) {
    -00796                 dlog ("ERROR: list is supposed to be empty (has %d)\n", map->num);
    -00797         }
    -00798 }
    -00799 
    -00805 inline void _stp_list_add_str(MAP map, char *str)
    -00806 {
    -00807         _stp_map_key_long(map, map->num);
    -00808         _stp_map_set_str(map, str);
    -00809 }
    -00810 
    -00816 inline void _stp_list_add_int64(MAP map, int64_t val)
    -00817 {
    -00818         _stp_map_key_long(map, map->num);
    -00819         _stp_map_set_int64(map, val);
    -00820 }
    -00821 
    -00827 inline int _stp_list_size(MAP map)
    -00828 {
    -00829         return map->num;
    -00830 }
    -

    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +00742 if (map->create) { +00743 stat st = { 1, val, val, val }; +00744 /* histogram */ +00745 _stp_map_set_stat(map, &st); +00746 return; +00747 } +00748 +00749 if (map->key == NULL) +00750 return; +00751 +00752 dbug ("add_stat %lx\n", (long)map->key); +00753 m = (struct map_node_stat *)map->key; +00754 m->stats.count++; +00755 m->stats.sum += val; +00756 if (val > m->stats.max) +00757 m->stats.max = val; +00758 if (val < m->stats.min) +00759 m->stats.min = val; +00760 /* histogram */ +00761 } +00762 +00763 /********************** List Functions *********************/ +00764 +00776 MAP _stp_list_new(unsigned max_entries, enum valtype type) +00777 { +00778 MAP map = _stp_map_new (max_entries, type); +00779 map->no_wrap = 1; +00780 return map; +00781 } +00782 +00788 inline void _stp_list_clear(MAP map) +00789 { +00790 if (map == NULL) +00791 return; +00792 +00793 if (!list_empty(&map->head)) { +00794 struct map_node *ptr = (struct map_node *)map->head.next; +00795 +00796 while (ptr && ptr != (struct map_node *)&map->head) { +00797 struct map_node *next = (struct map_node *)ptr->lnode.next; +00798 +00799 /* remove node from old hash list */ +00800 hlist_del_init(&ptr->hnode); +00801 +00802 /* remove from entry list */ +00803 list_del(&ptr->lnode); +00804 +00805 /* remove any allocated string storage */ +00806 map_free_strings(map, ptr); +00807 +00808 if (map->maxnum) +00809 list_add(&ptr->lnode, &map->pool); +00810 else +00811 _stp_free(ptr); +00812 +00813 map->num--; +00814 ptr = next; +00815 } +00816 } +00817 +00818 if (map->num != 0) { +00819 dlog ("ERROR: list is supposed to be empty (has %d)\n", map->num); +00820 } +00821 } +00822 +00828 inline void _stp_list_add_str(MAP map, char *str) +00829 { +00830 _stp_map_key_long(map, map->num); +00831 _stp_map_set_str(map, str); +00832 } +00833 +00839 inline void _stp_list_add_int64(MAP map, int64_t val) +00840 { +00841 _stp_map_key_long(map, map->num); +00842 _stp_map_set_int64(map, val); +00843 } +00844 +00850 inline int _stp_list_size(MAP map) +00851 { +00852 return map->num; +00853 } +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/map_8c.html b/runtime/docs/html/map_8c.html index d4982cac8..d69f77a8d 100644 --- a/runtime/docs/html/map_8c.html +++ b/runtime/docs/html/map_8c.html @@ -5,7 +5,7 @@ - +

    map.c File Reference

    Go to the source code of this file. @@ -44,46 +44,49 @@ - + - - + + - - - - - + + - + - - + + - + + + + + + + - - + + - - + + - - + + - - + + - - + + - +
    void _stp_map_key_long (MAP map, long key)
     Set the map's key to a long.
    void _stp_map_set_int64 (MAP map, int64_t val)
    void _stp_map_set_int64 (MAP map, int64_t val)
     Set the current element's value to an int64.
    int64_t _stp_map_get_int64 (MAP map)
     Set the current element's value to an int64.
    void _stp_map_add_int64 (MAP map, int64_t val)
     Gets the current element's value.
    void _stp_map_set_str (MAP map, char *val)
     Set the current element's value to a string.
    char * _stp_map_get_str (MAP map)
     Adds an int64 to the current element's value.
    int64_t _stp_map_get_int64 (MAP map)
     Gets the current element's value.
    void _stp_map_set_stat (MAP map, stat *stats)
    void _stp_map_set_str (MAP map, char *val)
     Set the current element's value to a stat.
    stat_stp_map_get_stat (MAP map)
     Set the current element's value to a string.
    char * _stp_map_get_str (MAP map)
     Gets the current element's value.
    void _stp_map_stat_add (MAP map, int64_t val)
    void _stp_map_set_stat (MAP map, stat *stats)
     Set the current element's value to a stat.
    stat_stp_map_get_stat (MAP map)
     Gets the current element's value.
    void _stp_map_stat_add (MAP map, int64_t val)
     Add to the current element's statistics.
    MAP _stp_list_new (unsigned max_entries, enum valtype type)
     Add to the current element's statistics.
    MAP _stp_list_new (unsigned max_entries, enum valtype type)
     Create a new list.
    void _stp_list_clear (MAP map)
     Create a new list.
    void _stp_list_clear (MAP map)
     Clears a list.
    void _stp_list_add_str (MAP map, char *str)
     Clears a list.
    void _stp_list_add_str (MAP map, char *str)
     Adds a string to a list.
    void _stp_list_add_int64 (MAP map, int64_t val)
     Adds a string to a list.
    void _stp_list_add_int64 (MAP map, int64_t val)
     Adds an int64 to a list.
    int _stp_list_size (MAP map)
     Adds an int64 to a list.
    int _stp_list_size (MAP map)
     Get the number of elements in a list.
     Get the number of elements in a list.


    Function Documentation

    -

    - +

    +

    @@ -126,13 +129,13 @@ Adds an int64 to a list.

    -Definition at line 816 of file map.c. +Definition at line 839 of file map.c.

    -References _stp_map_key_long(), _stp_map_set_int64(), MAP, and map_root::num. +References _stp_map_key_long(), _stp_map_set_int64(), and map_root::num.

    -

    - +

    +

    @@ -175,15 +178,15 @@ Adds a string to a list.

    -Definition at line 805 of file map.c. +Definition at line 828 of file map.c.

    -References _stp_map_key_long(), _stp_map_set_str(), MAP, and map_root::num. +References _stp_map_key_long(), _stp_map_set_str(), and map_root::num.

    Referenced by _stp_copy_argv_from_user().

    -

    - +

    +

    @@ -216,13 +219,13 @@ All elements in the list are deleted.
    Parameters:

    -Definition at line 765 of file map.c. +Definition at line 788 of file map.c.

    -References _stp_free(), dlog(), map_root::head, map_node::hnode, map_node::lnode, MAP, map_root::maxnum, map_root::num, and map_root::pool. +References _stp_free(), dlog(), map_root::head, map_node::hnode, map_node::lnode, map_root::maxnum, map_root::num, and map_root::pool.

    -

    - +

    +

    @@ -267,13 +270,13 @@ A list is a map that internally has an incrementing long key for each member. Li
    See also:
    foreach

    -Definition at line 753 of file map.c. +Definition at line 776 of file map.c.

    -References _stp_map_new(), MAP, and map_root::no_wrap. +References _stp_map_new(), and map_root::no_wrap.

    -

    - +

    +

    @@ -307,13 +310,61 @@ Get the number of elements in a list.
    Returns:
    The number of elements in a list.

    -Definition at line 827 of file map.c. +Definition at line 850 of file map.c.

    -References MAP, and map_root::num. +References map_root::num. + +

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    void _stp_map_add_int64 MAP  map,
    int64_t  val
    +
    + + + +
    +   + + +

    +Adds an int64 to the current element's value. +

    +This adds an int64 to the current element's value. The map must have been created to hold int64s using _stp_map_new()

    +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.

    Parameters:
    + + + +
    map 
    val value
    +
    + +

    +Definition at line 541 of file map.c.

    - +
    @@ -348,11 +399,11 @@ Deletes a map, freeing all memory in all elements. Normally done only when the m

    Definition at line 190 of file map.c.

    -References _stp_vfree(), map_root::head, map_node::lnode, MAP, and map_root::membuf. +References _stp_vfree(), map_root::head, map_node::lnode, and map_root::membuf.

    -

    - +

    +

    @@ -386,13 +437,13 @@ Gets the current element's value.
    Returns:
    The value. If the current element is not set or doesn't exist, returns 0.

    -Definition at line 528 of file map.c. +Definition at line 551 of file map.c.

    -References map_root::create, dbug, map_root::key, MAP, and map_node_int64::val. +References map_root::create, dbug, map_root::key, and map_node_int64::val.

    -

    - +

    +

    @@ -426,13 +477,13 @@ Gets the current element's value.
    Returns:
    A pointer to the stats struct. If the current element is not set or doesn't exist, returns NULL.

    -Definition at line 692 of file map.c. +Definition at line 715 of file map.c.

    -References map_root::create, dbug, map_root::key, MAP, and map_node_stat::stats. +References map_root::create, dbug, map_root::key, and map_node_stat::stats.

    -

    - +

    +

    @@ -466,13 +517,13 @@ Gets the current element's value.
    Returns:
    A string pointer. If the current element is not set or doesn't exist, returns NULL.

    -Definition at line 609 of file map.c. +Definition at line 632 of file map.c.

    -References map_root::create, dbug, map_root::key, MAP, and map_node_str::str. +References map_root::create, dbug, map_root::key, and map_node_str::str.

    - +
    @@ -519,11 +570,11 @@ Get the next element in a map.

    Definition at line 172 of file map.c.

    -References dbug, map_root::head, map_node::lnode, and MAP. +References dbug, map_root::head, and map_node::lnode.

    - +
    @@ -558,13 +609,13 @@ If no current element (key) for this map is set, this function does nothing.
    Definition at line 104 of file map.c.

    -References _stp_free(), map_root::create, dbug, map_node::hnode, map_root::key, map_node::lnode, MAP, map_root::maxnum, map_root::num, and map_root::pool. +References _stp_free(), dbug, map_node::hnode, and map_node::lnode.

    -Referenced by _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_map_set_stat(), and _stp_map_set_str().

    - +
    @@ -609,13 +660,13 @@ This sets the current element based on a long key. If the key is not found, a ne

    Definition at line 415 of file map.c.

    -References _stp_map_key_long_long(), and MAP. +References _stp_map_key_long_long(), map_root::c_key2type, and NONE.

    -Referenced by _stp_list_add_int64(), and _stp_list_add_str(). +Referenced by _stp_list_add_int64(), and _stp_list_add_str().

    - +
    @@ -667,13 +718,13 @@ This sets the current element based on a key of two strings. If the keys are not

    Definition at line 218 of file map.c.

    -References map_root::c_key1, map_root::c_key2, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, MAP, and key_data::val. +References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, LONG, and key_data::val.

    Referenced by _stp_map_key_long().

    - +
    @@ -725,11 +776,11 @@ This sets the current element based on a key of a long and a string. If the keys

    Definition at line 358 of file map.c.

    -References map_root::c_key1, map_root::c_key2, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, MAP, key_data::str, and key_data::val. +References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, LONG, STR, key_data::str, and key_data::val.

    - +
    @@ -774,11 +825,11 @@ This sets the current element based on a string key. If the key is not found, a

    Definition at line 399 of file map.c.

    -References _stp_map_key_str_str(), and MAP. +References _stp_map_key_str_str(), map_root::c_key2type, and NONE.

    - +
    @@ -830,11 +881,11 @@ This sets the current element based on a key of a string and a long. If the keys

    Definition at line 310 of file map.c.

    -References map_root::c_key1, map_root::c_key2, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, MAP, key_data::str, and key_data::val. +References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, LONG, STR, key_data::str, and key_data::val.

    - +
    @@ -886,13 +937,13 @@ This sets the current element based on a key of two strings. If the keys are not

    Definition at line 261 of file map.c.

    -References map_root::c_key1, map_root::c_key2, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, MAP, and key_data::str. +References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, dbug, map_root::hashes, map_root::key, map_node::key1, map_node::key2, STR, and key_data::str.

    Referenced by _stp_map_key_str().

    - +
    @@ -938,13 +989,13 @@ Maps must be created at module initialization time.
    Parameter

    Definition at line 43 of file map.c.

    -References _stp_valloc(), dbug, map_root::head, MAP, map_root::maxnum, map_root::membuf, and map_root::pool. +References _stp_valloc(), dbug, END, map_root::head, map_root::maxnum, map_root::membuf, map_root::pool, and map_root::type.

    -Referenced by _stp_list_new(). +Referenced by _stp_list_new().

    -

    - +

    +

    @@ -988,15 +1039,13 @@ If the element doesn't exist, it is created. If no current element (key) is set

    -Definition at line 471 of file map.c. -

    -References _stp_calloc(), _stp_map_key_del(), map_root::create, dbug, map_root::head, map_node::hnode, map_root::key, map_node::lnode, MAP, map_root::maxnum, map_node_int64::n, map_root::no_wrap, map_root::pool, and map_node_int64::val. +Definition at line 525 of file map.c.

    -Referenced by _stp_list_add_int64(). +Referenced by _stp_list_add_int64().

    -

    - +

    +

    @@ -1031,7 +1080,7 @@ Referenced by _stp_list_add_int64

    Set the current element's value to a stat.

    -This sets the current element's value to an stat struct. The map must have been created to hold stats using _stp_map_new(xxx, STAT). 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.

    See also:
    _stp_map_stat_add
    +This sets the current element's value to an stat struct. The map must have been created to hold stats using _stp_map_new(xxx, STAT). 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.
    See also:
    _stp_map_stat_add
    If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.
    Parameters:
    @@ -1041,15 +1090,15 @@ If the element doesn't exist, it is created. If no current element (key) is set
    Todo:
    Histograms don't work yet.

    -Definition at line 633 of file map.c. +Definition at line 656 of file map.c.

    -References _stp_calloc(), _stp_map_key_del(), map_root::create, dbug, map_root::head, map_node::hnode, map_root::key, map_node::lnode, MAP, map_root::maxnum, map_node_stat::n, map_root::no_wrap, map_root::pool, and map_node_stat::stats. +References _stp_calloc(), _stp_map_key_del(), map_root::create, dbug, map_root::head, map_node::hnode, map_root::key, map_node::lnode, map_root::maxnum, map_node_stat::n, map_root::no_wrap, map_root::pool, and map_node_stat::stats.

    -Referenced by _stp_map_stat_add(). +Referenced by _stp_map_stat_add().

    map 
    -

    - +

    +

    @@ -1093,15 +1142,15 @@ If the element doesn't exist, it is created. If no current element (key) is set

    -Definition at line 548 of file map.c. +Definition at line 571 of file map.c.

    -References _stp_alloc(), _stp_calloc(), _stp_free(), _stp_map_key_del(), map_root::create, dbug, map_root::head, map_node::hnode, map_root::key, map_node::lnode, MAP, map_root::maxnum, map_node_str::n, map_root::no_wrap, map_root::pool, and map_node_str::str. +References _stp_alloc(), _stp_calloc(), _stp_free(), _stp_map_key_del(), map_root::create, dbug, map_root::head, map_node::hnode, map_root::key, map_node::lnode, map_root::maxnum, map_node_str::n, map_root::no_wrap, map_root::pool, and map_node_str::str.

    -Referenced by _stp_list_add_str(). +Referenced by _stp_list_add_str().

    - +
    @@ -1138,11 +1187,11 @@ Get the first element in a map.

    Definition at line 149 of file map.c.

    -References dbug, map_root::head, and MAP. +References dbug, and map_root::head.

    -

    - +

    +

    @@ -1187,13 +1236,13 @@ If the element doesn't exist, it is created. If no current element (key) is set
    Todo:
    Histograms don't work yet.

    -Definition at line 713 of file map.c. +Definition at line 736 of file map.c.

    -References _stp_map_set_stat(), stat::count, map_root::create, dbug, map_root::key, MAP, stat::max, stat::min, map_node_stat::stats, and stat::sum. +References _stp_map_set_stat(), stat::count, map_root::create, dbug, map_root::key, stat::max, stat::min, map_node_stat::stats, and stat::sum.

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/map_8h-source.html b/runtime/docs/html/map_8h-source.html index 9a49236c5..7ecc890f3 100644 --- a/runtime/docs/html/map_8h-source.html +++ b/runtime/docs/html/map_8h-source.html @@ -5,7 +5,7 @@ - +

    map.h

    Go to the documentation of this file.
    00001 /* -*- linux-c -*- */
     00002 #include <linux/types.h>
     00003 
    @@ -17,12 +17,12 @@
     00009 } stat;
     00010 
     00011 union key_data {
    -00012         long val;
    -00013         char *str;
    +00012         long val;
    +00013         char *str;
     00014 };
     00015 
    -00016 enum keytype { NONE, LONG, STR } __attribute__ ((packed));
    -00017 enum valtype { INT64, STAT, STRING, END };
    +00016 enum keytype { NONE, LONG, STR } __attribute__ ((packed));
    +00017 enum valtype { INT64, STAT, STRING, END };
     00018 
     00019 /* all map nodes have the following structure */
     00020 struct map_node {
    @@ -30,63 +30,63 @@
     00022         struct hlist_node hnode;
     00023         union key_data key1;
     00024         union key_data key2;
    -00025         enum keytype key1type;
    -00026         enum keytype key2type;
    +00025         enum keytype key1type;
    +00026         enum keytype key2type;
     00027 };
     00028 
     00029 /* specific map nodes with data attached */
     00030 struct map_node_int64 {
     00031         struct map_node n;
    -00032         int64_t val;
    +00032         int64_t val;
     00033 };
     00034 
     00035 struct map_node_str {
     00036         struct map_node n;
    -00037         char *str;
    +00037         char *str;
     00038 };
     00039 
     00040 struct map_node_stat {
     00041         struct map_node n;
    -00042         stat stats;
    +00042         stat stats;
     00043 };
     00044 
     00045 struct map_root {
     00046         /* type of the values stored in the array */
    -00047         enum valtype type;
    +00047         enum valtype type;
     00048 
     00049         /* maximum number of elements allowed in the array. */
    -00050         int maxnum;
    +00050         int maxnum;
     00051 
     00052         /* current number of elements */
    -00053         int num;
    +00053         int num;
     00054 
     00055         /* when more than maxnum elements, wrap or discard */
    -00056         int no_wrap;
    +00056         int no_wrap;
     00057 
     00058         /* linked list of current entries */
    -00059         struct list_head head;
    +00059         struct list_head head;
     00060 
     00061         /* pool of unused entries.  Used only when entries are statically allocated */
     00062         /* at startup. */
    -00063         struct list_head pool;
    +00063         struct list_head pool;
     00064 
     00065         /* saved key entry for lookups */
    -00066         struct map_node *key;
    +00066         struct map_node *key;
     00067 
     00068         /* this is the creation data saved between the key functions and the */
     00069         /* set/get functions */
    -00070         u_int8_t create;
    -00071         enum keytype c_key1type;
    -00072         enum keytype c_key2type;
    -00073         struct hlist_head *c_keyhead;
    -00074         union key_data c_key1;
    -00075         union key_data c_key2;
    +00070         u_int8_t create;
    +00071         enum keytype c_key1type;
    +00072         enum keytype c_key2type;
    +00073         struct hlist_head *c_keyhead;
    +00074         union key_data c_key1;
    +00075         union key_data c_key2;
     00076 
     00077         /* the hash table for this array */
    -00078         struct hlist_head hashes[HASH_TABLE_SIZE];
    +00078         struct hlist_head hashes[HASH_TABLE_SIZE];
     00079 
     00080         /* pointer to allocated memory space */
    -00081         void *membuf;
    +00081         void *membuf;
     00082 };
     00083 
     00084 typedef struct map_root *MAP;
    @@ -139,8 +139,8 @@
     00139   for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \
     00140        ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))
     00141 
    -

    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/map_8h.html b/runtime/docs/html/map_8h.html index def7be23b..2d35515b1 100644 --- a/runtime/docs/html/map_8h.html +++ b/runtime/docs/html/map_8h.html @@ -5,27 +5,12 @@ - +

    map.h File Reference

    #include <linux/types.h>

    Go to the source code of this file. - - - - - - - - - - - - - - - @@ -67,7 +52,7 @@

    Data Structures

    struct  stat
    union  key_data
    struct  map_node
    struct  map_node_int64
    struct  map_node_str
    struct  map_node_stat
    struct  map_root

    Defines

    #define key1str(ptr)   (ptr->n.key1.str)


    Define Documentation

    - +
    @@ -96,9 +81,9 @@

    Value:

    ({                                                              \
         if (__builtin_types_compatible_p (typeof (val), char[]))    \
    -      _stp_list_add_str (map, (char *)(val));                           \
    +      _stp_list_add_str (map, (char *)(val));                           \
         else                                                        \
    -      _stp_list_add_int64 (map, (int64_t)(val));                        \
    +      _stp_list_add_int64 (map, (int64_t)(val));                        \
       })
     

    @@ -106,7 +91,7 @@ Definition at line 121 of fil

    - +
    @@ -145,7 +130,7 @@ Definition at line 105 of fil

    - +
    @@ -193,7 +178,7 @@ Definition at line 91 of file

    - +
    @@ -222,9 +207,9 @@ Definition at line 91 of file

    Value:

    ({                                                              \
         if (__builtin_types_compatible_p (typeof (val), char[]))    \
    -      _stp_map_set_str (map, (char *)(val));                            \
    +      _stp_map_set_str (map, (char *)(val));                            \
         else                                                        \
    -      _stp_map_set_int64 (map, (int64_t)(val));                 \
    +      _stp_map_set_int64 (map, (int64_t)(val));                 \
       })
     

    @@ -232,7 +217,7 @@ Definition at line 113 of fil

    - +
    @@ -260,7 +245,7 @@ Definition at line 113 of fil

    Value:

    for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \
    -       ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))
    +       ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))
     
    Loop through all elements of a map.

    Parameters:
    @@ -284,7 +269,7 @@ Definition at line 138 of fil

    - +
    @@ -314,7 +299,7 @@ Definition at line 88 of file

    - +
    @@ -344,7 +329,7 @@ Definition at line 86 of file

    - +
    @@ -374,7 +359,7 @@ Definition at line 89 of file

    - +
    @@ -405,7 +390,7 @@ Definition at line 87 of file

    Typedef Documentation

    - +
    @@ -426,14 +411,12 @@ Definition at line 87 of file

    -Definition at line 84 of file map.h. -

    -Referenced by _stp_copy_argv_from_user(), _stp_list_add_int64(), _stp_list_add_str(), _stp_list_clear(), _stp_list_new(), _stp_list_size(), _stp_map_del(), _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_iter(), _stp_map_key_del(), _stp_map_key_long(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_new(), _stp_map_set_int64(), _stp_map_set_stat(), _stp_map_set_str(), _stp_map_start(), and _stp_map_stat_add(). +Definition at line 84 of file map.h.


    Enumeration Type Documentation

    - +
    @@ -468,7 +451,7 @@ Definition at line 16 of file

    - +
    @@ -506,7 +489,7 @@ Definition at line 17 of file

    Variable Documentation

    - +
    @@ -528,8 +511,8 @@ Definition at line 17 of file
    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/pages.html b/runtime/docs/html/pages.html index 108385342..d79b953eb 100644 --- a/runtime/docs/html/pages.html +++ b/runtime/docs/html/pages.html @@ -5,15 +5,15 @@ - +

    SystemTap Related Pages

    Here is a list of all related documentation pages: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/probes_8c-source.html b/runtime/docs/html/probes_8c-source.html new file mode 100644 index 000000000..58c3fa980 --- /dev/null +++ b/runtime/docs/html/probes_8c-source.html @@ -0,0 +1,85 @@ + + +SystemTap: SystemTap Runtime Library + + + + + +

    probes.c

    Go to the documentation of this file.
    00001 /* -*- linux-c -*- */
    +00002 
    +00012 static unsigned long (*_stp_lookup_name)(char *name)=(void *)KALLSYMS_LOOKUP_NAME;
    +00013 
    +00014 void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
    +00015 {
    +00016         int i;
    +00017         for (i = 0; i < num_probes; i++)
    +00018                 unregister_jprobe(&probes[i]);
    +00019         dlog ("All jprobes removed\n");
    +00020 }
    +00021 
    +00022 int _stp_register_jprobes (struct jprobe *probes, int num_probes)
    +00023 {
    +00024         int i, ret ;
    +00025         unsigned long addr;
    +00026 
    +00027         for (i = 0; i < num_probes; i++) {
    +00028                 addr =_stp_lookup_name((char *)probes[i].kp.addr);
    +00029                 if (addr == 0) {
    +00030                         dlog ("ERROR: function %s not found!\n", 
    +00031                               (char *)probes[i].kp.addr);
    +00032                         ret = -1; /* FIXME */
    +00033                         goto out;
    +00034                 }
    +00035                 dlog("inserting jprobe at %s (%p)\n", probes[i].kp.addr, addr);
    +00036                 probes[i].kp.addr = (kprobe_opcode_t *)addr;
    +00037                 ret = register_jprobe(&probes[i]);
    +00038                 if (ret)
    +00039                         goto out;
    +00040         }
    +00041         return 0;
    +00042 out:
    +00043         dlog ("probe module initialization failed.  Exiting...\n");
    +00044         _stp_unregister_jprobes(probes, i);
    +00045         return ret;
    +00046 }
    +00047 
    +00048 void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
    +00049 {
    +00050         int i;
    +00051         for (i = 0; i < num_probes; i++)
    +00052                 unregister_kprobe(&probes[i]);
    +00053         dlog ("All kprobes removed\n");
    +00054 }
    +00055 
    +00056 int _stp_register_kprobes (struct kprobe *probes, int num_probes)
    +00057 {
    +00058         int i, ret ;
    +00059         unsigned long addr;
    +00060 
    +00061         for (i = 0; i < num_probes; i++) {
    +00062                 addr =_stp_lookup_name((char *)probes[i].addr);
    +00063                 if (addr == 0) {
    +00064                         dlog ("ERROR: function %s not found!\n", 
    +00065                               (char *)probes[i].addr);
    +00066                         ret = -1; /* FIXME */
    +00067                         goto out;
    +00068                 }
    +00069                 dlog("inserting kprobe at %s (%p)\n", probes[i].addr, addr);
    +00070                 probes[i].addr = (kprobe_opcode_t *)addr;
    +00071                 ret = register_kprobe(&probes[i]);
    +00072                 if (ret)
    +00073                         goto out;
    +00074         }
    +00075         return 0;
    +00076 out:
    +00077         dlog ("probe module initialization failed.  Exiting...\n");
    +00078         _stp_unregister_kprobes(probes, i);
    +00079         return ret;
    +00080 }
    +00081 
    +

    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  + +doxygen 1.4.1
    + + diff --git a/runtime/docs/html/probes_8c.html b/runtime/docs/html/probes_8c.html new file mode 100644 index 000000000..15ceb18cf --- /dev/null +++ b/runtime/docs/html/probes_8c.html @@ -0,0 +1,196 @@ + + +SystemTap: SystemTap Runtime Library + + + + + +

    probes.c File Reference

    +

    +Go to the source code of this file. + + + + + + + + + + +

    Functions

    void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
    int _stp_register_jprobes (struct jprobe *probes, int num_probes)
    void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
    int _stp_register_kprobes (struct kprobe *probes, int num_probes)
    +


    Function Documentation

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    int _stp_register_jprobes struct jprobe *  probes,
    int  num_probes
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 22 of file probes.c. +

    +References _stp_unregister_jprobes(), and dlog().

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    int _stp_register_kprobes struct kprobe *  probes,
    int  num_probes
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 56 of file probes.c. +

    +References _stp_unregister_kprobes(), and dlog().

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    void _stp_unregister_jprobes struct jprobe *  probes,
    int  num_probes
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 14 of file probes.c. +

    +References dlog(). +

    +Referenced by _stp_register_jprobes().

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    void _stp_unregister_kprobes struct kprobe *  probes,
    int  num_probes
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 48 of file probes.c. +

    +References dlog(). +

    +Referenced by _stp_register_kprobes().

    +


    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  + +doxygen 1.4.1
    + + diff --git a/runtime/docs/html/runtime_8h-source.html b/runtime/docs/html/runtime_8h-source.html index b688d3512..10312ec7b 100644 --- a/runtime/docs/html/runtime_8h-source.html +++ b/runtime/docs/html/runtime_8h-source.html @@ -5,27 +5,30 @@ - +

    runtime.h

    Go to the documentation of this file.
    00001 
     00002 #include <linux/module.h>
    -00003 #include <linux/miscdevice.h>
    -00004 #include <linux/init.h>
    -00005 #include <linux/hash.h>
    -00006 #include <linux/string.h>
    -00007 #include <linux/kprobes.h>
    -00008 #include <linux/proc_fs.h>
    -00009 #include <linux/vmalloc.h>
    -00010 #include <linux/time.h>
    -00011 #include <linux/spinlock.h>
    -00012 #include <asm/uaccess.h>
    -00013 
    -00014 #include "alloc.h"
    -00015 #include "map.h"
    +00003 #include <linux/kernel.h>
    +00004 #include <linux/miscdevice.h>
    +00005 #include <linux/init.h>
    +00006 #include <linux/hash.h>
    +00007 #include <linux/string.h>
    +00008 #include <linux/kprobes.h>
    +00009 #include <linux/proc_fs.h>
    +00010 #include <linux/vmalloc.h>
    +00011 #include <linux/time.h>
    +00012 #include <linux/spinlock.h>
    +00013 #include <linux/hardirq.h>
    +00014 #include <asm/uaccess.h>
    +00015 #include <linux/kallsyms.h>
     00016 
    -00017 #define dbug(args...) ;
    -00018 
    -

    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +00017 #include "alloc.h" +00018 #include "map.h" +00019 +00020 #define dbug(args...) ; +00021 +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/runtime_8h.html b/runtime/docs/html/runtime_8h.html index 89b240973..43b0f402e 100644 --- a/runtime/docs/html/runtime_8h.html +++ b/runtime/docs/html/runtime_8h.html @@ -5,8 +5,9 @@ - +

    runtime.h File Reference

    #include <linux/module.h>
    +#include <linux/kernel.h>
    #include <linux/miscdevice.h>
    #include <linux/init.h>
    #include <linux/hash.h>
    @@ -16,7 +17,9 @@ #include <linux/vmalloc.h>
    #include <linux/time.h>
    #include <linux/spinlock.h>
    +#include <linux/hardirq.h>
    #include <asm/uaccess.h>
    +#include <linux/kallsyms.h>
    #include "alloc.h"
    #include "map.h"
    @@ -29,7 +32,7 @@


    Define Documentation

    - +
    @@ -55,13 +58,13 @@

    -Definition at line 17 of file runtime.h. +Definition at line 20 of file runtime.h.

    -Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_iter(), _stp_map_key_del(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_new(), _stp_map_set_int64(), _stp_map_set_stat(), _stp_map_set_str(), _stp_map_start(), and _stp_map_stat_add(). +Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_iter(), _stp_map_key_del(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_new(), _stp_map_set_stat(), _stp_map_set_str(), _stp_map_start(), and _stp_map_stat_add().

    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/stack_8c-source.html b/runtime/docs/html/stack_8c-source.html new file mode 100644 index 000000000..34f7b76e1 --- /dev/null +++ b/runtime/docs/html/stack_8c-source.html @@ -0,0 +1,187 @@ + + +SystemTap: SystemTap Runtime Library + + + + + +

    stack.c

    Go to the documentation of this file.
    00001 
    +00002 
    +00003 #ifdef __x86_64__
    +00004 /* ripped out of arch/x86_64/kernel/traps.c */
    +00005 #include <linux/kallsyms.h> 
    +00006 
    +00007 static int _stp_printk_address(unsigned long address)
    +00008 { 
    +00009   unsigned long offset = 0, symsize;
    +00010   const char *symname;
    +00011   char *modname;
    +00012   char *delim = ":"; 
    +00013   char namebuf[128];
    +00014   
    +00015   symname = _stp_kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); 
    +00016   if (!symname) 
    +00017     return printk("[<%016lx>]", address);
    +00018   if (!modname)
    +00019     modname = delim = "";               
    +00020   return printk("<%016lx>{%s%s%s%s%+ld}",
    +00021                 address,delim,modname,delim,symname,offset); 
    +00022 }
    +00023 
    +00024 void _stp_show_trace(unsigned long *stack)
    +00025 {
    +00026         unsigned long addr;
    +00027         unsigned long *irqstack, *irqstack_end, *estack_end;
    +00028         const int cpu = safe_smp_processor_id();
    +00029         int i;
    +00030 
    +00031         printk("\nCall Trace:");
    +00032         i = 0; 
    +00033         
    +00034         estack_end = in_exception_stack(cpu, (unsigned long)stack); 
    +00035         if (estack_end) { 
    +00036                 while (stack < estack_end) { 
    +00037                         addr = *stack++; 
    +00038                         if (__kernel_text_address(addr)) {
    +00039                                 i += printk_address(addr);
    +00040                                 i += printk(" "); 
    +00041                                 if (i > 50) {
    +00042                                         printk("\n"); 
    +00043                                         i = 0;
    +00044                                 }
    +00045                         }
    +00046                 }
    +00047                 i += printk(" <EOE> "); 
    +00048                 i += 7;
    +00049                 stack = (unsigned long *) estack_end[-2]; 
    +00050         }  
    +00051 
    +00052         irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);
    +00053         irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE + 64);
    +00054 
    +00055         if (stack >= irqstack && stack < irqstack_end) {
    +00056                 printk("<IRQ> ");  
    +00057                 while (stack < irqstack_end) {
    +00058                         addr = *stack++;
    +00059                         /*
    +00060                          * If the address is either in the text segment of the
    +00061                          * kernel, or in the region which contains vmalloc'ed
    +00062                          * memory, it *may* be the address of a calling
    +00063                          * routine; if so, print it so that someone tracing
    +00064                          * down the cause of the crash will be able to figure
    +00065                          * out the call path that was taken.
    +00066                          */
    +00067                          if (__kernel_text_address(addr)) {
    +00068                                  i += printk_address(addr);
    +00069                                  i += printk(" "); 
    +00070                                  if (i > 50) { 
    +00071                                         printk("\n       ");
    +00072                                          i = 0;
    +00073                                  } 
    +00074                         }
    +00075                 } 
    +00076                 stack = (unsigned long *) (irqstack_end[-1]);
    +00077                 printk(" <EOI> ");
    +00078                 i += 7;
    +00079         } 
    +00080 
    +00081         while (((long) stack & (THREAD_SIZE-1)) != 0) {
    +00082                 addr = *stack++;
    +00083                 if (__kernel_text_address(addr)) {
    +00084                         i += printk_address(addr);
    +00085                         i += printk(" "); 
    +00086                         if (i > 50) { 
    +00087                                 printk("\n       ");
    +00088                                          i = 0;
    +00089                         } 
    +00090                 }
    +00091         }
    +00092         printk("\n");
    +00093 }
    +00094 
    +00095 void _stp_dump_stack(void)
    +00096 {
    +00097   unsigned long dummy;
    +00098   show_trace(&dummy);
    +00099 }
    +00100 
    +00101 #else  /* i386 */
    +00102 
    +00103 static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
    +00104 {
    +00105         return  p > (void *)tinfo &&
    +00106                 p < (void *)tinfo + THREAD_SIZE - 3;
    +00107 }
    +00108 
    +00109 int __kernel_text_address(unsigned long addr)
    +00110 {
    +00111         if (core_kernel_text(addr))
    +00112                 return 1;
    +00113         return __module_text_address(addr) != NULL;
    +00114 }
    +00115 
    +00116 static inline unsigned long _stp_print_context_stack(struct thread_info *tinfo,
    +00117                                 unsigned long *stack, unsigned long ebp)
    +00118 {
    +00119         unsigned long addr;
    +00120 
    +00121 #ifdef  CONFIG_FRAME_POINTER
    +00122         while (valid_stack_ptr(tinfo, (void *)ebp)) {
    +00123                 addr = *(unsigned long *)(ebp + 4);
    +00124                 _stp_print_buf(" [<%08lx>] ", addr);
    +00125                 _stp_print_symbol("%s", addr);
    +00126                 _stp_print_buf("\n");
    +00127                 ebp = *(unsigned long *)ebp;
    +00128         }
    +00129 #else
    +00130         while (valid_stack_ptr(tinfo, stack)) {
    +00131                 addr = *stack++;
    +00132                 if (__kernel_text_address(addr)) {
    +00133                         _stp_print_buf(" [<%08lx>]", addr);
    +00134                         _stp_print_symbol(" %s", addr);
    +00135                         _stp_print_buf("\n");
    +00136                 }
    +00137         }
    +00138 #endif
    +00139         return ebp;
    +00140 }
    +00141 
    +00142 void show_trace(struct task_struct *task, unsigned long * stack)
    +00143 {
    +00144         unsigned long ebp;
    +00145 
    +00146         if (!task)
    +00147                 task = current;
    +00148 
    +00149         if (task == current) {
    +00150                 /* Grab ebp right from our regs */
    +00151                 asm ("movl %%ebp, %0" : "=r" (ebp) : );
    +00152         } else {
    +00153                 /* ebp is the last reg pushed by switch_to */
    +00154                 ebp = *(unsigned long *) task->thread.esp;
    +00155         }
    +00156 
    +00157         while (1) {
    +00158                 struct thread_info *context;
    +00159                 context = (struct thread_info *)
    +00160                         ((unsigned long)stack & (~(THREAD_SIZE - 1)));
    +00161                 ebp = _stp_print_context_stack(context, stack, ebp);
    +00162                 stack = (unsigned long*)context->previous_esp;
    +00163                 if (!stack)
    +00164                         break;
    +00165                 _stp_print_buf(" =======================\n");
    +00166         }
    +00167 }
    +00168 
    +00169 void dump_stack(void)
    +00170 {
    +00171         unsigned long stack;
    +00172         show_trace(current, &stack);
    +00173 }
    +00174 #endif
    +

    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  + +doxygen 1.4.1
    + + diff --git a/runtime/docs/html/stack_8c.html b/runtime/docs/html/stack_8c.html new file mode 100644 index 000000000..0b8cc43da --- /dev/null +++ b/runtime/docs/html/stack_8c.html @@ -0,0 +1,125 @@ + + +SystemTap: SystemTap Runtime Library + + + + + +

    stack.c File Reference

    +

    +Go to the source code of this file. + + + + + + + + +

    Functions

    int __kernel_text_address (unsigned long addr)
    void show_trace (struct task_struct *task, unsigned long *stack)
    void dump_stack (void)
    +


    Function Documentation

    +

    + + + + +
    + + + + + + + + + +
    int __kernel_text_address unsigned long  addr  ) 
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 109 of file stack.c.

    +

    + + + + +
    + + + + + + + + + +
    void dump_stack void   ) 
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 169 of file stack.c.

    +

    + + + + +
    + + + + + + + + + + + + + + + + + + +
    void show_trace struct task_struct *  task,
    unsigned long *  stack
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 142 of file stack.c.

    +


    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  + +doxygen 1.4.1
    + + diff --git a/runtime/docs/html/structmap__node.html b/runtime/docs/html/structmap__node.html index 0f1dbc424..1d8a69eaf 100644 --- a/runtime/docs/html/structmap__node.html +++ b/runtime/docs/html/structmap__node.html @@ -5,7 +5,7 @@ - +

    map_node Struct Reference

    #include <map.h>

    @@ -19,10 +19,14 @@ + + + +
    key_data key2
    enum keytype key1type
    enum keytype key2type


    Field Documentation

    - +
    @@ -45,11 +49,11 @@

    Definition at line 22 of file map.h.

    -Referenced by _stp_list_clear(), _stp_map_key_del(), _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_list_clear(), _stp_map_key_del(), _stp_map_set_stat(), and _stp_map_set_str().

    - +
    @@ -75,8 +79,33 @@ Definition at line 23 of file Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    +

    + + + + +
    + + + + +
    enum keytype map_node::key1type
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 25 of file map.h.

    - +
    @@ -102,8 +131,33 @@ Definition at line 24 of file Referenced by _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    +

    + + + + +
    + + + + +
    enum keytype map_node::key2type
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 26 of file map.h.

    - +
    @@ -126,13 +180,13 @@ Referenced by _stp_map_key_long_s

    Definition at line 21 of file map.h.

    -Referenced by _stp_list_clear(), _stp_map_del(), _stp_map_iter(), _stp_map_key_del(), _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_list_clear(), _stp_map_del(), _stp_map_iter(), _stp_map_key_del(), _stp_map_set_stat(), and _stp_map_set_str().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/structmap__node__int64.html b/runtime/docs/html/structmap__node__int64.html index d2ec73172..1ac8d35a6 100644 --- a/runtime/docs/html/structmap__node__int64.html +++ b/runtime/docs/html/structmap__node__int64.html @@ -5,7 +5,7 @@ - +

    map_node_int64 Struct Reference

    #include <map.h>

    @@ -18,7 +18,7 @@


    Field Documentation

    - +
    @@ -39,13 +39,11 @@

    -Definition at line 31 of file map.h. -

    -Referenced by _stp_map_set_int64(). +Definition at line 31 of file map.h.

    - +
    @@ -68,13 +66,13 @@ Referenced by _stp_map_set_int64(

    Definition at line 32 of file map.h.

    -Referenced by _stp_map_get_int64(), and _stp_map_set_int64(). +Referenced by _stp_map_get_int64().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/structmap__node__stat.html b/runtime/docs/html/structmap__node__stat.html index 0d8fdb95d..3105ecbe4 100644 --- a/runtime/docs/html/structmap__node__stat.html +++ b/runtime/docs/html/structmap__node__stat.html @@ -5,7 +5,7 @@ - +

    map_node_stat Struct Reference

    #include <map.h>

    @@ -18,7 +18,7 @@


    Field Documentation

    - +
    @@ -41,11 +41,11 @@

    Definition at line 41 of file map.h.

    -Referenced by _stp_map_set_stat(). +Referenced by _stp_map_set_stat().

    - +
    @@ -68,13 +68,13 @@ Referenced by _stp_map_set_stat()

    Definition at line 42 of file map.h.

    -Referenced by _stp_map_get_stat(), _stp_map_set_stat(), and _stp_map_stat_add(). +Referenced by _stp_map_get_stat(), _stp_map_set_stat(), and _stp_map_stat_add().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/structmap__node__str.html b/runtime/docs/html/structmap__node__str.html index a7d78bed0..e0a906769 100644 --- a/runtime/docs/html/structmap__node__str.html +++ b/runtime/docs/html/structmap__node__str.html @@ -5,7 +5,7 @@ - +

    map_node_str Struct Reference

    #include <map.h>

    @@ -18,7 +18,7 @@


    Field Documentation

    - +
    @@ -41,11 +41,11 @@

    Definition at line 36 of file map.h.

    -Referenced by _stp_map_set_str(). +Referenced by _stp_map_set_str().

    - +
    @@ -68,13 +68,13 @@ Referenced by _stp_map_set_str()<

    Definition at line 37 of file map.h.

    -Referenced by _stp_map_get_str(), and _stp_map_set_str(). +Referenced by _stp_map_get_str(), and _stp_map_set_str().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/structmap__root.html b/runtime/docs/html/structmap__root.html index d6a7418a8..cd50216bb 100644 --- a/runtime/docs/html/structmap__root.html +++ b/runtime/docs/html/structmap__root.html @@ -5,45 +5,51 @@ - +

    map_root Struct Reference

    #include <map.h>

    - + - + - + - + - + - + - + - + - + - + - + - + + + + + + +

    Data Fields

    int maxnum
    enum valtype type
    int num
    int maxnum
    int no_wrap
    int num
    list_head head
    int no_wrap
    list_head pool
    list_head head
    map_nodekey
    list_head pool
    u_int8_t create
    map_nodekey
    hlist_head * c_keyhead
    u_int8_t create
    key_data c_key1
    enum keytype c_key1type
    key_data c_key2
    enum keytype c_key2type
    hlist_head hashes [HASH_TABLE_SIZE]
    hlist_head * c_keyhead
    void * membuf
    key_data c_key1
    key_data c_key2
    hlist_head hashes [HASH_TABLE_SIZE]
    void * membuf


    Field Documentation

    -

    - +

    +

    @@ -64,13 +70,40 @@ Definition at line 74 of file Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    - +
    union key_data map_root::c_key1 union key_data map_root::c_key1
    -

    - +

    +

    + +
    - + + +
    union key_data map_root::c_key2 enum keytype map_root::c_key1type
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 71 of file map.h. +

    +Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().

    +

    + + + @@ -91,13 +124,40 @@ Definition at line 75 of file Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    + + +
    union key_data map_root::c_key2
    -

    - +

    +

    + + + +
    + + + + +
    enum keytype map_root::c_key2type
    +
    + + + + + +
    +   + + +

    + +

    +Definition at line 72 of file map.h. +

    +Referenced by _stp_map_key_long(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().

    +

    + @@ -118,13 +178,13 @@ Definition at line 73 of file Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    - +
    struct hlist_head* map_root::c_keyhead struct hlist_head* map_root::c_keyhead
    -

    - +

    +

    @@ -142,16 +202,16 @@ Referenced by _stp_map_key_long_l

    Definition at line 70 of file map.h.

    -Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_key_del(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_set_int64(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_stat_add(). +Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_stat_add().

    - +
    u_int8_t map_root::create u_int8_t map_root::create
    -

    - +

    +

    @@ -172,13 +232,13 @@ Definition at line 78 of file Referenced by _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), and _stp_map_key_str_str().
    - +
    struct hlist_head map_root::hashes[HASH_TABLE_SIZE] struct hlist_head map_root::hashes[HASH_TABLE_SIZE]
    -

    - +

    +

    @@ -196,16 +256,16 @@ Referenced by _stp_map_key_long_l

    Definition at line 59 of file map.h.

    -Referenced by _stp_list_clear(), _stp_map_del(), _stp_map_iter(), _stp_map_new(), _stp_map_set_int64(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_start(). +Referenced by _stp_list_clear(), _stp_map_del(), _stp_map_iter(), _stp_map_new(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_start().

    - +
    struct list_head map_root::head struct list_head map_root::head
    -

    - +

    +

    @@ -223,16 +283,16 @@ Referenced by _stp_list_clear() Definition at line 66 of file map.h.

    -Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_key_del(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_set_int64(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_stat_add(). +Referenced by _stp_map_get_int64(), _stp_map_get_stat(), _stp_map_get_str(), _stp_map_key_long_long(), _stp_map_key_long_str(), _stp_map_key_str_long(), _stp_map_key_str_str(), _stp_map_set_stat(), _stp_map_set_str(), and _stp_map_stat_add().

    - +
    struct map_node* map_root::key struct map_node* map_root::key
    -

    - +

    +

    @@ -250,16 +310,16 @@ Referenced by _stp_map_get_int64(

    Definition at line 50 of file map.h.

    -Referenced by _stp_list_clear(), _stp_map_key_del(), _stp_map_new(), _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_list_clear(), _stp_map_new(), _stp_map_set_stat(), and _stp_map_set_str().

    - +
    int map_root::maxnum int map_root::maxnum
    -

    - +

    +

    @@ -280,13 +340,13 @@ Definition at line 81 of file Referenced by _stp_map_del(), and _stp_map_new().
    - +
    void* map_root::membuf void* map_root::membuf
    -

    - +

    +

    @@ -304,16 +364,16 @@ Referenced by _stp_map_del(),

    Definition at line 56 of file map.h.

    -Referenced by _stp_list_new(), _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_list_new(), _stp_map_set_stat(), and _stp_map_set_str().

    - +
    int map_root::no_wrap int map_root::no_wrap
    -

    - +

    +

    @@ -331,16 +391,16 @@ Referenced by _stp_list_new()

    Definition at line 53 of file map.h.

    -Referenced by _stp_copy_argv_from_user(), _stp_list_add_int64(), _stp_list_add_str(), _stp_list_clear(), _stp_list_size(), and _stp_map_key_del(). +Referenced by _stp_copy_argv_from_user(), _stp_list_add_int64(), _stp_list_add_str(), _stp_list_clear(), and _stp_list_size().

    - +
    int map_root::num int map_root::num
    -

    - +

    +

    @@ -358,13 +418,40 @@ Referenced by _stp_copy_argv_fro

    Definition at line 63 of file map.h.

    -Referenced by _stp_list_clear(), _stp_map_key_del(), _stp_map_new(), _stp_map_set_int64(), _stp_map_set_stat(), and _stp_map_set_str(). +Referenced by _stp_list_clear(), _stp_map_new(), _stp_map_set_stat(), and _stp_map_set_str(). +

    +
    - +
    struct list_head map_root::pool struct list_head map_root::pool
    +

    + + + + +
    + + + + +
    enum valtype map_root::type
    +
    + + + +
    +   + + +

    + +

    +Definition at line 47 of file map.h. +

    +Referenced by _stp_map_new().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/structstat.html b/runtime/docs/html/structstat.html index 476276575..50829d8d6 100644 --- a/runtime/docs/html/structstat.html +++ b/runtime/docs/html/structstat.html @@ -5,7 +5,7 @@ - +

    stat Struct Reference

    #include <map.h>

    @@ -24,7 +24,7 @@


    Field Documentation

    - +
    @@ -47,11 +47,11 @@

    Definition at line 5 of file map.h.

    -Referenced by _stp_map_stat_add(). +Referenced by _stp_map_stat_add().

    - +
    @@ -76,7 +76,7 @@ Definition at line 8 of file

    - +
    @@ -99,11 +99,11 @@ Definition at line 8 of file

    Definition at line 7 of file map.h.

    -Referenced by _stp_map_stat_add(). +Referenced by _stp_map_stat_add().

    - +
    @@ -126,11 +126,11 @@ Referenced by _stp_map_stat_add()

    Definition at line 7 of file map.h.

    -Referenced by _stp_map_stat_add(). +Referenced by _stp_map_stat_add().

    - +
    @@ -153,13 +153,13 @@ Referenced by _stp_map_stat_add()

    Definition at line 6 of file map.h.

    -Referenced by _stp_map_stat_add(). +Referenced by _stp_map_stat_add().


    The documentation for this struct was generated from the following file: -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/todo.html b/runtime/docs/html/todo.html index d4f0d0513..93efe6b82 100644 --- a/runtime/docs/html/todo.html +++ b/runtime/docs/html/todo.html @@ -5,28 +5,23 @@ - -

    Todo List

    -
    page SystemTap Runtime Library
    -
    The Runtime Library is not actually a library yet. It is just a collection of functions included in the probe boilerplate.
    -
    -

    -

    -
    Global dlog (const char *fmt,...)
    + +

    Todo List

    +
    Global dlog (const char *fmt,...)
    Needs replaced with something much faster that does not use the system log.

    -
    Global _stp_map_set_stat (MAP map, stat *stats)
    +
    Global _stp_map_set_stat (MAP map, stat *stats)
    Histograms don't work yet.

    -
    Global _stp_map_stat_add (MAP map, int64_t val)
    +
    Global _stp_map_stat_add (MAP map, int64_t val)
    Histograms don't work yet.
    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/docs/html/unionkey__data.html b/runtime/docs/html/unionkey__data.html index e2f2a66eb..a46795bf2 100644 --- a/runtime/docs/html/unionkey__data.html +++ b/runtime/docs/html/unionkey__data.html @@ -5,7 +5,7 @@ - +

    key_data Union Reference

    #include <map.h>

    @@ -18,7 +18,7 @@


    Field Documentation

    - +
    @@ -45,7 +45,7 @@ Referenced by _stp_map_key_long_s

    - +
    @@ -73,8 +73,8 @@ Referenced by _stp_map_key_long_l

    The documentation for this union was generated from the following file:
    -
    Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  +
    Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  -doxygen 1.3.9.1
    +doxygen 1.4.1
    diff --git a/runtime/io.c b/runtime/io.c index 3371df160..8756a48d2 100644 --- a/runtime/io.c +++ b/runtime/io.c @@ -17,3 +17,67 @@ void dlog (const char *fmt, ...) va_end(args); } + +static const char * (*_stp_kallsyms_lookup)(unsigned long addr, + unsigned long *symbolsize, + unsigned long *offset, + char **modname, char *namebuf)=(void *)KALLSYMS_LOOKUP; + + +#define STP_BUF_LEN 8191 + +/* FIXME. These need to be per-cpu */ +static char _stp_pbuf[STP_BUF_LEN+1]; +static int _stp_pbuf_len = STP_BUF_LEN; + +void _stp_print_buf (const char *fmt, ...) +{ + int num; + va_list args; + char *buf = _stp_pbuf + STP_BUF_LEN - _stp_pbuf_len; + va_start(args, fmt); + num = vscnprintf(buf, _stp_pbuf_len, fmt, args); + va_end(args); + if (num > 0) + _stp_pbuf_len -= num; +} + +void _stp_print_buf_init (void) +{ + _stp_pbuf_len = STP_BUF_LEN; + _stp_pbuf[0] = 0; +} + +void _stp_print_symbol(const char *fmt, unsigned long address) +{ + char *modname; + const char *name; + unsigned long offset, size; + char namebuf[KSYM_NAME_LEN+1]; + + name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); + + if (!name) + _stp_print_buf("0x%lx", address); + else { + if (modname) + _stp_print_buf("%s+%#lx/%#lx [%s]", name, offset, + size, modname); + else + _stp_print_buf("%s+%#lx/%#lx", name, offset, size); + } +} + + +unsigned long cur_ret_addr (struct pt_regs *regs) +{ +#ifdef __x86_64__ + unsigned long *ra = (unsigned long *)regs->rsp; +#else + unsigned long *ra = (unsigned long *)regs->esp; +#endif + if (ra) + return *ra; + else + return 0; +} diff --git a/runtime/map.c b/runtime/map.c index 9b264c3ad..8341233ed 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -458,17 +458,7 @@ static void map_copy_keys(MAP map, struct map_node *m) map->num++; } -/** Set the current element's value to an int64. - * This sets the current element's value to an int64. The map must have been created - * to hold int64s using _stp_map_new() - * - * If the element doesn't exist, it is created. If no current element (key) - * is set for the map, this function does nothing. - * @param map - * @param val new value - */ - -void _stp_map_set_int64(MAP map, int64_t val) +static void __stp_map_set_int64(MAP map, int64_t val, int add) { struct map_node_int64 *m; @@ -512,14 +502,47 @@ void _stp_map_set_int64(MAP map, int64_t val) if (val) { m = (struct map_node_int64 *)map->key; - m->val = val; - } else { + if (add) + m->val += val; + else + m->val = val; + } else if (!add) { /* setting value to 0 is the same as deleting */ _stp_map_key_del(map); } } } +/** Set the current element's value to an int64. + * This sets the current element's value to an int64. The map must have been created + * to hold int64s using _stp_map_new() + * + * If the element doesn't exist, it is created. If no current element (key) + * is set for the map, this function does nothing. + * @param map + * @param val new value + */ +void _stp_map_set_int64(MAP map, int64_t val) +{ + __stp_map_set_int64 (map, val, 0); +} + + +/** Adds an int64 to the current element's value. + * This adds an int64 to the current element's value. The map must have been created + * to hold int64s using _stp_map_new() + * + * If the element doesn't exist, it is created. If no current element (key) + * is set for the map, this function does nothing. + * @param map + * @param val value + */ + +void _stp_map_add_int64(MAP map, int64_t val) +{ + __stp_map_set_int64 (map, val, 1); +} + /** Gets the current element's value. * @param map * @returns The value. If the current element is not set or doesn't exist, returns 0. diff --git a/runtime/runtime.h b/runtime/runtime.h index 0876512f7..6fcbeb0a5 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -9,7 +10,9 @@ #include #include #include +#include #include +#include #include "alloc.h" #include "map.h"