From 204b456c7c08bc40ffe1f21575461d92a544e92b Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 9 Mar 2005 21:30:05 +0000 Subject: Initial runtime checkin. --- runtime/docs/html/MAP-example.html | 17 + runtime/docs/html/README-source.html | 14 + runtime/docs/html/README.html | 18 + runtime/docs/html/alloc_8h-source.html | 53 + runtime/docs/html/alloc_8h.html | 276 +++++ runtime/docs/html/annotated.html | 22 + runtime/docs/html/argv__example_8c-example.html | 32 + runtime/docs/html/bug.html | 27 + runtime/docs/html/copy_8c-source.html | 111 ++ runtime/docs/html/copy_8c.html | 204 ++++ .../docs/html/docs_2argv__example_8c-example.html | 20 + runtime/docs/html/doxygen.css | 271 +++++ runtime/docs/html/doxygen.png | Bin 0 -> 1281 bytes runtime/docs/html/examples.html | 16 + runtime/docs/html/files.html | 22 + runtime/docs/html/foreach_8c-example.html | 28 + runtime/docs/html/ftv2blank.png | Bin 0 -> 174 bytes runtime/docs/html/ftv2doc.png | Bin 0 -> 255 bytes runtime/docs/html/ftv2folderclosed.png | Bin 0 -> 259 bytes runtime/docs/html/ftv2folderopen.png | Bin 0 -> 261 bytes runtime/docs/html/ftv2lastnode.png | Bin 0 -> 233 bytes runtime/docs/html/ftv2link.png | Bin 0 -> 358 bytes runtime/docs/html/ftv2mlastnode.png | Bin 0 -> 160 bytes runtime/docs/html/ftv2mnode.png | Bin 0 -> 194 bytes runtime/docs/html/ftv2node.png | Bin 0 -> 235 bytes runtime/docs/html/ftv2plastnode.png | Bin 0 -> 165 bytes runtime/docs/html/ftv2pnode.png | Bin 0 -> 200 bytes runtime/docs/html/ftv2vertline.png | Bin 0 -> 229 bytes runtime/docs/html/functions.html | 43 + runtime/docs/html/functions_vars.html | 43 + runtime/docs/html/globals.html | 99 ++ runtime/docs/html/globals_defs.html | 28 + runtime/docs/html/globals_enum.html | 21 + runtime/docs/html/globals_eval.html | 27 + runtime/docs/html/globals_func.html | 55 + runtime/docs/html/globals_type.html | 19 + runtime/docs/html/globals_vars.html | 19 + runtime/docs/html/index.html | 40 + runtime/docs/html/io_8c-source.html | 23 + runtime/docs/html/io_8c.html | 75 ++ runtime/docs/html/main.html | 17 + runtime/docs/html/map_8c-source.html | 661 +++++++++++ runtime/docs/html/map_8c.html | 1199 ++++++++++++++++++++ runtime/docs/html/map_8h-source.html | 146 +++ runtime/docs/html/map_8h.html | 535 +++++++++ runtime/docs/html/pages.html | 19 + runtime/docs/html/runtime_8h-source.html | 31 + runtime/docs/html/runtime_8h.html | 67 ++ runtime/docs/html/structmap__node.html | 138 +++ runtime/docs/html/structmap__node__int64.html | 80 ++ runtime/docs/html/structmap__node__stat.html | 80 ++ runtime/docs/html/structmap__node__str.html | 80 ++ runtime/docs/html/structmap__root.html | 370 ++++++ runtime/docs/html/structstat.html | 165 +++ runtime/docs/html/todo.html | 32 + runtime/docs/html/tree.html | 139 +++ runtime/docs/html/unionkey__data.html | 80 ++ 57 files changed, 5462 insertions(+) create mode 100644 runtime/docs/html/MAP-example.html create mode 100644 runtime/docs/html/README-source.html create mode 100644 runtime/docs/html/README.html create mode 100644 runtime/docs/html/alloc_8h-source.html create mode 100644 runtime/docs/html/alloc_8h.html create mode 100644 runtime/docs/html/annotated.html create mode 100644 runtime/docs/html/argv__example_8c-example.html create mode 100644 runtime/docs/html/bug.html create mode 100644 runtime/docs/html/copy_8c-source.html create mode 100644 runtime/docs/html/copy_8c.html create mode 100644 runtime/docs/html/docs_2argv__example_8c-example.html create mode 100644 runtime/docs/html/doxygen.css create mode 100644 runtime/docs/html/doxygen.png create mode 100644 runtime/docs/html/examples.html create mode 100644 runtime/docs/html/files.html create mode 100644 runtime/docs/html/foreach_8c-example.html create mode 100644 runtime/docs/html/ftv2blank.png create mode 100644 runtime/docs/html/ftv2doc.png create mode 100644 runtime/docs/html/ftv2folderclosed.png create mode 100644 runtime/docs/html/ftv2folderopen.png create mode 100644 runtime/docs/html/ftv2lastnode.png create mode 100644 runtime/docs/html/ftv2link.png create mode 100644 runtime/docs/html/ftv2mlastnode.png create mode 100644 runtime/docs/html/ftv2mnode.png create mode 100644 runtime/docs/html/ftv2node.png create mode 100644 runtime/docs/html/ftv2plastnode.png create mode 100644 runtime/docs/html/ftv2pnode.png create mode 100644 runtime/docs/html/ftv2vertline.png create mode 100644 runtime/docs/html/functions.html create mode 100644 runtime/docs/html/functions_vars.html create mode 100644 runtime/docs/html/globals.html create mode 100644 runtime/docs/html/globals_defs.html create mode 100644 runtime/docs/html/globals_enum.html create mode 100644 runtime/docs/html/globals_eval.html create mode 100644 runtime/docs/html/globals_func.html create mode 100644 runtime/docs/html/globals_type.html create mode 100644 runtime/docs/html/globals_vars.html create mode 100644 runtime/docs/html/index.html create mode 100644 runtime/docs/html/io_8c-source.html create mode 100644 runtime/docs/html/io_8c.html create mode 100644 runtime/docs/html/main.html create mode 100644 runtime/docs/html/map_8c-source.html create mode 100644 runtime/docs/html/map_8c.html create mode 100644 runtime/docs/html/map_8h-source.html create mode 100644 runtime/docs/html/map_8h.html create mode 100644 runtime/docs/html/pages.html create mode 100644 runtime/docs/html/runtime_8h-source.html create mode 100644 runtime/docs/html/runtime_8h.html create mode 100644 runtime/docs/html/structmap__node.html create mode 100644 runtime/docs/html/structmap__node__int64.html create mode 100644 runtime/docs/html/structmap__node__stat.html create mode 100644 runtime/docs/html/structmap__node__str.html create mode 100644 runtime/docs/html/structmap__root.html create mode 100644 runtime/docs/html/structstat.html create mode 100644 runtime/docs/html/todo.html create mode 100644 runtime/docs/html/tree.html create mode 100644 runtime/docs/html/unionkey__data.html (limited to 'runtime/docs/html') diff --git a/runtime/docs/html/MAP-example.html b/runtime/docs/html/MAP-example.html new file mode 100644 index 00000000..45e6a3c3 --- /dev/null +++ b/runtime/docs/html/MAP-example.html @@ -0,0 +1,17 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

MAP

arglist ;

