From: compudj Date: Wed, 6 Sep 2006 14:10:22 +0000 (+0000) Subject: fix usertrace and genevent for printf alignment X-Git-Tag: v0.12.20~1412 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0bdf8e980b73c9cf21a75da882f521958abff5ae;p=lttv.git fix usertrace and genevent for printf alignment git-svn-id: http://ltt.polymtl.ca/svn@2077 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent/genevent.c b/genevent/genevent.c index cc2112a3..8f898e7f 100644 --- a/genevent/genevent.c +++ b/genevent/genevent.c @@ -1718,8 +1718,8 @@ int print_event_logging_function_user_generic(char *basename, facility_t *fac, print_tabs(1, fd); fprintf(fd, "int ret = 0;\n"); if(event->param_buffer) { - print_tabs(1, fd); - fprintf(fd, "reserve_size = ltt_align(reserve_size, sizeof(void *));\n"); + //FIX print_tabs(1, fd); + //fprintf(fd, "reserve_size = ltt_align(reserve_size, sizeof(void *));\n"); print_tabs(1, fd); fprintf(fd, "{\n"); goto do_syscall; diff --git a/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h b/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h index a958d4bc..9b56ff8f 100644 --- a/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h +++ b/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h @@ -20,11 +20,12 @@ static int trace_user_generic_slow_printf( #else { /* Guess we need no more than 100 bytes. */ - int n, size = 100; + int n, size = 104; char *p, *np; va_list ap; int ret; + size += ltt_align(size, sizeof(void*)); if ((p = malloc (size)) == NULL) return -1; @@ -35,7 +36,7 @@ static int trace_user_generic_slow_printf( va_end(ap); /* If that worked, trace the string. */ if (n > -1 && n < size) { - ret = trace_user_generic_slow_printf_param_buffer(p, n+1); + ret = trace_user_generic_slow_printf_param_buffer(p, n+1+ltt_align(n+1, sizeof(void*))); free(p); return ret; } @@ -44,6 +45,7 @@ static int trace_user_generic_slow_printf( size = n+1; /* precisely what is needed */ else /* glibc 2.0 */ size *= 2; /* twice the old size */ + size += ltt_align(size, sizeof(void*)); if ((np = realloc (p, size)) == NULL) { free(p); return -1; diff --git a/ltt-usertrace/ltt/ltt-facility-user_generic.h b/ltt-usertrace/ltt/ltt-facility-user_generic.h index 40e58b85..874a83b2 100644 --- a/ltt-usertrace/ltt/ltt-facility-user_generic.h +++ b/ltt-usertrace/ltt/ltt-facility-user_generic.h @@ -498,7 +498,6 @@ static inline int trace_user_generic_slow_printf_param_buffer( #else { int ret = 0; - reserve_size = ltt_align(reserve_size, sizeof(void *)); { ret = ltt_trace_generic(ltt_facility_user_generic_B1865E44, event_user_generic_slow_printf, buffer, reserve_size, LTT_BLOCKING); } diff --git a/scripts/lttng-split-script.sh b/scripts/lttng-split-script.sh index 7a4f0958..bd9e9c27 100755 --- a/scripts/lttng-split-script.sh +++ b/scripts/lttng-split-script.sh @@ -168,6 +168,7 @@ IN="?_include_linux_ltt_ltt-facility-core.h ?_include_linux_ltt_ltt-facility-fs.h ?_include_linux_ltt_ltt-facility-fs_data.h ?_include_linux_ltt_ltt-facility-custom-fs_data.h +?_include_linux_ltt_ltt-facility-custom-stack.h ?_include_linux_ltt_ltt-facility-id-core.h ?_include_linux_ltt_ltt-facility-id-fs.h ?_include_linux_ltt_ltt-facility-id-fs_data.h @@ -179,6 +180,7 @@ IN="?_include_linux_ltt_ltt-facility-core.h ?_include_linux_ltt_ltt-facility-id-network_ip_interface.h ?_include_linux_ltt_ltt-facility-id-process.h ?_include_linux_ltt_ltt-facility-id-socket.h +?_include_linux_ltt_ltt-facility-id-stack.h ?_include_linux_ltt_ltt-facility-id-statedump.h ?_include_linux_ltt_ltt-facility-id-timer.h ?_include_linux_ltt_ltt-facility-ipc.h @@ -189,13 +191,12 @@ IN="?_include_linux_ltt_ltt-facility-core.h ?_include_linux_ltt_ltt-facility-network_ip_interface.h ?_include_linux_ltt_ltt-facility-process.h ?_include_linux_ltt_ltt-facility-socket.h +?_include_linux_ltt_ltt-facility-stack.h ?_include_linux_ltt_ltt-facility-statedump.h ?_include_linux_ltt_ltt-facility-timer.h ?_include_asm-i386_ltt_ltt-facility-id-kernel_arch_i386.h ?_include_asm-i386_ltt_ltt-facility-kernel_arch_i386.h -?_include_asm-i386_ltt_ltt-facility-custom-stack_arch_i386.h -?_include_asm-i386_ltt_ltt-facility-id-stack_arch_i386.h -?_include_asm-i386_ltt_ltt-facility-stack_arch_i386.h +?_include_asm-i386_ltt_ltt-facility-custom-stack.h ?_include_asm-i386_ltt_ltt-facility-custom-locking.h ?_include_asm-arm_ltt_ltt-facility-id-kernel_arch_arm.h ?_include_asm-arm_ltt_ltt-facility-kernel_arch_arm.h @@ -207,6 +208,7 @@ IN="?_include_linux_ltt_ltt-facility-core.h ?_include_asm-ppc_ltt_ltt-facility-kernel_arch_ppc.h ?_include_asm-x86_64_ltt_ltt-facility-id-kernel_arch_x86_64.h ?_include_asm-x86_64_ltt_ltt-facility-kernel_arch_x86_64.h +?_include_asm-x86_64_ltt_ltt-facility-custom-stack.h ?_include_asm-x86_64_ltt_ltt-facility-custom-locking.h" for a in $IN; do wr $a $FILE; done @@ -237,14 +239,14 @@ IN="?_ltt_Makefile ?_ltt_ltt-facility-loader-process.h ?_ltt_ltt-facility-loader-socket.c ?_ltt_ltt-facility-loader-socket.h +?_ltt_ltt-facility-loader-stack.c +?_ltt_ltt-facility-loader-stack.h ?_ltt_ltt-facility-loader-statedump.c ?_ltt_ltt-facility-loader-statedump.h ?_ltt_ltt-facility-loader-timer.c ?_ltt_ltt-facility-loader-timer.h ?_ltt_ltt-facility-loader-kernel_arch_i386.c ?_ltt_ltt-facility-loader-kernel_arch_i386.h -?_ltt_ltt-facility-loader-stack_arch_i386.c -?_ltt_ltt-facility-loader-stack_arch_i386.h ?_ltt_ltt-facility-loader-kernel_arch_arm.c ?_ltt_ltt-facility-loader-kernel_arch_arm.h ?_ltt_ltt-facility-loader-kernel_arch_mips.c diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index 3adfaf23..c3b79bce 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -1,19 +1,20 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_LTT),) - obj-m += ltt-facility-loader-tests.o - obj-m += test-time-probe.o - obj-m += test-time-probe2.o - obj-m += test-instrument-size-small.o - obj-m += test-instrument-size-med.o - obj-m += test-instrument-size-big.o - obj-m += test-printk-effect.o +# obj-m += ltt-facility-loader-tests.o +# obj-m += test-time-probe.o +# obj-m += test-time-probe2.o +# obj-m += test-instrument-size-small.o +# obj-m += test-instrument-size-med.o +# obj-m += test-instrument-size-big.o +# obj-m += test-printk-effect.o endif obj-m += test-cmpxchg.o obj-m += test-cmpxchg-nolock.o obj-m += test-spinlock.o obj-m += test-inc.o obj-m += test-inc-nolock.o - + obj-m += test-kmalloc.o + obj-m += test-irqdis.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd)