2.5.67-gcov and 2.4.20-gcov

2.5.67-gcov and 2.4.20-gcov

Post by Paul Larso » Thu, 17 Apr 2003 16:30:13



The Linux Kernel GCOV patch has a new home.  It will now be available
from the Linux Test Project site at: http://ltp.sourceforge.net.

This release updates the gcov-kernel patches and utilities for 2.5.67
and 2.4.20 kernels, and includes some minor bugfixes.

The Linux Kernel GCOV patch allows utilization of the gcov tool
against a running kernel.  This is different from most other profiling
methods because it can easily tell you things like: which lines of code
are executed, how many times they are executed, and how often different
branches are taken.

Thanks,
Paul Larson

  signature.asc
< 1K Download
 
 
 

2.5.67-gcov and 2.4.20-gcov

Post by J?rn Enge » Thu, 17 Apr 2003 18:50:13



> The Linux Kernel GCOV patch has a new home.  It will now be available
> from the Linux Test Project site at: http://ltp.sourceforge.net.

> This release updates the gcov-kernel patches and utilities for 2.5.67
> and 2.4.20 kernels, and includes some minor bugfixes.

> The Linux Kernel GCOV patch allows utilization of the gcov tool
> against a running kernel.  This is different from most other profiling
> methods because it can easily tell you things like: which lines of code
> are executed, how many times they are executed, and how often different
> branches are taken.

Excuse me for being lazy. Does this already cover ppc? I submitted a
patch over some other channels some time ago.

J?rn

--
Simplicity is prerequisite for reliability.
-- Edsger W. Dijkstra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.67-gcov and 2.4.20-gcov

Post by Paul Larso » Thu, 17 Apr 2003 19:00:17



> Excuse me for being lazy. Does this already cover ppc? I submitted a
> patch over some other channels some time ago.

No, not yet.  And I havn't seen that patch, could you send it to me, or
to the ltp-coverage mailing list?

Thanks,
Paul Larson

  signature.asc
< 1K Download
 
 
 

2.5.67-gcov and 2.4.20-gcov

Post by J?rn Enge » Fri, 18 Apr 2003 14:40:08




> > Excuse me for being lazy. Does this already cover ppc? I submitted a
> > patch over some other channels some time ago.
> No, not yet.  And I havn't seen that patch, could you send it to me, or
> to the ltp-coverage mailing list?

Attached.

Most of it is trivial - identical to arch/*.

The bit in arch/ppc/kernel/entry.S was necessary for me to compile
this for a ppc 405gp based system, gcov would grow the kernel beyond
the relative jump distance for "bnel syscall_trace".

Paulus, Ben, is the relative jump a wanted optimization or unclean
code that went unnoticed so far? IOW should this go into mainline or
remain part of the gcov patch?

J?rn

--
Optimizations always bust things, because all optimizations are, in
the long haul, a form of cheating, and cheaters eventually get caught.
-- Larry Wall

Index: arch/ppc/config.in
===================================================================
RCS file: /home/linux/arch/ppc/config.in,v
retrieving revision 1.11
diff -u -r1.11 config.in
--- arch/ppc/config.in  19 Feb 2003 21:41:13 -0000      1.11

   bool 'Support for early boot texts over serial port' CONFIG_SERIAL_TEXT_DEBUG
 fi
 endmenu
+
+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
+fi
+
+endmenu
Index: arch/ppc/kernel/entry.S
===================================================================
RCS file: /home/linux/arch/ppc/kernel/entry.S,v
retrieving revision 1.2
diff -u -r1.2 entry.S
--- entry.S     14 Feb 2003 21:40:50 -0000      1.2

        .globl  ret_from_fork
 ret_from_fork:
        bl      schedule_tail
+#ifdef CONFIG_GCOV_ALL


+       mtlr    r0
+#endif
        lwz     r0,TASK_PTRACE(r2)
        andi.   r0,r0,PT_TRACESYS
+#ifdef CONFIG_GCOV_ALL
+       beq     ret_from_except
+       blrl
+#else
        bnel-   syscall_trace
+#endif
        b       ret_from_except

        .globl  ret_from_intercept
Index: arch/ppc/kernel/head.S
===================================================================
RCS file: /home/linux/arch/ppc/kernel/head.S,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 head.S
--- arch/ppc/kernel/head.S      5 Nov 2002 16:24:13 -0000       1.1.1.1

  */
 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__

+__CTOR_LIST__:
+.section ".dtors","aw"
+.globl  __DTOR_LIST__

+__DTOR_LIST__:
+#endif
Index: arch/ppc/kernel/head_4xx.S
===================================================================
RCS file: /home/linux/arch/ppc/kernel/head_4xx.S,v
retrieving revision 1.8
diff -u -r1.8 head_4xx.S
--- arch/ppc/kernel/head_4xx.S  17 Feb 2003 20:06:16 -0000      1.8

        mtdcr 0x022, r3
        blr
 #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__

+__CTOR_LIST__:
+.section ".dtors","aw"
+.globl  __DTOR_LIST__

+__DTOR_LIST__:
+#endif
Index: arch/ppc/kernel/head_8xx.S
===================================================================
RCS file: /home/linux/arch/ppc/kernel/head_8xx.S,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 head_8xx.S
--- arch/ppc/kernel/head_8xx.S  5 Nov 2002 16:24:13 -0000       1.1.1.1

        .space  16
 #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__

