From: <pl...@us...> - 2003-06-05 22:58:57
|
Update of /cvsroot/ltp/utils/analysis/gcov-kernel In directory sc8-pr-cvs1:/tmp/cvs-serv27013 Modified Files: gcov-2.5.70.patch Log Message: gcov-2.5.70 with ppc support Index: gcov-2.5.70.patch =================================================================== RCS file: /cvsroot/ltp/utils/analysis/gcov-kernel/gcov-2.5.70.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gcov-2.5.70.patch 28 May 2003 14:02:58 -0000 1.1 +++ gcov-2.5.70.patch 5 Jun 2003 22:58:53 -0000 1.2 @@ -1,6 +1,6 @@ -diff -Naurp linux-2.5.70/Makefile linux-2.5.70-gcov2/Makefile ---- linux-2.5.70/Makefile 2003-05-26 20:00:42.000000000 -0500 -+++ linux-2.5.70-gcov2/Makefile 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/Makefile linux-2.5.70-gcov/Makefile +--- linux-2.5.70/Makefile Mon May 26 20:00:42 2003 ++++ linux-2.5.70-gcov/Makefile Thu Jun 5 17:53:06 2003 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 @@ -47,9 +47,9 @@ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ -type f -print | xargs rm -f -diff -Naurp linux-2.5.70/arch/i386/Kconfig linux-2.5.70-gcov2/arch/i386/Kconfig ---- linux-2.5.70/arch/i386/Kconfig 2003-05-26 20:00:24.000000000 -0500 -+++ linux-2.5.70-gcov2/arch/i386/Kconfig 2003-05-28 00:44:14.000000000 -0500 +diff -Naurp linux-2.5.70/arch/i386/Kconfig linux-2.5.70-gcov/arch/i386/Kconfig +--- linux-2.5.70/arch/i386/Kconfig Mon May 26 20:00:24 2003 ++++ linux-2.5.70-gcov/arch/i386/Kconfig Thu Jun 5 17:53:18 2003 @@ -1453,6 +1453,36 @@ source "net/bluetooth/Kconfig" source "arch/i386/oprofile/Kconfig" @@ -87,9 +87,9 @@ menu "Kernel hacking" -diff -Naurp linux-2.5.70/arch/i386/boot/compressed/Makefile linux-2.5.70-gcov2/arch/i386/boot/compressed/Makefile ---- linux-2.5.70/arch/i386/boot/compressed/Makefile 2003-05-26 20:00:44.000000000 -0500 -+++ linux-2.5.70-gcov2/arch/i386/boot/compressed/Makefile 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/arch/i386/boot/compressed/Makefile linux-2.5.70-gcov/arch/i386/boot/compressed/Makefile +--- linux-2.5.70/arch/i386/boot/compressed/Makefile Mon May 26 20:00:44 2003 ++++ linux-2.5.70-gcov/arch/i386/boot/compressed/Makefile Thu Jun 5 17:53:18 2003 @@ -7,6 +7,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o EXTRA_AFLAGS := -traditional @@ -98,9 +98,9 @@ LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 $(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE -diff -Naurp linux-2.5.70/arch/i386/kernel/head.S linux-2.5.70-gcov2/arch/i386/kernel/head.S ---- linux-2.5.70/arch/i386/kernel/head.S 2003-05-26 20:00:23.000000000 -0500 -+++ linux-2.5.70-gcov2/arch/i386/kernel/head.S 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/arch/i386/kernel/head.S linux-2.5.70-gcov/arch/i386/kernel/head.S +--- linux-2.5.70/arch/i386/kernel/head.S Mon May 26 20:00:23 2003 ++++ linux-2.5.70-gcov/arch/i386/kernel/head.S Thu Jun 5 17:53:18 2003 @@ -487,3 +487,24 @@ ENTRY(cpu_gdt_table) .fill (NR_CPUS-1)*GDT_ENTRIES,8,0 /* other CPU's GDT */ #endif @@ -126,17 +126,166 @@ +__DTOR_LIST__: +#endif + -diff -Naurp linux-2.5.70/drivers/Makefile linux-2.5.70-gcov2/drivers/Makefile ---- linux-2.5.70/drivers/Makefile 2003-05-26 20:00:46.000000000 -0500 -+++ linux-2.5.70-gcov2/drivers/Makefile 2003-05-27 06:39:12.000000000 -0500 +diff -Naurp linux-2.5.70/arch/ppc/Kconfig linux-2.5.70-gcov/arch/ppc/Kconfig +--- linux-2.5.70/arch/ppc/Kconfig Mon May 26 20:01:00 2003 ++++ linux-2.5.70-gcov/arch/ppc/Kconfig Thu Jun 5 17:53:24 2003 +@@ -1501,6 +1501,29 @@ source "net/bluetooth/Kconfig" + + source "lib/Kconfig" + ++menu "GCOV coverage profiling" ++ ++config GCOV_PROFILE ++ bool "GCOV coverage profiling" ++ ---help--- ++ Provide infrastructure for coverage support for the kernel. This ++ will not compile the kernel by default with the necessary flags. ++ To obtain coverage information for the entire kernel, one should ++ enable the subsequent option (Profile entire kernel). If only ++ particular files or directories of the kernel are desired, then ++ one must provide the following compile options for such targets: ++ "-fprofile-arcs -ftest-coverage" in the CFLAGS. To obtain ++ access to the coverage data one must insmod the gcov-prof kernel ++ module. ++ ++config GCOV_ALL ++ bool "GCOV_ALL" ++ depends on GCOV_PROFILE ++ ---help--- ++ If you say Y here, it will compile the entire kernel with coverage ++ option enabled. ++ ++endmenu + + menu "Kernel hacking" + +diff -Naurp linux-2.5.70/arch/ppc/boot/openfirmware/common.c linux-2.5.70-gcov/arch/ppc/boot/openfirmware/common.c +--- linux-2.5.70/arch/ppc/boot/openfirmware/common.c Mon May 26 20:00:46 2003 ++++ linux-2.5.70-gcov/arch/ppc/boot/openfirmware/common.c Thu Jun 5 17:53:25 2003 +@@ -30,6 +30,10 @@ struct memchunk { + + static struct memchunk *freechunks; + ++#ifdef CONFIG_GCOV_PROFILE ++void __bb_init_func (void *ptr /* struct bb *blocks */) { } ++#endif ++ + static void *zalloc(void *x, unsigned items, unsigned size) + { + void *p; +diff -Naurp linux-2.5.70/arch/ppc/boot/prep/misc.c linux-2.5.70-gcov/arch/ppc/boot/prep/misc.c +--- linux-2.5.70/arch/ppc/boot/prep/misc.c Mon May 26 20:00:43 2003 ++++ linux-2.5.70-gcov/arch/ppc/boot/prep/misc.c Thu Jun 5 17:53:25 2003 +@@ -71,6 +71,10 @@ extern unsigned long serial_init(int cha + extern void serial_fixups(void); + extern unsigned long get_mem_size(void); + ++#ifdef CONFIG_GCOV_PROFILE ++void __bb_init_func (void *ptr /* struct bb *blocks */) { } ++#endif ++ + void + writel(unsigned int val, unsigned int address) + { +diff -Naurp linux-2.5.70/arch/ppc/kernel/Makefile linux-2.5.70-gcov/arch/ppc/kernel/Makefile +--- linux-2.5.70/arch/ppc/kernel/Makefile Mon May 26 20:00:56 2003 ++++ linux-2.5.70-gcov/arch/ppc/kernel/Makefile Thu Jun 5 17:53:25 2003 +@@ -15,8 +15,8 @@ extra-$(CONFIG_40x) := head_4xx.o + extra-$(CONFIG_8xx) := head_8xx.o + extra-$(CONFIG_6xx) += idle_6xx.o + +-obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ +- process.o signal.o ptrace.o align.o \ ++obj-y := entry.o ptrace.o traps.o irq.o idle.o time.o misc.o \ ++ process.o signal.o align.o \ + semaphore.o syscalls.o setup.o \ + cputable.o ppc_htab.o + obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o +diff -Naurp linux-2.5.70/arch/ppc/kernel/entry.S linux-2.5.70-gcov/arch/ppc/kernel/entry.S +--- linux-2.5.70/arch/ppc/kernel/entry.S Mon May 26 20:00:56 2003 ++++ linux-2.5.70-gcov/arch/ppc/kernel/entry.S Thu Jun 5 17:53:25 2003 +@@ -106,10 +106,26 @@ transfer_to_handler: + mfspr r11,SPRN_HID0 + mtcr r11 + BEGIN_FTR_SECTION ++#ifdef CONFIG_GCOV_PROFILE ++ bt- 8,near1_power_save_6xx_restore /* Check DOZE */ ++ b skip1_power_save_6xx_restore ++near1_power_save_6xx_restore: ++ b power_save_6xx_restore ++skip1_power_save_6xx_restore: ++#else + bt- 8,power_save_6xx_restore /* Check DOZE */ ++#endif + END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE) + BEGIN_FTR_SECTION ++#ifdef CONFIG_GCOV_PROFILE ++ bt- 9,near2_power_save_6xx_restore /* Check NAP */ ++ b skip2_power_save_6xx_restore ++near2_power_save_6xx_restore: ++ b power_save_6xx_restore ++skip2_power_save_6xx_restore: ++#else + bt- 9,power_save_6xx_restore /* Check NAP */ ++#endif + END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP) + #endif /* CONFIG_6xx */ + .globl transfer_to_handler_cont +diff -Naurp linux-2.5.70/arch/ppc/kernel/head.S linux-2.5.70-gcov/arch/ppc/kernel/head.S +--- linux-2.5.70/arch/ppc/kernel/head.S Mon May 26 20:00:40 2003 ++++ linux-2.5.70-gcov/arch/ppc/kernel/head.S Thu Jun 5 17:53:25 2003 +@@ -1643,3 +1643,25 @@ intercept_table: + */ + abatron_pteptrs: + .space 8 ++ ++#ifdef CONFIG_GCOV_PROFILE ++/* ++ * The .ctors-section contains a list of pointers to constructor ++ * functions which are used to initialize gcov structures. ++ * ++ * Because there is no NULL at the end of the constructor list ++ * in the kernel we need the addresses of both the constructor ++ * as well as the destructor list which are supposed to be ++ * adjacent. ++ */ ++ ++.section ".ctors","aw" ++.globl __CTOR_LIST__ ++.type __CTOR_LIST__,@object ++__CTOR_LIST__: ++.section ".dtors","aw" ++.globl __DTOR_LIST__ ++.type __DTOR_LIST__,@object ++__DTOR_LIST__: ++#endif ++ +diff -Naurp linux-2.5.70/arch/ppc/syslib/prom_init.c linux-2.5.70-gcov/arch/ppc/syslib/prom_init.c +--- linux-2.5.70/arch/ppc/syslib/prom_init.c Mon May 26 20:01:00 2003 ++++ linux-2.5.70-gcov/arch/ppc/syslib/prom_init.c Thu Jun 5 17:53:25 2003 +@@ -668,7 +668,11 @@ prom_instantiate_rtas(void) + * Actually OF has bugs so we just arbitrarily + * use memory at the 6MB point. + */ ++#ifdef CONFIG_GCOV_PROFILE ++ rtas_data = 0x990000; ++#else + rtas_data = 6 << 20; ++#endif + prom_print(" at "); + prom_print_hex(rtas_data); + } +diff -Naurp linux-2.5.70/drivers/Makefile linux-2.5.70-gcov/drivers/Makefile +--- linux-2.5.70/drivers/Makefile Mon May 26 20:00:46 2003 ++++ linux-2.5.70-gcov/drivers/Makefile Thu Jun 5 17:53:06 2003 @@ -51,3 +51,4 @@ obj-$(CONFIG_ISDN_BOOL) += isdn/ obj-$(CONFIG_MCA) += mca/ obj-$(CONFIG_EISA) += eisa/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ +obj-$(CONFIG_GCOV_PROC) += gcov/ -diff -Naurp linux-2.5.70/drivers/gcov/Makefile linux-2.5.70-gcov2/drivers/gcov/Makefile ---- linux-2.5.70/drivers/gcov/Makefile 1969-12-31 18:00:00.000000000 -0600 -+++ linux-2.5.70-gcov2/drivers/gcov/Makefile 2003-05-27 06:42:25.000000000 -0500 +diff -Naurp linux-2.5.70/drivers/gcov/Makefile linux-2.5.70-gcov/drivers/gcov/Makefile +--- linux-2.5.70/drivers/gcov/Makefile Wed Dec 31 18:00:00 1969 ++++ linux-2.5.70-gcov/drivers/gcov/Makefile Thu Jun 5 17:53:06 2003 @@ -0,0 +1,8 @@ +# +# Makefile for GCOV profiling kernel module @@ -146,9 +295,9 @@ + +$(obj)/gcov-proc.o: $(obj)/gcov-proc.c + -diff -Naurp linux-2.5.70/drivers/gcov/gcov-proc.c linux-2.5.70-gcov2/drivers/gcov/gcov-proc.c ---- linux-2.5.70/drivers/gcov/gcov-proc.c 1969-12-31 18:00:00.000000000 -0600 -+++ linux-2.5.70-gcov2/drivers/gcov/gcov-proc.c 2003-05-27 06:35:13.000000000 -0500 +diff -Naurp linux-2.5.70/drivers/gcov/gcov-proc.c linux-2.5.70-gcov/drivers/gcov/gcov-proc.c +--- linux-2.5.70/drivers/gcov/gcov-proc.c Wed Dec 31 18:00:00 1969 ++++ linux-2.5.70-gcov/drivers/gcov/gcov-proc.c Thu Jun 5 17:53:06 2003 @@ -0,0 +1,713 @@ +/* + * This kernel module provides access to coverage data produced by @@ -863,9 +1012,9 @@ + +//module_init(gcov_init_module); +//module_exit(gcov_cleanup_module); -diff -Naurp linux-2.5.70/include/linux/module.h linux-2.5.70-gcov2/include/linux/module.h ---- linux-2.5.70/include/linux/module.h 2003-05-26 20:00:46.000000000 -0500 -+++ linux-2.5.70-gcov2/include/linux/module.h 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/include/linux/module.h linux-2.5.70-gcov/include/linux/module.h +--- linux-2.5.70/include/linux/module.h Mon May 26 20:00:46 2003 ++++ linux-2.5.70-gcov/include/linux/module.h Thu Jun 5 17:53:06 2003 @@ -250,6 +250,11 @@ struct module /* The command line arguments (may be mangled). People like keeping pointers to this stuff */ @@ -878,9 +1027,23 @@ }; /* FIXME: It'd be nice to isolate modules during init, too, so they -diff -Naurp linux-2.5.70/kernel/Makefile linux-2.5.70-gcov2/kernel/Makefile ---- linux-2.5.70/kernel/Makefile 2003-05-26 20:00:25.000000000 -0500 -+++ linux-2.5.70-gcov2/kernel/Makefile 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/init/main.c linux-2.5.70-gcov/init/main.c +--- linux-2.5.70/init/main.c Mon May 26 20:00:25 2003 ++++ linux-2.5.70-gcov/init/main.c Thu Jun 5 17:53:25 2003 +@@ -115,6 +115,10 @@ char *execute_command; + /* Setup configured maximum number of CPUs to activate */ + static unsigned int max_cpus = NR_CPUS; + ++#if defined(CONFIG_GCOV_PROFILE) && defined(CONFIG_PPC32) ++void __bb_fork_func (void) { } ++#endif ++ + /* + * Setup routine for controlling SMP activation + * +diff -Naurp linux-2.5.70/kernel/Makefile linux-2.5.70-gcov/kernel/Makefile +--- linux-2.5.70/kernel/Makefile Mon May 26 20:00:25 2003 ++++ linux-2.5.70-gcov/kernel/Makefile Thu Jun 5 17:53:06 2003 @@ -8,6 +8,12 @@ obj-y = sched.o fork.o exec_domain.o signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o intermodule.o extable.o params.o posix-timers.o @@ -894,9 +1057,9 @@ obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o -diff -Naurp linux-2.5.70/kernel/gcov.c linux-2.5.70-gcov2/kernel/gcov.c ---- linux-2.5.70/kernel/gcov.c 1969-12-31 18:00:00.000000000 -0600 -+++ linux-2.5.70-gcov2/kernel/gcov.c 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/kernel/gcov.c linux-2.5.70-gcov/kernel/gcov.c +--- linux-2.5.70/kernel/gcov.c Wed Dec 31 18:00:00 1969 ++++ linux-2.5.70-gcov/kernel/gcov.c Thu Jun 5 17:53:06 2003 @@ -0,0 +1,158 @@ +/* + * Coverage support under Linux @@ -1056,9 +1219,9 @@ +EXPORT_SYMBOL(do_global_ctors); +EXPORT_SYMBOL(gcov_kernelpath); +EXPORT_SYMBOL(gcov_callback); -diff -Naurp linux-2.5.70/kernel/module.c linux-2.5.70-gcov2/kernel/module.c ---- linux-2.5.70/kernel/module.c 2003-05-26 20:00:45.000000000 -0500 -+++ linux-2.5.70-gcov2/kernel/module.c 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/kernel/module.c linux-2.5.70-gcov/kernel/module.c +--- linux-2.5.70/kernel/module.c Mon May 26 20:00:45 2003 ++++ linux-2.5.70-gcov/kernel/module.c Thu Jun 5 17:53:06 2003 @@ -83,6 +83,11 @@ int unregister_module_notifier(struct no } EXPORT_SYMBOL(unregister_module_notifier); @@ -1097,20 +1260,22 @@ /* Now we've moved module, initialize linked lists, etc. */ module_unload_init(mod); -@@ -1438,6 +1455,10 @@ sys_init_module(void __user *umod, +@@ -1438,6 +1455,12 @@ sys_init_module(void __user *umod, /* Start the module */ ret = mod->init(); + ++#ifdef CONFIG_GCOV_PROFILE + if (mod->ctors_start && mod->ctors_end) { + do_global_ctors(mod->ctors_start, mod->ctors_end, mod, 1); + } ++#endif if (ret < 0) { /* Init routine failed: abort. Try to protect us from buggy refcounters. */ -diff -Naurp linux-2.5.70/scripts/Makefile.build linux-2.5.70-gcov2/scripts/Makefile.build ---- linux-2.5.70/scripts/Makefile.build 2003-05-26 20:00:46.000000000 -0500 -+++ linux-2.5.70-gcov2/scripts/Makefile.build 2003-05-27 05:18:56.000000000 -0500 +diff -Naurp linux-2.5.70/scripts/Makefile.build linux-2.5.70-gcov/scripts/Makefile.build +--- linux-2.5.70/scripts/Makefile.build Mon May 26 20:00:46 2003 ++++ linux-2.5.70-gcov/scripts/Makefile.build Thu Jun 5 17:53:06 2003 @@ -165,7 +165,16 @@ cmd_cc_i_c = $(CPP) $(c_flags) - $(call if_changed_dep,cc_i_c) |