From: <pl...@us...> - 2003-06-26 15:55:21
|
Update of /cvsroot/ltp/utils/analysis/gcov-kernel/ppc In directory sc8-pr-cvs1:/tmp/cvs-serv2710/ppc Added Files: gcov-2.4.21-ppc.patch Log Message: Broken out patches for the 2.4.21 gcov patch I added preliminary support for ppc64 and x86-64 here, but they have not yet been tested. --- NEW FILE: gcov-2.4.21-ppc.patch --- --- linux-2.4.21/arch/ppc/boot/chrp/main.c Fri Jun 13 09:51:31 2003 +++ linux-2.4.21-gcov/arch/ppc/boot/chrp/main.c Wed Jun 25 17:42:29 2003 @@ -37,12 +37,20 @@ char *avail_high; #define RAM_FREE ((unsigned long)(_end+0x1000)&~0xFFF) #define PROG_START 0x00010000 +#ifdef CONFIG_GCOV_ALL +#define PROG_SIZE 0x00900000 /* 9MB */ +#else #define PROG_SIZE 0x00400000 /* 4MB */ +#endif #define SCRATCH_SIZE (128 << 10) static char scratch[SCRATCH_SIZE]; /* 1MB of scratch space for gunzip */ +#ifdef CONFIG_GCOV_ALL +void __bb_init_func (void *ptr /* struct bb *blocks */) { } +#endif + void chrpboot(int a1, int a2, void *prom) { @@ -78,7 +86,7 @@ chrpboot(int a1, int a2, void *prom) begin_avail = avail_high = avail_ram; end_avail = scratch + sizeof(scratch); printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len); - gunzip(dst, 0x400000, im, &len); + gunzip(dst, PROG_SIZE - PROG_START, im, &len); printf("done %u bytes\n\r", len); printf("%u bytes of heap consumed, max in use %u\n\r", avail_high - begin_avail, heap_max); --- linux-2.4.21/arch/ppc/config.in Fri Jun 13 09:51:31 2003 +++ linux-2.4.21-gcov/arch/ppc/config.in Wed Jun 25 17:42:29 2003 @@ -389,6 +389,17 @@ source drivers/media/Config.in source fs/Config.in + +mainmenu_option next_comment +comment 'GCOV coverage profiling' + +bool 'GCOV kernel' CONFIG_GCOV_PROFILE +if [ "$CONFIG_GCOV_PROFILE" != "n" ]; then + bool ' GCOV kernel profiler' CONFIG_GCOV_ALL + tristate ' gcov-proc module' CONFIG_GCOV_PROC +fi +endmenu + mainmenu_option next_comment comment 'Sound' tristate 'Sound card support' CONFIG_SOUND --- linux-2.4.21/arch/ppc/kernel/entry.S Fri Jun 13 09:51:31 2003 +++ linux-2.4.21-gcov/arch/ppc/kernel/entry.S Wed Jun 25 17:42:29 2003 @@ -263,8 +263,17 @@ ret_from_fork: bl schedule_tail lwz r0,TASK_PTRACE(r2) andi. r0,r0,PT_TRACESYS +#ifdef CONFIG_GCOV_PROFILE + bnel- syscall_trace_from_fork + b ret_from_fork_to_except +syscall_trace_from_fork: + b syscall_trace +ret_from_fork_to_except: + b ret_from_except +#else bnel- syscall_trace b ret_from_except +#endif .globl ret_from_intercept ret_from_intercept: --- linux-2.4.21/arch/ppc/kernel/head.S Fri Jun 13 09:51:31 2003 +++ linux-2.4.21-gcov/arch/ppc/kernel/head.S Wed Jun 25 17:42:29 2003 @@ -1726,3 +1726,25 @@ intercept_table: abatron_pteptrs: .space 8 #endif + +#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 + --- linux-2.4.21/arch/ppc/kernel/prom_init.c Fri Jun 13 09:51:31 2003 +++ linux-2.4.21-gcov/arch/ppc/kernel/prom_init.c Wed Jun 25 17:42:29 2003 @@ -661,7 +661,11 @@ prom_instantiate_rtas(void) * Actually OF has bugs so we just arbitrarily * use memory at the 6MB point. */ +#ifdef CONFIG_GCOV_ALL + rtas_data = 0x990000; +#else rtas_data = 6 << 20; +#endif prom_print(" at "); prom_print_hex(rtas_data); } |