diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-06-20 21:23:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-06-20 21:23:19 +0200 |
commit | e30be653e677f618e1d6a43edd45392a29c3e92e (patch) | |
tree | ee10d5e583ce7cc598e4e7be2723afda29a0b5bc /src | |
parent | b524c764aba149018fa83dec742c21dc8116838e (diff) | |
download | conntrack-tools-e30be653e677f618e1d6a43edd45392a29c3e92e.tar.gz conntrack-tools-e30be653e677f618e1d6a43edd45392a29c3e92e.zip |
conntrackd: add statistics about queue node objects
This patch adds the statistics for queue node objects.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/queue.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/queue.c b/src/queue.c index 6f5707f..465f47c 100644 --- a/src/queue.c +++ b/src/queue.c @@ -26,6 +26,7 @@ #include <sys/socket.h> static LIST_HEAD(queue_list); /* list of existing queues */ +static uint32_t qobjects_num; /* number of active queue objects */ struct queue * queue_create(const char *name, int max_objects, unsigned int flags) @@ -68,6 +69,10 @@ void queue_stats_show(int fd) int size = 0; char buf[512]; + size += snprintf(buf+size, sizeof(buf), + "allocated queue nodes:\t\t%12u\n\n", + qobjects_num); + list_for_each_entry(this, &queue_list, list) { size += snprintf(buf+size, sizeof(buf), "queue %s:\n" @@ -101,6 +106,7 @@ struct queue_object *queue_object_new(int type, size_t size) obj->qnode.size = size; queue_node_init(&obj->qnode, type); + qobjects_num++; return obj; } @@ -108,6 +114,7 @@ struct queue_object *queue_object_new(int type, size_t size) void queue_object_free(struct queue_object *obj) { free(obj); + qobjects_num--; } int queue_add(struct queue *b, struct queue_node *n) |