summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorhunt <hunt>2007-01-29 20:44:38 +0000
committerhunt <hunt>2007-01-29 20:44:38 +0000
commit45cf0d811a60287a12ce1641e569034753962ade (patch)
tree78bf98a215a4b57cb06b282f832efc34f3261fae /runtime
parent4b670dde47e0899370182f85b909bcf1f242b722 (diff)
downloadsystemtap-steved-45cf0d811a60287a12ce1641e569034753962ade.tar.gz
systemtap-steved-45cf0d811a60287a12ce1641e569034753962ade.tar.xz
systemtap-steved-45cf0d811a60287a12ce1641e569034753962ade.zip
2007-01-29 Martin Hunt <hunt@redhat.com>
* procfs.c: Count allocated IO memory. * symbols.c: Use _stp_kmalloc() and _stp_kzalloc(). * transport.c: Count allocated IO memory.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/transport/ChangeLog6
-rw-r--r--runtime/transport/procfs.c6
-rw-r--r--runtime/transport/symbols.c9
-rw-r--r--runtime/transport/transport.c1
4 files changed, 15 insertions, 7 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index 75197296..f25602b4 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-29 Martin Hunt <hunt@redhat.com>
+
+ * procfs.c: Count allocated IO memory.
+ * symbols.c: Use _stp_kmalloc() and _stp_kzalloc().
+ * transport.c: Count allocated IO memory.
+
2007-01-09 Martin Hunt <hunt@redhat.com>
* symbols.c (_stp_del_module): Fix so memory allocated
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c
index 794f5c96..136c6d06 100644
--- a/runtime/transport/procfs.c
+++ b/runtime/transport/procfs.c
@@ -1,7 +1,7 @@
/* -*- linux-c -*-
*
* /proc transport and control
- * Copyright (C) 2005, 2006 Red Hat Inc.
+ * Copyright (C) 2005, 2006, 2007 Red Hat Inc.
*
* This file is part of systemtap, and is free software. You can
* redistribute it and/or modify it under the terms of the GNU General
@@ -280,6 +280,7 @@ static int _stp_set_buffers(int num)
_stp_current_buffers += i;
goto err;
}
+ _stp_allocated_net_memory += sizeof(struct _stp_buffer);
spin_lock_irqsave(&_stp_pool_lock, flags);
list_add (p, &_stp_pool_q);
spin_unlock_irqrestore(&_stp_pool_lock, flags);
@@ -318,6 +319,7 @@ static int _stp_register_procfs (void)
// printk("allocated buffer at %lx\n", (long)p);
if (!p)
goto err2;
+ _stp_allocated_net_memory += sizeof(struct _stp_buffer);
list_add (p, &_stp_pool_q);
}
@@ -350,7 +352,7 @@ static int _stp_register_procfs (void)
if (de == NULL)
goto err1;
de->proc_fops = &_stp_proc_fops;
- de->data = kmalloc(sizeof(int), STP_ALLOC_FLAGS);
+ de->data = _stp_kmalloc(sizeof(int));
if (de->data == NULL) {
remove_proc_entry (buf, _stp_proc_mod);
goto err1;
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
index 2aa4897e..d6d70468 100644
--- a/runtime/transport/symbols.c
+++ b/runtime/transport/symbols.c
@@ -63,12 +63,11 @@ static unsigned _stp_get_sym_sizes(struct module *m, unsigned *dsize)
/* allocate space for a module and symbols */
static struct _stp_module * _stp_alloc_module(unsigned num, unsigned datasize)
{
- struct _stp_module *mod = (struct _stp_module *)kmalloc(sizeof(struct _stp_module), STP_ALLOC_FLAGS);
+ struct _stp_module *mod = (struct _stp_module *)_stp_kzalloc(sizeof(struct _stp_module));
if (mod == NULL)
goto bad;
- memset(mod, 0, sizeof(struct _stp_module));
- mod->symbols = (struct _stp_symbol *)kmalloc(num * sizeof(struct _stp_symbol), STP_ALLOC_FLAGS);
+ mod->symbols = (struct _stp_symbol *)_stp_kmalloc(num * sizeof(struct _stp_symbol));
if (mod->symbols == NULL) {
mod->symbols = (struct _stp_symbol *)_stp_vmalloc(num * sizeof(struct _stp_symbol));
if (mod->symbols == NULL)
@@ -76,7 +75,7 @@ static struct _stp_module * _stp_alloc_module(unsigned num, unsigned datasize)
mod->allocated = 1;
}
- mod->symbol_data = kmalloc(datasize, STP_ALLOC_FLAGS);
+ mod->symbol_data = _stp_kmalloc(datasize);
if (mod->symbol_data == NULL) {
mod->symbol_data = _stp_vmalloc(datasize);
if (mod->symbol_data == NULL)
@@ -360,7 +359,7 @@ static int _stp_do_module(const char __user *buf, int count)
return count;
/* copy in section data */
- tmpmod.sections = kmalloc(count - sizeof(tmpmod), STP_ALLOC_FLAGS);
+ tmpmod.sections = _stp_kmalloc(count - sizeof(tmpmod));
if (tmpmod.sections == NULL) {
printk("_stp_do_module: unable to allocate memory.\n");
return -EFAULT;
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index 1265a7dd..5bd6eb16 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -292,6 +292,7 @@ int _stp_transport_open(struct _stp_transport_info *info)
#endif
_stp_chan = _stp_relayfs_open(n_subbufs, subbuf_size, _stp_pid, &_stp_dir);
+ _stp_allocated_net_memory += n_subbufs * subbuf_size;
if (!_stp_chan)
return -ENOMEM;