+int inst_do_execve (char * filename, char __user *__user *argv, char __user *__user *envp, struct pt_regs * regs) { struct map_node_str *ptr;

+_stp_copy_argv_from_user (arglist, argv);

+foreach (arglist, ptr) printk ("%s ", ptr->str); printk ("\n");

+


Generated on Wed Mar 9 03:32:10 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/README-source.html b/runtime/docs/html/README-source.html new file mode 100644 index 00000000..2b8a1dfd --- /dev/null +++ b/runtime/docs/html/README-source.html @@ -0,0 +1,14 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

README

Go to the documentation of this file.
00001 
+

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/README.html b/runtime/docs/html/README.html new file mode 100644 index 00000000..0da9fbaf --- /dev/null +++ b/runtime/docs/html/README.html @@ -0,0 +1,18 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

README File Reference

+

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


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/alloc_8h-source.html b/runtime/docs/html/alloc_8h-source.html new file mode 100644 index 00000000..ba908655 --- /dev/null +++ b/runtime/docs/html/alloc_8h-source.html @@ -0,0 +1,53 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

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)
+00013 {
+00014         void *ptr = kmalloc(len, GFP_ATOMIC);
+00015         if (ptr == NULL)
+00016                 _stp_error = ERR_NO_MEM;
+00017         return ptr;
+00018 }
+00019 
+00028 inline void *_stp_calloc(size_t len)
+00029 {
+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)
+00044 {
+00045         void *ptr = vmalloc(len);
+00046         if (ptr)
+00047                 memset(ptr, 0, len);
+00048         else
+00049                 _stp_error = ERR_NO_MEM;
+00050         return ptr;
+00051 }
+00052 
+00057 inline void _stp_free(void *ptr)
+00058 {
+00059         if (ptr)
+00060                 kfree(ptr);
+00061 }
+00062 
+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/alloc_8h.html b/runtime/docs/html/alloc_8h.html new file mode 100644 index 00000000..6a5db5ab --- /dev/null +++ b/runtime/docs/html/alloc_8h.html @@ -0,0 +1,276 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

alloc.h File Reference

+

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

Enumerations

enum  errorcode { ERR_NONE = 0, +ERR_NO_MEM + }

Functions

void * _stp_alloc (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 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_valloc.
+


Enumeration Type Documentation

+

+ + + + +
+ + + + +
enum errorcode
+
+ + + + + +
+   + + +

+

Enumeration values:
+ + + +
ERR_NONE  +
ERR_NO_MEM  +
+
+ +

+Definition at line 1 of file alloc.h.

+


Function Documentation

+

+ + + + +
+ + + + + + + + + +
void* _stp_alloc size_t  len  )  [inline]
+
+ + + + + +
+   + + +

+Allocates memory within a probe. +

+This is used for small allocations from within a running probe where the process cannot sleep.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+
Bug:
Currently uses kmalloc (GFP_ATOMIC).
+ +

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

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

+

+ + + + +
+ + + + + + + + + +
void* _stp_calloc size_t  len  )  [inline]
+
+ + + + + +
+   + + +

+Allocates and clears memory within a probe. +

+This is used for small allocations from within a running probe where the process cannot sleep.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+
Bug:
Currently uses kmalloc (GFP_ATOMIC).
+ +

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

+References _stp_alloc(). +

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

+

+ + + + +
+ + + + + + + + + +
void _stp_free void *  ptr  )  [inline]
+
+ + + + + +
+   + + +

+Frees memory allocated by _stp_alloc or _stp_calloc. +

+

Parameters:
+ + +
ptr pointer to memory to free
+
+ +

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

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

+

+ + + + +
+ + + + + + + + + +
void* _stp_valloc size_t  len  )  [inline]
+
+ + + + + +
+   + + +

+Allocates and clears memory outside a probe. +

+This is typically used in the module initialization to allocate new maps, lists, etc.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+ +

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

+Referenced by _stp_map_new().

+

+ + + + +
+ + + + + + + + + +
void _stp_vfree void *  ptr  )  [inline]
+
+ + + + + +
+   + + +

+Frees memory allocated by _stp_valloc. +

+

Parameters:
+ + +
ptr pointer to memory to free
+
+ +

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

+Referenced by _stp_map_del().

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/annotated.html b/runtime/docs/html/annotated.html new file mode 100644 index 00000000..77bc2e38 --- /dev/null +++ b/runtime/docs/html/annotated.html @@ -0,0 +1,22 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

SystemTap Data Structures

Here are the data structures with brief descriptions: + + + + + + + +
key_data
map_node
map_node_int64
map_node_stat
map_node_str
map_root
stat
+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/argv__example_8c-example.html b/runtime/docs/html/argv__example_8c-example.html new file mode 100644 index 00000000..1369c4c2 --- /dev/null +++ b/runtime/docs/html/argv__example_8c-example.html @@ -0,0 +1,32 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

argv_example.c

Parameters:
+ + + +
list A list.
argv Source argv, in user space.
+
+
Returns:
number of elements in list
+
MAP arglist ;
+
+int inst_do_execve (char * filename, char __user *__user *argv, char __user *__user *envp, struct pt_regs * regs)
+{
+  struct map_node_str *ptr;
+
+  _stp_copy_argv_from_user (arglist, argv);
+
+  foreach (arglist, ptr)
+    printk ("%s ", ptr->str);
+  printk ("\n");
+}
+

Generated on Wed Mar 9 03:40:33 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/bug.html b/runtime/docs/html/bug.html new file mode 100644 index 00000000..a2be5f08 --- /dev/null +++ b/runtime/docs/html/bug.html @@ -0,0 +1,27 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

Bug List

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

+

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

+

+
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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/copy_8c-source.html b/runtime/docs/html/copy_8c-source.html new file mode 100644 index 00000000..2e21314c --- /dev/null +++ b/runtime/docs/html/copy_8c-source.html @@ -0,0 +1,111 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

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 
+00004 #if defined (__i386__)
+00005 #define __stp_strncpy_from_user(dst,src,count,res)                         \
+00006 do {                                                                       \
+00007         int __d0, __d1, __d2;                                              \
+00008         __asm__ __volatile__(                                              \
+00009                 "       testl %1,%1\n"                                     \
+00010                 "       jz 2f\n"                                           \
+00011                 "0:     lodsb\n"                                           \
+00012                 "       stosb\n"                                           \
+00013                 "       testb %%al,%%al\n"                                 \
+00014                 "       jz 1f\n"                                           \
+00015                 "       decl %1\n"                                         \
+00016                 "       jnz 0b\n"                                          \
+00017                 "1:     subl %1,%0\n"                                      \
+00018                 "2:\n"                                                     \
+00019                 ".section .fixup,\"ax\"\n"                                 \
+00020                 "3:     movl %5,%0\n"                                      \
+00021                 "       jmp 2b\n"                                          \
+00022                 ".previous\n"                                              \
+00023                 ".section __ex_table,\"a\"\n"                              \
+00024                 "       .align 4\n"                                        \
+00025                 "       .long 0b,3b\n"                                     \
+00026                 ".previous"                                                \
+00027                 : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),      \
+00028                   "=&D" (__d2)                                             \
+00029                 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
+00030                 : "memory");                                               \
+00031 } while (0)
+00032 #elif defined (__x86_64__)
+00033 #define __stp_strncpy_from_user(dst,src,count,res)                         \
+00034 do {                                                                       \
+00035         long __d0, __d1, __d2;                                             \
+00036         __asm__ __volatile__(                                              \
+00037                 "       testq %1,%1\n"                                     \
+00038                 "       jz 2f\n"                                           \
+00039                 "0:     lodsb\n"                                           \
+00040                 "       stosb\n"                                           \
+00041                 "       testb %%al,%%al\n"                                 \
+00042                 "       jz 1f\n"                                           \
+00043                 "       decq %1\n"                                         \
+00044                 "       jnz 0b\n"                                          \
+00045                 "1:     subq %1,%0\n"                                      \
+00046                 "2:\n"                                                     \
+00047                 ".section .fixup,\"ax\"\n"                                 \
+00048                 "3:     movq %5,%0\n"                                      \
+00049                 "       jmp 2b\n"                                          \
+00050                 ".previous\n"                                              \
+00051                 ".section __ex_table,\"a\"\n"                              \
+00052                 "       .align 8\n"                                        \
+00053                 "       .quad 0b,3b\n"                                     \
+00054                 ".previous"                                                \
+00055                 : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),      \
+00056                   "=&D" (__d2)                                             \
+00057                 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
+00058                 : "memory");                                               \
+00059 } while (0)
+00060 #endif
+00061 
+00078 long
+00079 _stp_strncpy_from_user(char *dst, const char __user *src, long count)
+00080 {
+00081         long res;
+00082         __stp_strncpy_from_user(dst, src, count, res);
+00083         return res;
+00084 }
+00085 
+00099 unsigned long inline
+00100 _stp_copy_from_user (char *dst, const char __user *src, unsigned long count)
+00101 {
+00102         return __copy_from_user_inatomic(dst, src, count);
+00103 }
+00104 
+00115 int _stp_copy_argv_from_user (MAP list, char __user *__user *argv)
+00116 {
+00117         char str[128];
+00118         char __user *vstr;
+00119         int len;
+00120 
+00121         if (argv)
+00122                 argv++;
+00123 
+00124         while (argv != NULL) {
+00125                 if (get_user (vstr, argv))
+00126                         break;
+00127 
+00128                 if (vstr == NULL)
+00129                         break;
+00130                 
+00131                 len = _stp_strncpy_from_user(str, vstr, 128);
+00132                 str[len] = 0;
+00133                 _stp_list_add_str (list, str);
+00134                 argv++;
+00135         }
+00136         return list->num;
+00137 }
+

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/copy_8c.html b/runtime/docs/html/copy_8c.html new file mode 100644 index 00000000..0febb9ab --- /dev/null +++ b/runtime/docs/html/copy_8c.html @@ -0,0 +1,204 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

