diff options
Diffstat (limited to 'runtime/transport')
-rw-r--r-- | runtime/transport/ChangeLog | 6 | ||||
-rw-r--r-- | runtime/transport/control.c | 12 | ||||
-rw-r--r-- | runtime/transport/procfs.c | 20 | ||||
-rw-r--r-- | runtime/transport/relayfs.c | 4 | ||||
-rw-r--r-- | runtime/transport/symbols.c | 22 | ||||
-rw-r--r-- | runtime/transport/transport.c | 3 | ||||
-rw-r--r-- | runtime/transport/utt.c | 6 |
7 files changed, 40 insertions, 33 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index 263a6bf8..26268e66 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,3 +1,9 @@ +2008-01-15 Martin Hunt <hunt@redhat.com> + + Support for DEBUG_MEM + * transport.c (_stp_transport): Call stp_mem_debug_done(); + * (*.c): Call stp malloc and free functions. + 2007-11-09 Masami Hiramatsu <mhiramat@redhat.com> PR3858 diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 7846572a..3cfeca1e 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -1,7 +1,7 @@ /* -*- linux-c -*- * * debugfs control channel - * Copyright (C) 2007 Red Hat Inc. + * Copyright (C) 2007, 2008 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 @@ -422,7 +422,7 @@ static int _stp_register_ctl_channel (void) /* allocate buffers */ for (i = 0; i < STP_DEFAULT_BUFFERS; i++) { - p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS); + p = (struct list_head *)_stp_kmalloc(sizeof(struct _stp_buffer)); // printk("allocated buffer at %lx\n", (long)p); if (!p) goto err0; @@ -448,7 +448,7 @@ err0: list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - kfree(p); + _stp_kfree(p); } errk ("Error creating systemtap debugfs entries.\n"); return -1; @@ -464,15 +464,15 @@ static void _stp_unregister_ctl_channel (void) /* free memory pools */ list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - kfree(p); + _stp_kfree(p); } list_for_each_safe(p, tmp, &_stp_sym_ready_q) { list_del(p); - kfree(p); + _stp_kfree(p); } list_for_each_safe(p, tmp, &_stp_ctl_ready_q) { list_del(p); - kfree(p); + _stp_kfree(p); } } diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c index 069e379e..5d40cae4 100644 --- a/runtime/transport/procfs.c +++ b/runtime/transport/procfs.c @@ -1,7 +1,7 @@ /* -*- linux-c -*- * * /proc transport and control - * Copyright (C) 2005-2007 Red Hat Inc. + * Copyright (C) 2005-2008 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 @@ -485,7 +485,7 @@ static int _stp_set_buffers(int num) if (num > _stp_current_buffers) { for (i = 0; i < num - _stp_current_buffers; i++) { - p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS); + p = (struct list_head *)_stp_kmalloc(sizeof(struct _stp_buffer)); if (!p) { _stp_current_buffers += i; goto err; @@ -501,7 +501,7 @@ static int _stp_set_buffers(int num) p = _stp_pool_q.next; list_del(p); spin_unlock_irqrestore(&_stp_pool_lock, flags); - kfree(p); + _stp_kfree(p); } } _stp_current_buffers = num; @@ -542,7 +542,7 @@ static int _stp_register_ctl_channel (void) /* allocate buffers */ for (i = 0; i < STP_DEFAULT_BUFFERS; i++) { - p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS); + p = (struct list_head *)_stp_kmalloc(sizeof(struct _stp_buffer)); // printk("allocated buffer at %lx\n", (long)p); if (!p) goto err0; @@ -593,7 +593,7 @@ err2: err1: #ifdef STP_BULKMODE for (de = _stp_proc_root->subdir; de; de = de->next) - kfree (de->data); + _stp_kfree (de->data); for_each_cpu(j) { if (j == i) break; @@ -607,7 +607,7 @@ err1: err0: list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - kfree(p); + _stp_kfree(p); } errk ("Error creating systemtap /proc entries.\n"); @@ -624,7 +624,7 @@ static void _stp_unregister_ctl_channel (void) struct proc_dir_entry *de; kbug("unregistering procfs\n"); for (de = _stp_proc_root->subdir; de; de = de->next) - kfree (de->data); + _stp_kfree (de->data); for_each_cpu(i) { sprintf(buf, "%d", i); @@ -640,15 +640,15 @@ static void _stp_unregister_ctl_channel (void) /* free memory pools */ list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - kfree(p); + _stp_kfree(p); } list_for_each_safe(p, tmp, &_stp_sym_ready_q) { list_del(p); - kfree(p); + _stp_kfree(p); } list_for_each_safe(p, tmp, &_stp_ctl_ready_q) { list_del(p); - kfree(p); + _stp_kfree(p); } } diff --git a/runtime/transport/relayfs.c b/runtime/transport/relayfs.c index 2c7ca754..375c8e59 100644 --- a/runtime/transport/relayfs.c +++ b/runtime/transport/relayfs.c @@ -118,7 +118,7 @@ err: _stp_remove_relay_dir(utt->dir); if (utt->utt_tree_root) _stp_remove_relay_root(utt->utt_tree_root); - kfree(utt); + _stp_kfree(utt); return NULL; } @@ -173,7 +173,7 @@ int utt_trace_remove(struct utt_trace *utt) _stp_remove_relay_dir(utt->dir); if (utt->utt_tree_root) _stp_remove_relay_root(utt->utt_tree_root); - kfree(utt); + _stp_kfree(utt); } return 0; } diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c index 1d930183..a3ab5807 100644 --- a/runtime/transport/symbols.c +++ b/runtime/transport/symbols.c @@ -90,10 +90,10 @@ static struct _stp_module * _stp_alloc_module(unsigned num, unsigned datasize) bad: if (mod) { if (mod->allocated && mod->symbols) - vfree(mod->symbols); + _stp_vfree(mod->symbols); else - kfree(mod->symbols); - kfree(mod); + _stp_kfree(mod->symbols); + _stp_kfree(mod); } return NULL; } @@ -109,19 +109,19 @@ static void _stp_free_module(struct _stp_module *mod) /* free symbol memory */ if (mod->num_symbols) { if (mod->allocated & 1) - vfree(mod->symbols); + _stp_vfree(mod->symbols); else - kfree(mod->symbols); + _stp_kfree(mod->symbols); if (mod->allocated & 2) - vfree(mod->symbol_data); + _stp_vfree(mod->symbol_data); else - kfree(mod->symbol_data); + _stp_kfree(mod->symbol_data); } if (mod->sections) - kfree(mod->sections); + _stp_kfree(mod->sections); /* free module memory */ - kfree(mod); + _stp_kfree(mod); } /* Delete a module and free its memory. */ @@ -455,7 +455,7 @@ static int _stp_do_module(const char __user *buf, int count) return -EFAULT; } if (copy_from_user ((char *)tmpmod.sections, buf+sizeof(tmpmod), count-sizeof(tmpmod))) { - kfree(tmpmod.sections); + _stp_kfree(tmpmod.sections); return -EFAULT; } for (i = 0; i < tmpmod.num_sections; i++) { @@ -472,7 +472,7 @@ static int _stp_do_module(const char __user *buf, int count) /* load symbols from tmpmod.module to mod */ mod = _stp_load_module_symbols(&tmpmod); if (mod == NULL) { - kfree(tmpmod.sections); + _stp_kfree(tmpmod.sections); return 0; } diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c index 2904cf2f..0b18b275 100644 --- a/runtime/transport/transport.c +++ b/runtime/transport/transport.c @@ -2,7 +2,7 @@ * transport.c - stp transport functions * * Copyright (C) IBM Corporation, 2005 - * Copyright (C) Red Hat Inc, 2005-2007 + * Copyright (C) Red Hat Inc, 2005-2008 * Copyright (C) Intel Corporation, 2006 * * This file is part of systemtap, and is free software. You can @@ -215,6 +215,7 @@ void _stp_transport_close() _stp_free_modules(); _stp_kill_time(); _stp_print_cleanup(); /* free print buffers */ + _stp_mem_debug_done(); kbug("---- CLOSED ----\n"); } diff --git a/runtime/transport/utt.c b/runtime/transport/utt.c index ac2e1513..182c1178 100644 --- a/runtime/transport/utt.c +++ b/runtime/transport/utt.c @@ -88,7 +88,7 @@ void utt_trace_cleanup(struct utt_trace *utt) if (utt->dropped_file) debugfs_remove(utt->dropped_file); utt_remove_tree(utt); - kfree(utt); + _stp_kfree(utt); } int utt_trace_remove(struct utt_trace *utt) @@ -207,7 +207,7 @@ struct utt_trace *utt_trace_setup(struct utt_trace_setup *utts) goto err; ret = -ENOMEM; - utt = kzalloc(sizeof(*utt), GFP_KERNEL); + utt = _stp_kzalloc(sizeof(*utt)); if (!utt) goto err; @@ -251,7 +251,7 @@ err: debugfs_remove(utt->dropped_file); if (utt->rchan) relay_close(utt->rchan); - kfree(utt); + _stp_kfree(utt); } if (dir) utt_remove_tree(utt); |