summaryrefslogtreecommitdiffstats
path: root/runtime/map.h
diff options
context:
space:
mode:
authorhunt <hunt>2005-03-22 08:57:11 +0000
committerhunt <hunt>2005-03-22 08:57:11 +0000
commitb9c556e44326b40b2c927a0a5b5626332a8c9587 (patch)
treed0497c9323dedcb292d353d79fef769fa6fef210 /runtime/map.h
parent4a4753cb066f60eb09906a6021997ec280d3fdc5 (diff)
downloadsystemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.gz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.xz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.zip
*** empty log message ***
Diffstat (limited to 'runtime/map.h')
-rw-r--r--runtime/map.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/runtime/map.h b/runtime/map.h
index 617ff3e2..019da3d0 100644
--- a/runtime/map.h
+++ b/runtime/map.h
@@ -1,6 +1,12 @@
/* -*- linux-c -*- */
+/** @file map.h
+ * @brief Header file for maps and lists
+ */
+
#include <linux/types.h>
+/** Statistics are stored in this struct
+*/
typedef struct {
int64_t count;
int64_t sum;
@@ -8,6 +14,8 @@ typedef struct {
int64_t histogram[BUCKETS];
} stat;
+/** Keys are either longs or char *
+ */
union key_data {
long val;
char *str;
@@ -16,7 +24,8 @@ union key_data {
enum keytype { NONE, LONG, STR } __attribute__ ((packed));
enum valtype { INT64, STAT, STRING, END };
-/* all map nodes have the following structure */
+/** all map nodes have the following structure
+*/
struct map_node {
struct list_head lnode;
struct hlist_node hnode;
@@ -42,12 +51,12 @@ struct map_node_stat {
stat stats;
};
+/** This structure contains all information about a map.
+ * It is allocated once when _stp_map_new() is called.
+ */
struct map_root {
- /* type of the values stored in the array */
- enum valtype type;
-
- /* maximum number of elements allowed in the array. */
- int maxnum;
+ enum valtype type; /** type of the values stored in the array */
+ int maxnum; /** maximum number of elements allowed in the array. */
/* current number of elements */
int num;
@@ -81,6 +90,8 @@ struct map_root {
void *membuf;
};
+/** All maps are of this type.
+ */
typedef struct map_root *MAP;
#define key1str(ptr) (ptr->n.key1.str)