copy.c File Reference

+

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

Functions

long _stp_strncpy_from_user (char *dst, const char __user *src, long count)
 Copy a NULL-terminated string from userspace.
unsigned long _stp_copy_from_user (char *dst, const char __user *src, unsigned long count)
 Copy a block of data from user space.
int _stp_copy_argv_from_user (MAP list, char __user *__user *argv)
 Copy an argv from user space to a List.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
int _stp_copy_argv_from_user MAP  list,
char __user *__user *  argv
+
+ + + + + +
+   + + +

+Copy an argv from user space to a List. +

+

Parameters:
+ + + +
list A list.
argv Source argv, in user space.
+
+
Returns:
number of elements in list
+Example:
MAP arglist ;
+
+int inst_do_execve (char * filename, char __user *__user *argv, char __user *__user *envp, struct pt_regs * regs)
+{
+  struct map_node_str *ptr;
+
+  _stp_copy_argv_from_user (arglist, argv);
+
+  foreach (arglist, ptr)
+    printk ("%s ", ptr->str);
+  printk ("\n");
+}
+
+

+Definition at line 115 of file copy.c. +

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
unsigned long _stp_copy_from_user char *  dst,
const char __user *  src,
unsigned long  count
[inline]
+
+ + + + + +
+   + + +

+Copy a block of data from user space. +

+If some data could not be copied, this function will pad the copied data to the requested size using zero bytes.

+

Parameters:
+ + + + +
dst Destination address, in kernel space.
src Source address, in user space.
count Number of bytes to copy.
+
+
Returns:
number of bytes that could not be copied. On success, this will be zero.
+ +

+Definition at line 100 of file copy.c.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
long _stp_strncpy_from_user char *  dst,
const char __user *  src,
long  count
+
+ + + + + +
+   + + +

+Copy a NULL-terminated string from userspace. +

+On success, returns the length of the string (not including the trailing NULL).

+If access to userspace fails, returns -EFAULT (some data may have been copied).

Parameters:
+ + + + +
dst Destination address, in kernel space. This buffer must be at least count bytes long.
src Source address, in user space.
count Maximum number of bytes to copy, including the trailing NULL.
+
+If count is smaller than the length of the string, copies count bytes and returns count. +

+Definition at line 79 of file copy.c. +

+Referenced by _stp_copy_argv_from_user().

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/docs_2argv__example_8c-example.html b/runtime/docs/html/docs_2argv__example_8c-example.html new file mode 100644 index 00000000..0ad61d6d --- /dev/null +++ b/runtime/docs/html/docs_2argv__example_8c-example.html @@ -0,0 +1,20 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

docs/argv_example.c

Parameters:
+ + + +
list A list.
argv Source argv, in user space.
+
+
Returns:
number of elements in list
+

Generated on Wed Mar 9 03:35:02 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/doxygen.css b/runtime/docs/html/doxygen.css new file mode 100644 index 00000000..1d4d6311 --- /dev/null +++ b/runtime/docs/html/doxygen.css @@ -0,0 +1,271 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +H1 { + text-align: center; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +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.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } +TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} +.mdRow { + padding: 8px 10px; +} +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 12px; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 12px; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 12px; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 13px; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 12px; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 13px; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 12px; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #eeeeff; +} +TD.tiny { font-size: 75%; +} +a { + color: #252E78; +} +a:visited { + color: #3D2185; +} diff --git a/runtime/docs/html/doxygen.png b/runtime/docs/html/doxygen.png new file mode 100644 index 00000000..f0a274bb Binary files /dev/null and b/runtime/docs/html/doxygen.png differ diff --git a/runtime/docs/html/examples.html b/runtime/docs/html/examples.html new file mode 100644 index 00000000..cd53f417 --- /dev/null +++ b/runtime/docs/html/examples.html @@ -0,0 +1,16 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

SystemTap Examples

Here is a list of all examples: +
Generated on Wed Mar 9 12:24:52 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/files.html b/runtime/docs/html/files.html new file mode 100644 index 00000000..599ee02d --- /dev/null +++ b/runtime/docs/html/files.html @@ -0,0 +1,22 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

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]
README [code]
runtime.h [code]
+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/foreach_8c-example.html b/runtime/docs/html/foreach_8c-example.html new file mode 100644 index 00000000..ccafaeeb --- /dev/null +++ b/runtime/docs/html/foreach_8c-example.html @@ -0,0 +1,28 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

foreach.c

Parameters:
+ + + +
map 
ptr pointer to a map_node_stat, map_node_int64 or map_node_str
+
+
/* example showing how to print all the stats in a map using foreach() */
+
+struct map_node_stat *ptr;
+
+foreach (map, ptr)
+     printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), 
+             key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, 
+             ptr->stats.max);
+
+

Generated on Wed Mar 9 12:24:52 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/ftv2blank.png b/runtime/docs/html/ftv2blank.png new file mode 100644 index 00000000..493c3c0b Binary files /dev/null and b/runtime/docs/html/ftv2blank.png differ diff --git a/runtime/docs/html/ftv2doc.png b/runtime/docs/html/ftv2doc.png new file mode 100644 index 00000000..f72999f9 Binary files /dev/null and b/runtime/docs/html/ftv2doc.png differ diff --git a/runtime/docs/html/ftv2folderclosed.png b/runtime/docs/html/ftv2folderclosed.png new file mode 100644 index 00000000..d6d06344 Binary files /dev/null and b/runtime/docs/html/ftv2folderclosed.png differ diff --git a/runtime/docs/html/ftv2folderopen.png b/runtime/docs/html/ftv2folderopen.png new file mode 100644 index 00000000..bbe2c913 Binary files /dev/null and b/runtime/docs/html/ftv2folderopen.png differ diff --git a/runtime/docs/html/ftv2lastnode.png b/runtime/docs/html/ftv2lastnode.png new file mode 100644 index 00000000..e7b9ba90 Binary files /dev/null and b/runtime/docs/html/ftv2lastnode.png differ diff --git a/runtime/docs/html/ftv2link.png b/runtime/docs/html/ftv2link.png new file mode 100644 index 00000000..14f3fed0 Binary files /dev/null and b/runtime/docs/html/ftv2link.png differ diff --git a/runtime/docs/html/ftv2mlastnode.png b/runtime/docs/html/ftv2mlastnode.png new file mode 100644 index 00000000..09ceb6ad Binary files /dev/null and b/runtime/docs/html/ftv2mlastnode.png differ diff --git a/runtime/docs/html/ftv2mnode.png b/runtime/docs/html/ftv2mnode.png new file mode 100644 index 00000000..3254c051 Binary files /dev/null and b/runtime/docs/html/ftv2mnode.png differ diff --git a/runtime/docs/html/ftv2node.png b/runtime/docs/html/ftv2node.png new file mode 100644 index 00000000..c9f06a57 Binary files /dev/null and b/runtime/docs/html/ftv2node.png differ diff --git a/runtime/docs/html/ftv2plastnode.png b/runtime/docs/html/ftv2plastnode.png new file mode 100644 index 00000000..0b07e009 Binary files /dev/null and b/runtime/docs/html/ftv2plastnode.png differ diff --git a/runtime/docs/html/ftv2pnode.png b/runtime/docs/html/ftv2pnode.png new file mode 100644 index 00000000..2001b797 Binary files /dev/null and b/runtime/docs/html/ftv2pnode.png differ diff --git a/runtime/docs/html/ftv2vertline.png b/runtime/docs/html/ftv2vertline.png new file mode 100644 index 00000000..b330f3a3 Binary files /dev/null and b/runtime/docs/html/ftv2vertline.png differ diff --git a/runtime/docs/html/functions.html b/runtime/docs/html/functions.html new file mode 100644 index 00000000..60b6cf16 --- /dev/null +++ b/runtime/docs/html/functions.html @@ -0,0 +1,43 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Variables
+ +

+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/functions_vars.html b/runtime/docs/html/functions_vars.html new file mode 100644 index 00000000..aa0ebe5a --- /dev/null +++ b/runtime/docs/html/functions_vars.html @@ -0,0 +1,43 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Variables
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals.html b/runtime/docs/html/globals.html new file mode 100644 index 00000000..9c4c693f --- /dev/null +++ b/runtime/docs/html/globals.html @@ -0,0 +1,99 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+
_ | 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:

- _ -

+

- d -

+

- e -

+

- f -

+

- i -

+

- k -

+

- l -

+

- m -

+

- n -

+

- p -

+

- s -

+

- v -

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_defs.html b/runtime/docs/html/globals_defs.html new file mode 100644 index 00000000..ed1d2424 --- /dev/null +++ b/runtime/docs/html/globals_defs.html @@ -0,0 +1,28 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_enum.html b/runtime/docs/html/globals_enum.html new file mode 100644 index 00000000..f12861a2 --- /dev/null +++ b/runtime/docs/html/globals_enum.html @@ -0,0 +1,21 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_eval.html b/runtime/docs/html/globals_eval.html new file mode 100644 index 00000000..f697e2e0 --- /dev/null +++ b/runtime/docs/html/globals_eval.html @@ -0,0 +1,27 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_func.html b/runtime/docs/html/globals_func.html new file mode 100644 index 00000000..3ef3fd40 --- /dev/null +++ b/runtime/docs/html/globals_func.html @@ -0,0 +1,55 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+
_ | d
+ +

+ +

+

- _ -

+

- d -

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_type.html b/runtime/docs/html/globals_type.html new file mode 100644 index 00000000..194983d0 --- /dev/null +++ b/runtime/docs/html/globals_type.html @@ -0,0 +1,19 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/globals_vars.html b/runtime/docs/html/globals_vars.html new file mode 100644 index 00000000..f0282f63 --- /dev/null +++ b/runtime/docs/html/globals_vars.html @@ -0,0 +1,19 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +
All | Functions | Variables | Typedefs | Enumerations | Enumeration values | Defines
+ +

+

+
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/index.html b/runtime/docs/html/index.html new file mode 100644 index 00000000..3796e861 --- /dev/null +++ b/runtime/docs/html/index.html @@ -0,0 +1,40 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

SystemTap Runtime Library

+

+

0.1

+Introduction

+The SystemTap Runtime Library consists of all functions and code fragments needed by the compiler/translator to include in building a kernel module using kprobes.

+Design

+

+Maps (Associative Arrays)

+Maps are implemented as hash lists. It is not expected that users will attempt to collect so much data in kernel space that performance problems will require more complex solutions such as AVL trees.

+Maps are created with _stp_map_new(). Each map can hold only one type of data; int64, string, or statistics. Each element belonging to a map can have up to 2 keys and a value. Implemented key types are strings and longs.

+To simplify the implementation, the functions to set the key and the functions to set the data are separated. That means we need only 4 functions to set the key and 3 functions to set the value.

+For example:

+/* create a map with a max of 100 elements */
+MAP mymap = map_new(100, INT64);
+
+/* mymap[birth year] = 2000 */
+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().

+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/io_8c-source.html b/runtime/docs/html/io_8c-source.html new file mode 100644 index 00000000..5a5c1fe3 --- /dev/null +++ b/runtime/docs/html/io_8c-source.html @@ -0,0 +1,23 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

io.c

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

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/io_8c.html b/runtime/docs/html/io_8c.html new file mode 100644 index 00000000..1419497c --- /dev/null +++ b/runtime/docs/html/io_8c.html @@ -0,0 +1,75 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

io.c File Reference

+

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

Functions

void dlog (const char *fmt,...)
 Logs data.
+


Function Documentation

+

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

+Logs data. +

+This function is compatible with printk. In fact it currently sends all output to vprintk, after sending "STP: ". This allows us to easily detect SystemTap output in the log file.

+

Parameters:
+ + +
fmt A variable number of args.
+
+
Bug:
Lines are limited in length by printk buffer.
+

+

Todo:
Needs replaced with something much faster that does not use the system log.
+ +

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

+Referenced by _stp_list_clear().

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/main.html b/runtime/docs/html/main.html new file mode 100644 index 00000000..59ec4e75 --- /dev/null +++ b/runtime/docs/html/main.html @@ -0,0 +1,17 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

SystemTap Runtime Library

+

+

0.1

+Introduction

+The SystemTap Runtime Library consists of all functions and code fragments needed by the compiler/translator to include in building a kernel module using kprobes.
Generated on Wed Mar 9 01:43:27 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/map_8c-source.html b/runtime/docs/html/map_8c-source.html new file mode 100644 index 00000000..301087fb --- /dev/null +++ b/runtime/docs/html/map_8c-source.html @@ -0,0 +1,661 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map.c

