From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Paul Larson <plars@linuxtestproject.org>
Cc: ltp-coverage@lists.sourceforge.net,
lse-tech <lse-tech@lists.sourceforge.net>,
lkml <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [Ltp-coverage] 2.5.67-gcov and 2.4.20-gcov
Date: Thu, 17 Apr 2003 14:31:11 +0200 [thread overview]
Message-ID: <20030417123111.GA29390@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <1050511870.10732.1277.camel@plars>
On Wed, 16 April 2003 11:51:09 -0500, Paul Larson wrote:
> On Wed, 2003-04-16 at 11:44, Jörn Engel wrote:
> > 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
+++ arch/ppc/config.in 28 Mar 2003 12:37:57 -0000
@@ -714,3 +714,13 @@
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
+++ entry.S 28 Mar 2003 12:59:06 -0000
@@ -314,9 +314,19 @@
.globl ret_from_fork
ret_from_fork:
bl schedule_tail
+#ifdef CONFIG_GCOV_ALL
+ lis r0,syscall_trace@ha
+ addi r0,r0,syscall_trace@l
+ 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
+++ arch/ppc/kernel/head.S 28 Mar 2003 12:37:57 -0000
@@ -1755,3 +1755,24 @@
*/
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
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
+++ arch/ppc/kernel/head_4xx.S 28 Mar 2003 12:37:57 -0000
@@ -1271,3 +1271,24 @@
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__
+.type __CTOR_LIST__,@object
+__CTOR_LIST__:
+.section ".dtors","aw"
+.globl __DTOR_LIST__
+.type __DTOR_LIST__,@object
+__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
+++ arch/ppc/kernel/head_8xx.S 28 Mar 2003 12:37:58 -0000
@@ -997,3 +997,23 @@
.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__
+.type __CTOR_LIST__,@object
+__CTOR_LIST__:
+.section ".dtors","aw"
+.globl __DTOR_LIST__
+.type __DTOR_LIST__,@object
+__DTOR_LIST__:
+#endif
next prev parent reply other threads:[~2003-04-17 12:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-16 14:20 2.5.67-gcov and 2.4.20-gcov Paul Larson
2003-04-16 16:44 ` [Ltp-coverage] " Jörn Engel
2003-04-16 16:51 ` Paul Larson
2003-04-17 12:31 ` Jörn Engel [this message]
2003-04-17 23:07 ` Paul Mackerras
2003-04-19 21:24 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030417123111.GA29390@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=ltp-coverage@lists.sourceforge.net \
--cc=paulus@samba.org \
--cc=plars@linuxtestproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).