+__CTOR_LIST__:
+.section ".dtors","aw"
+.globl  __DTOR_LIST__

+__DTOR_LIST__:
+#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.67-gcov and 2.4.20-gcov

Post by Paul Mackerra » Sat, 19 Apr 2003 03:30:13


Quote:=?iso-8859-1?Q?J=81=F6rn?= Engel writes:
> The bit in arch/ppc/kernel/entry.S was necessary for me to compile
> this for a ppc 405gp based system, gcov would grow the kernel beyond
> the relative jump distance for "bnel syscall_trace".

> Paulus, Ben, is the relative jump a wanted optimization or unclean
> code that went unnoticed so far? IOW should this go into mainline or
> remain part of the gcov patch?

What's unclean about bnel?

I think ret_from_fork would be better like this:

        .globl  ret_from_fork
ret_from_fork:
        bl      schedule_tail
        lwz     r0,TASK_PTRACE(r2)
        andi.   r0,r0,PT_TRACESYS
        beq+    ret_from_except
        bl      syscall_trace
        b       ret_from_except

Unless of course you have bloated the kernel beyond 32MB, but then we
would be in all sorts of difficulties.

> +.section ".ctors","aw"
> +.globl  __CTOR_LIST__

> +__CTOR_LIST__:
> +.section ".dtors","aw"
> +.globl  __DTOR_LIST__

> +__DTOR_LIST__:

Can't you do this in arch/ppc/vmlinux.lds using PROVIDE() instead of
making the same change to each of the head*.S files?

Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.67-gcov and 2.4.20-gcov

Post by J?rn Enge » Sun, 20 Apr 2003 23:30:13



> =?iso-8859-1?Q?J=81=F6rn?= Engel writes:

> > The bit in arch/ppc/kernel/entry.S was necessary for me to compile
> > this for a ppc 405gp based system, gcov would grow the kernel beyond
> > the relative jump distance for "bnel syscall_trace".

> > Paulus, Ben, is the relative jump a wanted optimization or unclean
> > code that went unnoticed so far? IOW should this go into mainline or
> > remain part of the gcov patch?

> What's unclean about bnel?

Nothing, as long as it works. But the jump target may only be 1<<13
bytes away. With gcov, it is further. syscall_trace is in a different
source file, so the distance can grow quite large.

Quote:> I think ret_from_fork would be better like this:

>    .globl  ret_from_fork
> ret_from_fork:
>    bl      schedule_tail
>    lwz     r0,TASK_PTRACE(r2)
>    andi.   r0,r0,PT_TRACESYS
>    beq+    ret_from_except
>    bl      syscall_trace
>    b       ret_from_except

> Unless of course you have bloated the kernel beyond 32MB, but then we
> would be in all sorts of difficulties.

Does bl leave 25 bits for the jump target? I don't have a ppc manual
or test hardware with me over the holidays. Will check next week.

32MB sounds quite sufficient. My current record is 28MB for vmlinux on
i386, after allyesconfig basically. This is for statical analysis
only, I would think about booting such a monster.

> > +.section ".ctors","aw"
> > +.globl  __CTOR_LIST__

> > +__CTOR_LIST__:
> > +.section ".dtors","aw"
> > +.globl  __DTOR_LIST__

> > +__DTOR_LIST__:

> Can't you do this in arch/ppc/vmlinux.lds using PROVIDE() instead of
> making the same change to each of the head*.S files?

Maybe, but why bother. As long as the patch doesn't go into mainline,
the change is identical for arch/*/kernel/head*.S, which is easy to
understand.

If you think it would still be nicer, I will do the change.

J?rn

--
Data dominates. If you've chosen the right data structures and organized
things well, the algorithms will almost always be self-evident. Data
structures, not algorithms, are central to programming.
-- Rob Pike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Gcov-kernel patch updates for 2.4.20 and 2.5.70

The Linux Kernel GCOV patch has been updated for 2.4.20 and 2.5.70.  The
patches can be downloaded from:
https://sourceforge.net/project/showfiles.php?group_id=3382

Major changes in this release:
* ppc32 support - Many thanks to Nigel Hinds, Paul Mackerras, and
everyone else who worked on this.
* The gcov-proc module is no longer external, it can now be build with
CONFIG_GCOV_PROC turned on.  So, the tarball is no longer needed, just
the patch now.

For more information about this patch, please see:
http://ltp.sourceforge.net/coverage/gcov-kernel.php

Thanks,
Paul Larson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Uninstalling LILO

3. [2.5.67] kexec for 2.5.67 available

4. AudioDrive 16 PnP

5. IBM x440 problems on 2.4.20 to 2.4.20-rc1-ac3

6. Is it the biggest thing since the Internet ?

7. 2.4.20 + XFS patches + rmap15a + Ingo's 2.4.20-rc3 O(1) sched

8. Problems with install

9. NFS/UDP/IP performance - 2.4.19 v/s 2.4.20, 2.4.20-pre3

10. SCSI under 2.4.20-8 but not 2.4.20-18.9 (RH9)

11. reiserFS problem switching from 2.5.66/67 to 2.4.20

12. : version 2.00.3 megaraid driver for 2.4.x and 2.5.67 kernels