Go to the documentation of this file.
00001 /* -*- linux-c -*- */
+00002 
+00003 static int map_sizes[] = {
+00004         sizeof(struct map_node_int64),
+00005         sizeof(struct map_node_stat),
+00006         sizeof(struct map_node_str),
+00007         0
+00008 };
+00009 
+00010 static inline unsigned string_hash(const char *key1, const char *key2)
+00011 {
+00012         int hash = 0, count = 0;
+00013         char *v1 = (char *)key1;
+00014         char *v2 = (char *)key2;
+00015         while (*v1 && count++ < 5) {
+00016                 hash += *v1++;
+00017         }
+00018         while (v2 && *v2 && count++ < 5) {
+00019                 hash += *v2++;
+00020         }
+00021         return hash_long((unsigned long)hash, HASH_TABLE_BITS);
+00022 }
+00023 
+00024 static inline unsigned mixed_hash(const char *key1, long key2)
+00025 {
+00026         int hash = 0, count = 0;
+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);
+00031 }
+00032 
+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));
+00047         if (m == NULL)
+00048                 return NULL;
+00049 
+00050         INIT_LIST_HEAD(&m->head);
+00051 
+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         }
+00058 
+00059         if (max_entries) {
+00060                 void *tmp;
+00061                 int i;
+00062                 struct list_head *e;
+00063 
+00064                 INIT_LIST_HEAD(&m->pool);
+00065                 size = map_sizes[type];
+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);
+00072                 }
+00073                 m->membuf = tmp;
+00074         }
+00075         return m;
+00076 }
+00077 
+00078 static void map_free_strings(MAP map, struct map_node *n)
+00079 {
+00080         struct map_node_str *m = (struct map_node_str *)n;
+00081         dbug ("n = %lx\n", (long)n);
+00082         if (map->type == STRING) {
+00083                 dbug ("val STRING %lx\n", (long)m->str);
+00084                 if (m->str)
+00085                         _stp_free(m->str);
+00086         }
+00087         if (m->n.key1type == STR) {
+00088                 dbug ("key1 STR %lx\n", (long)key1str(m));
+00089                 if (key1str(m))
+00090                         _stp_free(key1str(m));
+00091         }
+00092         if (m->n.key2type == STR) {
+00093                 dbug ("key2 STR %lx\n", (long)key2str(m));
+00094                 if (key2str(m))
+00095                         _stp_free(key2str(m));
+00096         }
+00097 }
+00098 
+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);
+00109         if (map == NULL)
+00110                 return;
+00111 
+00112         if (map->create) {
+00113                 map->create = 0;
+00114                 map->key = NULL;
+00115                 return;
+00116         }
+00117 
+00118         if (map->key == NULL)
+00119                 return;
+00120 
+00121         m = (struct map_node *)map->key;
+00122 
+00123         /* remove node from old hash list */
+00124         hlist_del_init(&m->hnode);
+00125 
+00126         /* remove from entry list */
+00127         list_del(&m->lnode);
+00128 
+00129         /* remove any allocated string storage */
+00130         map_free_strings(map, (struct map_node *)map->key);
+00131 
+00132         if (map->maxnum)
+00133                 list_add(&m->lnode, &map->pool);
+00134         else
+00135                 _stp_free(m);
+00136 
+00137         map->key = NULL;
+00138         map->num--;
+00139 }
+00140 
+00149 struct map_node *_stp_map_start(MAP map)
+00150 {
+00151         if (map == NULL)
+00152                 return NULL;
+00153 
+00154         dbug ("%lx\n", (long)map->head.next);
+00155 
+00156         if (list_empty(&map->head))
+00157                 return NULL;
+00158 
+00159         return (struct map_node *)map->head.next;
+00160 }
+00161 
+00172 struct map_node *_stp_map_iter(MAP map, struct map_node *m)
+00173 {
+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);
+00178 
+00179         if (m->lnode.next == &map->head)
+00180                 return NULL;
+00181 
+00182         return (struct map_node *)m->lnode.next;
+00183 }
+00184 
+00190 void _stp_map_del(MAP map)
+00191 {
+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) {
+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);
+00204 }
+00205 
+00206 /**********************  KEY FUNCTIONS *********************/
+00207 
+00208 
+00218 void _stp_map_key_long_long(MAP map, long key1, long key2)
+00219 {
+00220         unsigned hv;
+00221         struct hlist_head *head;
+00222         struct hlist_node *e;
+00223 
+00224         if (map == NULL)
+00225                 return;
+00226 
+00227         hv = hash_long(key1 ^ key2, HASH_TABLE_BITS);
+00228         head = &map->hashes[hv];
+00229 
+00230         dbug ("hash for %ld,%ld is %d\n", key1, key2, hv);
+00231 
+00232         hlist_for_each(e, head) {
+00233                 struct map_node *n =
+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;
+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;
+00250 }
+00251 
+00261 void _stp_map_key_str_str(MAP map, char *key1, char *key2)
+00262 {
+00263         unsigned hv;
+00264         struct hlist_head *head;
+00265         struct hlist_node *e;
+00266 
+00267         if (map == NULL)
+00268                 return;
+00269 
+00270         if (key1 == NULL) {
+00271                 map->key = NULL;
+00272                 return;
+00273         }
+00274 
+00275         hv = string_hash(key1, key2);
+00276         head = &map->hashes[hv];
+00277 
+00278         dbug ("hash for %s,%s is %d\n", key1, key2, hv);
+00279 
+00280         hlist_for_each(e, head) {
+00281                 struct map_node *n =
+00282                         (struct map_node *)((long)e - sizeof(struct hlist_node));
+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;
+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;
+00299 }
+00300 
+00310 void _stp_map_key_str_long(MAP map, char *key1, long key2)
+00311 {
+00312         unsigned hv;
+00313         struct hlist_head *head;
+00314         struct hlist_node *e;
+00315 
+00316         if (map == NULL)
+00317                 return;
+00318 
+00319         if (key1 == NULL) {
+00320                 map->key = NULL;
+00321                 return;
+00322         }
+00323 
+00324         hv = mixed_hash(key1, key2);
+00325         head = &map->hashes[hv];
+00326 
+00327         dbug ("hash for %s,%ld is %d\n", key1, key2, hv);
+00328 
+00329         hlist_for_each(e, head) {
+00330                 struct map_node *n =
+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;
+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;
+00347 }
+00348 
+00358 void _stp_map_key_long_str(MAP map, long key1, char *key2)
+00359 {
+00360         unsigned hv;
+00361         struct hlist_head *head;
+00362         struct hlist_node *e;
+00363 
+00364         if (map == NULL)
+00365                 return;
+00366 
+00367         hv = mixed_hash(key2, key1);
+00368         head = &map->hashes[hv];
+00369         dbug ("hash for %ld,%s is %d\n", key1, key2, hv);
+00370 
+00371         hlist_for_each(e, head) {
+00372                 struct map_node *n =
+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;
+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;
+00389 }
+00390 
+00399 void _stp_map_key_str(MAP map, char *key)
+00400 {
+00401         if (map == NULL)
+00402                 return;
+00403         _stp_map_key_str_str(map, key, NULL);
+00404         map->c_key2type = NONE;
+00405 }
+00406 
+00415 void _stp_map_key_long(MAP map, long key)
+00416 {
+00417         if (map == NULL)
+00418                 return;
+00419         _stp_map_key_long_long(map, key, 0);
+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) {
+00430         case 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;
+00436                 break;
+00437         case NONE:
+00438                 /* ERROR */
+00439                 break;
+00440         }
+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);
+00445                 break;
+00446         case LONG:
+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);
+00455         
+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);
+00597                 } else {
+00598                         /* setting value to 0 is the same as deleting */
+00599                         _stp_map_key_del(map);
+00600                 }
+00601         }
+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 *********************/
+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/map_8c.html b/runtime/docs/html/map_8c.html new file mode 100644 index 00000000..d4982cac --- /dev/null +++ b/runtime/docs/html/map_8c.html @@ -0,0 +1,1199 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map.c File Reference

+

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

Functions

MAP _stp_map_new (unsigned max_entries, enum valtype type)
 Create a new map.
void _stp_map_key_del (MAP map)
 Deletes the current element.
map_node_stp_map_start (MAP map)
 Get the first element in a map.
map_node_stp_map_iter (MAP map, struct map_node *m)
 Get the next element in a map.
void _stp_map_del (MAP map)
 Deletes a map.
void _stp_map_key_long_long (MAP map, long key1, long key2)
 Set the map's key to two longs.
void _stp_map_key_str_str (MAP map, char *key1, char *key2)
 Set the map's key to two strings.
void _stp_map_key_str_long (MAP map, char *key1, long key2)
 Set the map's key to a string and a long.
void _stp_map_key_long_str (MAP map, long key1, char *key2)
 Set the map's key to a long and a string.
void _stp_map_key_str (MAP map, char *key)
 Set the map's key to a string.
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)
 Set the current element's value to an int64.
int64_t _stp_map_get_int64 (MAP map)
 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)
 Gets the current element's value.
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)
 Create a new list.
void _stp_list_clear (MAP map)
 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 an int64 to a list.
int _stp_list_size (MAP map)
 Get the number of elements in a list.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_list_add_int64 MAP  map,
int64_t  val
[inline]
+
+ + + + + +
+   + + +

+Adds an int64 to a list. +

+

Parameters:
+ + + +
map 
val 
+
+ +

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

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_list_add_str MAP  map,
char *  str
[inline]
+
+ + + + + +
+   + + +

+Adds a string to a list. +

+

Parameters:
+ + + +
map 
str 
+
+ +

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

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

+Referenced by _stp_copy_argv_from_user().

+

+ + + + +
+ + + + + + + + + +
void _stp_list_clear MAP  map  )  [inline]
+
+ + + + + +
+   + + +

+Clears a list. +

+All elements in the list are deleted.

Parameters:
+ + +
map 
+
+ +

