diff options
author | hunt <hunt> | 2006-11-15 17:54:13 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-11-15 17:54:13 +0000 |
commit | 07c66d4067739f4b5090143c2fdc97dd0b9ee922 (patch) | |
tree | a2958f18a383e13810643bb784a5c052353fe7df | |
parent | 132c23b4b9134b9e8969fb57484f9fcdad1d46f5 (diff) | |
download | systemtap-steved-07c66d4067739f4b5090143c2fdc97dd0b9ee922.tar.gz systemtap-steved-07c66d4067739f4b5090143c2fdc97dd0b9ee922.tar.xz systemtap-steved-07c66d4067739f4b5090143c2fdc97dd0b9ee922.zip |
2006-11-15 Martin Hunt <hunt@redhat.com>
* procfs.c (_stp_proc_write_cmd): For STP_SYMBOLS,
type field is a long to preserve alignment.
Use STP_ALLOC_FLAGS.
* symbols.c: Use STP_ALLOC_FLAGS.
-rw-r--r-- | runtime/transport/ChangeLog | 8 | ||||
-rw-r--r-- | runtime/transport/procfs.c | 15 | ||||
-rw-r--r-- | runtime/transport/symbols.c | 12 |
3 files changed, 24 insertions, 11 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index d6206855..ce4b3f50 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,3 +1,11 @@ +2006-11-15 Martin Hunt <hunt@redhat.com> + + * procfs.c (_stp_proc_write_cmd): For STP_SYMBOLS, + type field is a long to preserve alignment. + Use STP_ALLOC_FLAGS. + + * symbols.c: Use STP_ALLOC_FLAGS. + 2006-11-09 Martin Hunt <hunt@redhat.com> * transport_msgs.h: Change all ints to int32_t. Prefix diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c index 77cfa627..794f5c96 100644 --- a/runtime/transport/procfs.c +++ b/runtime/transport/procfs.c @@ -81,8 +81,13 @@ static ssize_t _stp_proc_write_cmd (struct file *file, const char __user *buf, //printk ("_stp_proc_write_cmd. count:%d type:%d\n", count, type); - count -= sizeof(int); - buf += sizeof(int); + if (type == STP_SYMBOLS) { + count -= sizeof(long); + buf += sizeof(long); + } else { + count -= sizeof(int); + buf += sizeof(int); + } switch (type) { case STP_START: @@ -270,7 +275,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),GFP_KERNEL); + p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS); if (!p) { _stp_current_buffers += i; goto err; @@ -309,7 +314,7 @@ static int _stp_register_procfs (void) /* allocate buffers */ for (i = 0; i < STP_DEFAULT_BUFFERS; i++) { - p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),GFP_KERNEL); + p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS); // printk("allocated buffer at %lx\n", (long)p); if (!p) goto err2; @@ -345,7 +350,7 @@ static int _stp_register_procfs (void) if (de == NULL) goto err1; de->proc_fops = &_stp_proc_fops; - de->data = kmalloc(sizeof(int), GFP_KERNEL); + de->data = kmalloc(sizeof(int), STP_ALLOC_FLAGS); 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 794e7391..7381a82e 100644 --- a/runtime/transport/symbols.c +++ b/runtime/transport/symbols.c @@ -63,22 +63,22 @@ 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), GFP_KERNEL); + struct _stp_module *mod = (struct _stp_module *)kmalloc(sizeof(struct _stp_module), STP_ALLOC_FLAGS); if (mod == NULL) goto bad; memset(mod, 0, sizeof(struct _stp_module)); - mod->symbols = (struct _stp_symbol *)kmalloc(num * sizeof(struct _stp_symbol), GFP_KERNEL); + mod->symbols = (struct _stp_symbol *)kmalloc(num * sizeof(struct _stp_symbol), STP_ALLOC_FLAGS); if (mod->symbols == NULL) { - mod->symbols = (struct _stp_symbol *)vmalloc(num * sizeof(struct _stp_symbol)); + mod->symbols = (struct _stp_symbol *)_stp_vmalloc(num * sizeof(struct _stp_symbol)); if (mod->symbols == NULL) goto bad; mod->allocated = 1; } - mod->symbol_data = kmalloc(datasize, GFP_KERNEL); + mod->symbol_data = kmalloc(datasize, STP_ALLOC_FLAGS); if (mod->symbol_data == NULL) { - mod->symbol_data = vmalloc(datasize); + mod->symbol_data = _stp_vmalloc(datasize); if (mod->symbol_data == NULL) goto bad; mod->allocated |= 2; @@ -360,7 +360,7 @@ static int _stp_do_module(const char __user *buf, int count) return count; /* copy in section data */ - tmpmod.sections = kmalloc(count - sizeof(tmpmod), GFP_KERNEL); + tmpmod.sections = kmalloc(count - sizeof(tmpmod), STP_ALLOC_FLAGS); if (tmpmod.sections == NULL) { printk("_stp_do_module: unable to allocate memory.\n"); return -EFAULT; |