fix usertrace and genevent for printf alignment
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 6 Sep 2006 14:10:22 +0000 (14:10 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 6 Sep 2006 14:10:22 +0000 (14:10 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2077 04897980-b3bd-0310-b5e0-8ef037075253

genevent/genevent.c
ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
ltt-usertrace/ltt/ltt-facility-user_generic.h
scripts/lttng-split-script.sh
tests/kernel/Makefile

index cc2112a3872e8d797a3d6fffc50b6d29b3c1517e..8f898e7f93df3c0a338d1d12fc508933ab42803d 100644 (file)
@@ -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;
index a958d4bc0b7dbfe772479404ba19a613d72ac3de..9b56ff8f3eacf7a3e816112df398bac35e8fcf37 100644 (file)
@@ -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;
index 40e58b85a0d06b5eeb01dc4d696c2555403532ef..874a83b25092ce2bb52931a316d44a19cd438f52 100644 (file)
@@ -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);
        }
index 7a4f0958d7b39cce100e422aeab507cd9ce67829..bd9e9c27af51ebe64c22482ee60da705dfa02c94 100755 (executable)
@@ -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
index 3adfaf2390e47f604bf137520ece55636174676b..c3b79bce0b9cd94337445a4d2ce40eb1cafc31e1 100644 (file)
@@ -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)
This page took 0.027856 seconds and 4 git commands to generate.