+Definition at line 765 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.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
MAP _stp_list_new unsigned  max_entries,
enum valtype  type
+
+ + + + + +
+   + + +

+Create a new list. +

+A list is a map that internally has an incrementing long key for each member. Lists do not wrap if elements are added to exceed their maximum size.

Parameters:
+ + + +
max_entries The maximum number of entries allowed. Currently that number will be preallocated. If max_entries is 0, there will be no maximum and entries will be allocated dynamically.
type Type of values stored in this list.
+
+
Returns:
A MAP on success or NULL on failure.
+
See also:
foreach
+ +

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

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

+

+ + + + +
+ + + + + + + + + +
int _stp_list_size MAP  map  )  [inline]
+
+ + + + + +
+   + + +

+Get the number of elements in a list. +

+

Parameters:
+ + +
map 
+
+
Returns:
The number of elements in a list.
+ +

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

+References MAP, and map_root::num.

+

+ + + + +
+ + + + + + + + + +
void _stp_map_del MAP  map  ) 
+
+ + + + + +
+   + + +

+Deletes a map. +

+Deletes a map, freeing all memory in all elements. Normally done only when the module exits.

Parameters:
+ + +
map 
+
+ +

+Definition at line 190 of file map.c. +

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

+

+ + + + +
+ + + + + + + + + +
int64_t _stp_map_get_int64 MAP  map  ) 
+
+ + + + + +
+   + + +

+Gets the current element's value. +

+

Parameters:
+ + +
map 
+
+
Returns:
The value. If the current element is not set or doesn't exist, returns 0.
+ +

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

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

+

+ + + + +
+ + + + + + + + + +
stat* _stp_map_get_stat MAP  map  ) 
+
+ + + + + +
+   + + +

+Gets the current element's value. +

+

Parameters:
+ + +
map 
+
+
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. +

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

+

+ + + + +
+ + + + + + + + + +
char* _stp_map_get_str MAP  map  ) 
+
+ + + + + +
+   + + +

+Gets the current element's value. +

+

Parameters:
+ + +
map 
+
+
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. +

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
struct map_node* _stp_map_iter MAP  map,
struct map_node m
+
+ + + + + +
+   + + +

+Get the next element in a map. +

+

Parameters:
+ + + +
map 
m a pointer to the current element, returned from _stp_map_start() or _stp_map_iter().
+
+
Returns:
a pointer to the next element. This is typically used with _stp_map_start(). See the foreach() macro for typical usage. It probably does what you want anyway.
+
See also:
foreach
+ +

+Definition at line 172 of file map.c. +

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

+

+ + + + +
+ + + + + + + + + +
void _stp_map_key_del MAP  map  ) 
+
+ + + + + +
+   + + +

+Deletes the current element. +

+If no current element (key) for this map is set, this function does nothing.

Parameters:
+ + +
map 
+
+ +

+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. +

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_key_long MAP  map,
long  key
+
+ + + + + +
+   + + +

+Set the map's key to a long. +

+This sets the current element based on a long key. If the key is not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + +
map 
key 
+
+ +

+Definition at line 415 of file map.c. +

+References _stp_map_key_long_long(), and MAP. +

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void _stp_map_key_long_long MAP  map,
long  key1,
long  key2
+
+ + + + + +
+   + + +

+Set the map's key to two longs. +

+This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + + +
map 
key1 first key
key2 second key
+
+ +

+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. +

+Referenced by _stp_map_key_long().

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void _stp_map_key_long_str MAP  map,
long  key1,
char *  key2
+
+ + + + + +
+   + + +

+Set the map's key to a long and a string. +

+This sets the current element based on a key of a long and a string. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + + +
map 
key1 first key
key2 second key
+
+ +

+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.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_key_str MAP  map,
char *  key
+
+ + + + + +
+   + + +

+Set the map's key to a string. +

+This sets the current element based on a string key. If the key is not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + +
map 
key 
+
+ +

+Definition at line 399 of file map.c. +

+References _stp_map_key_str_str(), and MAP.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void _stp_map_key_str_long MAP  map,
char *  key1,
long  key2
+
+ + + + + +
+   + + +

+Set the map's key to a string and a long. +

+This sets the current element based on a key of a string and a long. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + + +
map 
key1 first key
key2 second key
+
+ +

+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.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void _stp_map_key_str_str MAP  map,
char *  key1,
char *  key2
+
+ + + + + +
+   + + +

+Set the map's key to two strings. +

+This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.

Parameters:
+ + + + +
map 
key1 first key
key2 second key
+
+ +

+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. +

+Referenced by _stp_map_key_str().

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
MAP _stp_map_new unsigned  max_entries,
enum valtype  type
+
+ + + + + +
+   + + +

+Create a new map. +

+Maps must be created at module initialization time.

Parameters:
+ + + +
max_entries The maximum number of entries allowed. Currently that number will be preallocated. If more entries are required, the oldest ones will be deleted. This makes it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries will be allocated dynamically.
type Type of values stored in this map.
+
+
Returns:
A MAP on success or NULL on failure.
+ +

+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. +

+Referenced by _stp_list_new().

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_set_int64 MAP  map,
int64_t  val
+
+ + + + + +
+   + + +

+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.

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

+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. +

+Referenced by _stp_list_add_int64().

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_set_stat MAP  map,
stat stats
+
+ + + + + +
+   + + +

+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
+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 
stats pointer to stats struct.
+
+
Todo:
Histograms don't work yet.
+ +

+Definition at line 633 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. +

+Referenced by _stp_map_stat_add().

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_set_str MAP  map,
char *  val
+
+ + + + + +
+   + + +

+Set the current element's value to a string. +

+This sets the current element's value to an string. The map must have been created to hold int64s using _stp_map_new(xxx, STRING)

+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 new string
+
+ +

+Definition at line 548 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. +

+Referenced by _stp_list_add_str().

+

+ + + + +
+ + + + + + + + + +
struct map_node* _stp_map_start MAP  map  ) 
+
+ + + + + +
+   + + +

+Get the first element in a map. +

+

Parameters:
+ + +
map 
+
+
Returns:
a pointer to the first element. This is typically used with _stp_map_iter(). See the foreach() macro for typical usage. It probably does what you want anyway.
+
See also:
foreach
+ +

+Definition at line 149 of file map.c. +

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

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void _stp_map_stat_add MAP  map,
int64_t  val
+
+ + + + + +
+   + + +

+Add to the current element's statistics. +

+Increments the statistics counter by one and the sum by val. Adjusts minimum, maximum, and histogram.

+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 to add to the statistics
+
+
Todo:
Histograms don't work yet.
+ +

+Definition at line 713 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.

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/map_8h-source.html b/runtime/docs/html/map_8h-source.html new file mode 100644 index 00000000..9a49236c --- /dev/null +++ b/runtime/docs/html/map_8h-source.html @@ -0,0 +1,146 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map.h

Go to the documentation of this file.
00001 /* -*- linux-c -*- */
+00002 #include <linux/types.h>
+00003 
+00004 typedef struct {
+00005         int64_t count;
+00006         int64_t sum;
+00007         int64_t min, max;
+00008         int64_t histogram[BUCKETS];
+00009 } stat;
+00010 
+00011 union key_data {
+00012         long val;
+00013         char *str;
+00014 };
+00015 
+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 {
+00021         struct list_head lnode;
+00022         struct hlist_node hnode;
+00023         union key_data key1;
+00024         union key_data key2;
+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;
+00033 };
+00034 
+00035 struct map_node_str {
+00036         struct map_node n;
+00037         char *str;
+00038 };
+00039 
+00040 struct map_node_stat {
+00041         struct map_node n;
+00042         stat stats;
+00043 };
+00044 
+00045 struct map_root {
+00046         /* type of the values stored in the array */
+00047         enum valtype type;
+00048 
+00049         /* maximum number of elements allowed in the array. */
+00050         int maxnum;
+00051 
+00052         /* current number of elements */
+00053         int num;
+00054 
+00055         /* when more than maxnum elements, wrap or discard */
+00056         int no_wrap;
+00057 
+00058         /* linked list of current entries */
+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;
+00064 
+00065         /* saved key entry for lookups */
+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;
+00076 
+00077         /* the hash table for this array */
+00078         struct hlist_head hashes[HASH_TABLE_SIZE];
+00079 
+00080         /* pointer to allocated memory space */
+00081         void *membuf;
+00082 };
+00083 
+00084 typedef struct map_root *MAP;
+00085 
+00086 #define key1str(ptr) (ptr->n.key1.str)
+00087 #define key2str(ptr) (ptr->n.key2.str)
+00088 #define key1int(ptr) (ptr->n.key1.val)
+00089 #define key2int(ptr) (ptr->n.key2.val)
+00090 
+00091 #define _stp_map_key2(map, key1, key2)                          \
+00092   ({                                                            \
+00093     if (__builtin_types_compatible_p (typeof (key1), char[]))   \
+00094       if (__builtin_types_compatible_p (typeof (key2), char[])) \
+00095         _stp_map_key_str_str (map, (char *)(key1), (char *)(key2));     \
+00096       else                                                      \
+00097         _stp_map_key_str_long (map, (char *)(key1), (long)(key2));      \
+00098     else                                                        \
+00099       if (__builtin_types_compatible_p (typeof (key2), char[])) \
+00100         _stp_map_key_long_str (map, (long)(key1), (char *)(key2));      \
+00101       else                                                      \
+00102         _stp_map_key_long_long (map, (long)(key1), (long)(key2));       \
+00103   })
+00104 
+00105 #define _stp_map_key(map, key)                          \
+00106   ({                                                            \
+00107     if (__builtin_types_compatible_p (typeof (key), char[]))    \
+00108       _stp_map_key_str (map, (char *)(key));                            \
+00109     else                                                        \
+00110       _stp_map_key_long (map, (long)(key));                             \
+00111   })
+00112 
+00113 #define _stp_map_set(map, val)                          \
+00114   ({                                                            \
+00115     if (__builtin_types_compatible_p (typeof (val), char[]))    \
+00116       _stp_map_set_str (map, (char *)(val));                            \
+00117     else                                                        \
+00118       _stp_map_set_int64 (map, (int64_t)(val));                 \
+00119   })
+00120 
+00121 #define _stp_list_add(map, val)                         \
+00122   ({                                                            \
+00123     if (__builtin_types_compatible_p (typeof (val), char[]))    \
+00124       _stp_list_add_str (map, (char *)(val));                           \
+00125     else                                                        \
+00126       _stp_list_add_int64 (map, (int64_t)(val));                        \
+00127   })
+00128 
+00129 
+00138 #define foreach(map, ptr)                               \
+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/map_8h.html b/runtime/docs/html/map_8h.html new file mode 100644 index 00000000..def7be23 --- /dev/null +++ b/runtime/docs/html/map_8h.html @@ -0,0 +1,535 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map.h File Reference

#include <linux/types.h>
+ +

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

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 key2str(ptr)   (ptr->n.key2.str)
#define key1int(ptr)   (ptr->n.key1.val)
#define key2int(ptr)   (ptr->n.key2.val)
#define _stp_map_key2(map, key1, key2)
#define _stp_map_key(map, key)
#define _stp_map_set(map, val)
#define _stp_list_add(map, val)
#define foreach(map, ptr)
 Loop through all elements of a map.

Typedefs

typedef map_rootMAP

Enumerations

enum  keytype { NONE, +LONG, +STR + }
enum  valtype { INT64, +STAT, +STRING, +END + }

Variables

enum keytype packed
+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + +
#define _stp_list_add map,
val   ) 
+
+ + + + + +
+   + + +

+Value:

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

+Definition at line 121 of file map.h.

+

+ + + + +
+ + + + + + + + + + + + +
#define _stp_map_key map,
key   ) 
+
+ + + + + +
+   + + +

+Value:

({                                                              \
+    if (__builtin_types_compatible_p (typeof (key), char[]))    \
+      _stp_map_key_str (map, (char *)(key));                            \
+    else                                                        \
+      _stp_map_key_long (map, (long)(key));                             \
+  })
+
+

+Definition at line 105 of file map.h.

+

+ + + + +
+ + + + + + + + + + + + + + + +
#define _stp_map_key2 map,
key1,
key2   ) 
+
+ + + + + +
+   + + +

+Value:

({                                                              \
+    if (__builtin_types_compatible_p (typeof (key1), char[]))   \
+      if (__builtin_types_compatible_p (typeof (key2), char[])) \
+        _stp_map_key_str_str (map, (char *)(key1), (char *)(key2));     \
+      else                                                      \
+        _stp_map_key_str_long (map, (char *)(key1), (long)(key2));      \
+    else                                                        \
+      if (__builtin_types_compatible_p (typeof (key2), char[])) \
+        _stp_map_key_long_str (map, (long)(key1), (char *)(key2));      \
+      else                                                      \
+        _stp_map_key_long_long (map, (long)(key1), (long)(key2));       \
+  })
+
+

+Definition at line 91 of file map.h.

+

+ + + + +
+ + + + + + + + + + + + +
#define _stp_map_set map,
val   ) 
+
+ + + + + +
+   + + +

+Value:

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

+Definition at line 113 of file map.h.

+

+ + + + +
+ + + + + + + + + + + + +
#define foreach map,
ptr   ) 
+
+ + + + + +
+   + + +

+Value:

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

+

Parameters:
+ + + +
map 
ptr pointer to a map_node_stat, map_node_int64 or map_node_str
+
+Example:
/* example showing how to print all the stats in a map using foreach() */
+
+struct map_node_stat *ptr;
+
+foreach (map, ptr)
+     printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), 
+             key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, 
+             ptr->stats.max);
+
+
+

+Definition at line 138 of file map.h.

+

+ + + + +
+ + + + + + + + + +
#define key1int ptr   )    (ptr->n.key1.val)
+
+ + + + + +
+   + + +

+ +

+Definition at line 88 of file map.h.

+

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

+ +

+Definition at line 86 of file map.h.

+

+ + + + +
+ + + + + + + + + +
#define key2int ptr   )    (ptr->n.key2.val)
+
+ + + + + +
+   + + +

+ +

+Definition at line 89 of file map.h.

+

+ + + + +
+ + + + + + + + + +
#define key2str ptr   )    (ptr->n.key2.str)
+
+ + + + + +
+   + + +

+ +

+Definition at line 87 of file map.h.

+


Typedef Documentation

+

+ + + + +
+ + + + +
typedef struct map_root* MAP
+
+ + + + + +
+   + + +

+ +

+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().

+


Enumeration Type Documentation

+

+ + + + +
+ + + + +
enum keytype
+
+ + + + + +
+   + + +

+

Enumeration values:
+ + + + +
NONE  +
LONG  +
STR  +
+
+ +

+Definition at line 16 of file map.h.

+

+ + + + +
+ + + + +
enum valtype
+
+ + + + + +
+   + + +

+

Enumeration values:
+ + + + + +
INT64  +
STAT  +
STRING  +
END  +
+
+ +

+Definition at line 17 of file map.h.

+


Variable Documentation

+

+ + + + +
+ + + + +
enum keytype packed
+
+ + + + + +
+   + + +

+

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/pages.html b/runtime/docs/html/pages.html new file mode 100644 index 00000000..10838534 --- /dev/null +++ b/runtime/docs/html/pages.html @@ -0,0 +1,19 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

SystemTap Related Pages

Here is a list of all related documentation pages: +
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/runtime_8h-source.html b/runtime/docs/html/runtime_8h-source.html new file mode 100644 index 00000000..b688d351 --- /dev/null +++ b/runtime/docs/html/runtime_8h-source.html @@ -0,0 +1,31 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

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"
+00016 
+00017 #define dbug(args...) ;
+00018 
+

Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/runtime_8h.html b/runtime/docs/html/runtime_8h.html new file mode 100644 index 00000000..89b24097 --- /dev/null +++ b/runtime/docs/html/runtime_8h.html @@ -0,0 +1,67 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

runtime.h File Reference

#include <linux/module.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <linux/hash.h>
+#include <linux/string.h>
+#include <linux/kprobes.h>
+#include <linux/proc_fs.h>
+#include <linux/vmalloc.h>
+#include <linux/time.h>
+#include <linux/spinlock.h>
+#include <asm/uaccess.h>
+#include "alloc.h"
+#include "map.h"
+ +

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

Defines

#define dbug(args...)   ;
+


Define Documentation

+

+ + + + +
+ + + + + + + + + +
#define dbug args...   )    ;
+
+ + + + + +
+   + + +

+ +

+Definition at line 17 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().

+


Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structmap__node.html b/runtime/docs/html/structmap__node.html new file mode 100644 index 00000000..0f1dbc42 --- /dev/null +++ b/runtime/docs/html/structmap__node.html @@ -0,0 +1,138 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map_node Struct Reference

#include <map.h> +

+ + + + + + + + + + + +

Data Fields

list_head lnode
hlist_node hnode
key_data key1
key_data key2
+


Field Documentation

+

+ + + + +
+ + + + +
struct hlist_node map_node::hnode
+
+ + + + + +
+   + + +

+ +

+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().

+

+ + + + +
+ + + + +
union key_data map_node::key1
+
+ + + + + +
+   + + +

+ +

+Definition at line 23 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().

+

+ + + + +
+ + + + +
union key_data map_node::key2
+
+ + + + + +
+   + + +

+ +

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

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

+

+ + + + +
+ + + + +
struct list_head map_node::lnode
+
+ + + + + +
+   + + +

+ +

+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().

+


The documentation for this struct was generated from the following file: +
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structmap__node__int64.html b/runtime/docs/html/structmap__node__int64.html new file mode 100644 index 00000000..d2ec7317 --- /dev/null +++ b/runtime/docs/html/structmap__node__int64.html @@ -0,0 +1,80 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map_node_int64 Struct Reference

#include <map.h> +

+ + + + + + + +

Data Fields

map_node n
int64_t val
+


Field Documentation

+

+ + + + +
+ + + + +
struct map_node map_node_int64::n
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_set_int64().

+

+ + + + +
+ + + + +
int64_t map_node_int64::val
+
+ + + + + +
+   + + +

+ +

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

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

+


The documentation for this struct was generated from the following file: +
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structmap__node__stat.html b/runtime/docs/html/structmap__node__stat.html new file mode 100644 index 00000000..0d8fdb95 --- /dev/null +++ b/runtime/docs/html/structmap__node__stat.html @@ -0,0 +1,80 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map_node_stat Struct Reference

#include <map.h> +

+ + + + + + + +

Data Fields

map_node n
stat stats
+


Field Documentation

+

+ + + + +
+ + + + +
struct map_node map_node_stat::n
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_set_stat().

+

+ + + + +
+ + + + +
stat map_node_stat::stats
+
+ + + + + +
+   + + +

+ +

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

+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structmap__node__str.html b/runtime/docs/html/structmap__node__str.html new file mode 100644 index 00000000..a7d78bed --- /dev/null +++ b/runtime/docs/html/structmap__node__str.html @@ -0,0 +1,80 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map_node_str Struct Reference

#include <map.h> +

+ + + + + + + +

Data Fields

map_node n
char * str
+


Field Documentation

+

+ + + + +
+ + + + +
struct map_node map_node_str::n
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_set_str().

+

+ + + + +
+ + + + +
char* map_node_str::str
+
+ + + + + +
+   + + +

+ +

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

+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structmap__root.html b/runtime/docs/html/structmap__root.html new file mode 100644 index 00000000..d6a7418a --- /dev/null +++ b/runtime/docs/html/structmap__root.html @@ -0,0 +1,370 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

map_root Struct Reference

#include <map.h> +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Fields

int maxnum
int num
int no_wrap
list_head head
list_head pool
map_nodekey
u_int8_t create
hlist_head * c_keyhead
key_data c_key1
key_data c_key2
hlist_head hashes [HASH_TABLE_SIZE]
void * membuf
+


Field Documentation

+

+ + + + +
+ + + + +
union key_data map_root::c_key1
+
+ + + + + +
+   + + +

+ +

+Definition at line 74 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().

+

+ + + + +
+ + + + +
union key_data map_root::c_key2
+
+ + + + + +
+   + + +

+ +

+Definition at line 75 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().

+

+ + + + +
+ + + + +
struct hlist_head* map_root::c_keyhead
+
+ + + + + +
+   + + +

+ +

+Definition at line 73 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().

+

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

+ +

+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().

+

+ + + + +
+ + + + +
struct hlist_head map_root::hashes[HASH_TABLE_SIZE]
+
+ + + + + +
+   + + +

+ +

+Definition at line 78 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().

+

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

+ +

+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().

+

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

+ +

+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().

+

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

+ +

+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().

+

+ + + + +
+ + + + +
void* map_root::membuf
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_del(), and _stp_map_new().

+

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

+ +

+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().

+

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

+ +

+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().

+

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

+ +

+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().

+


The documentation for this struct was generated from the following file: +
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/structstat.html b/runtime/docs/html/structstat.html new file mode 100644 index 00000000..47627657 --- /dev/null +++ b/runtime/docs/html/structstat.html @@ -0,0 +1,165 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

stat Struct Reference

#include <map.h> +

+ + + + + + + + + + + + + +

Data Fields

int64_t count
int64_t sum
int64_t min
int64_t max
int64_t histogram [BUCKETS]
+


Field Documentation

+

+ + + + +
+ + + + +
int64_t stat::count
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_stat_add().

+

+ + + + +
+ + + + +
int64_t stat::histogram[BUCKETS]
+
+ + + + + +
+   + + +

+ +

+Definition at line 8 of file map.h.

+

+ + + + +
+ + + + +
int64_t stat::max
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_stat_add().

+

+ + + + +
+ + + + +
int64_t stat::min
+
+ + + + + +
+   + + +

+ +

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

+Referenced by _stp_map_stat_add().

+

+ + + + +
+ + + + +
int64_t stat::sum
+
+ + + + + +
+   + + +

+ +

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

+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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/todo.html b/runtime/docs/html/todo.html new file mode 100644 index 00000000..d4f0d051 --- /dev/null +++ b/runtime/docs/html/todo.html @@ -0,0 +1,32 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

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,...)
+
Needs replaced with something much faster that does not use the system log.
+
+

+

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

+

+
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  + +doxygen 1.3.9.1
+ + diff --git a/runtime/docs/html/tree.html b/runtime/docs/html/tree.html new file mode 100644 index 00000000..1d3f49b0 --- /dev/null +++ b/runtime/docs/html/tree.html @@ -0,0 +1,139 @@ + + + + + + + TreeView + + + + + +
+

SystemTap

+
+

o*SystemTap Runtime Library

+

o+File List

+ +

o+Data Structures

+ +

o*Data Fields

+

\*Globals

+
+
+ + diff --git a/runtime/docs/html/unionkey__data.html b/runtime/docs/html/unionkey__data.html new file mode 100644 index 00000000..e2f2a66e --- /dev/null +++ b/runtime/docs/html/unionkey__data.html @@ -0,0 +1,80 @@ + + +SystemTap: SystemTap Runtime Library + + +
Intro | Functions | Defines | Enumerations | Enumeration Values
+ + +

key_data Union Reference

#include <map.h> +

+ + + + + + + +

Data Fields

long val
char * str
+


Field Documentation

+

+ + + + +
+ + + + +
char* key_data::str
+
+ + + + + +
+   + + +

+ +

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

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

+

+ + + + +
+ + + + +
long key_data::val
+
+ + + + + +
+   + + +

+ +

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

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

+


The documentation for this union was generated from the following file: +
Generated on Wed Mar 9 13:21:28 2005 for SystemTap by  + +doxygen 1.3.9.1
+ + -- cgit