From: Andi Kleen <andi@firstfloor.org>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: Richard Henderson <rth@redhat.com>,
Andi Kleen <andi@firstfloor.org>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch i386]: Add for win32 targets pre-prologue profiling feature
Date: Fri, 16 Jul 2010 23:57:00 -0000 [thread overview]
Message-ID: <20100716235724.GK7338@basil.fritz.box> (raw)
In-Reply-To: <AANLkTinDL6GV8W6EYkRu3jNqPRgjcpFoPHPWux0vFa-Q@mail.gmail.com>
On Thu, Jul 15, 2010 at 08:08:24PM +0200, Kai Tietz wrote:
> Hello Andy,
>
> I updated my patch in that way, that it should be trivial to add the
> counter function for before prologue profiling to linux target by a
> one-liner.
> Just make sure that for the i386-target the macro
> MCOUNT_NAME_BEFORE_PROLOGUE is defined.
>
> I reworked the patch so that the option is now named -mfentry and it
> is available for all i386 targets, if they have defined the counter
> function's name via MCOUNT_NAME_BEFORE_PROLOGUE in target.
> Additionally I added some option-checks for targets, which don't
> support before prologue profiling.
Kai,
I tried the patch on x86_64-linux but it doesn't work for me. First I added
the define to linux
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 81dfd1e..54051ed 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -48,6 +48,10 @@ along with GCC; see the file COPYING3. If not see
#define NO_PROFILE_COUNTERS 1
+/* Choose the correct profiler mcount name. */
+#undef MCOUNT_NAME_BEFORE_PROLOGUE
+#define MCOUNT_NAME_BEFORE_PROLOGUE "__fentry__"
+
#undef MCOUNT_NAME
#define MCOUNT_NAME "mcount"
But when I try to set -mfentry on a simple test program I get
sorry, unimplemented: -mfentry isn't supported for this target
I think that's because of
+#if defined(PROFILE_BEFORE_PROLOGUE)
+ default_profile_top_flag = 1;
+#endif
+#if defined(MCOUNT_NAME) && defined (MCOUNT_NAME_BEFORE_PROLOGUE)
+ only_default = 0;
+#endif
+
+ if (flag_fentry == -1)
+ flag_fentry = default_profile_top_flag;
+ else if (flag_fentry != default_profile_top_flag && only_default)
+ {
+ if (!default_profile_top_flag)
+ sorry ("-mfentry isn't supported for this target");
+ else
+ sorry ("-mno-fentry isn't supported for this target");
and PROFILE_BEFORE_PROLOGUE is never set for i386, default_profile_flag
is always 0
-Andi
next prev parent reply other threads:[~2010-07-16 23:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 12:47 Kai Tietz
2010-07-13 16:28 ` Richard Henderson
2010-07-14 10:20 ` Kai Tietz
2010-07-14 11:49 ` Dave Korn
2010-07-14 12:11 ` Kai Tietz
2010-07-14 12:16 ` Andi Kleen
2010-07-14 12:38 ` Kai Tietz
2010-07-15 18:08 ` Kai Tietz
2010-07-16 17:06 ` Richard Henderson
2010-07-17 6:52 ` Kai Tietz
2010-07-20 2:27 ` Richard Henderson
2010-07-28 8:36 ` Kai Tietz
2010-07-28 16:00 ` Richard Henderson
2010-07-28 16:01 ` Andi Kleen
2010-07-28 17:28 ` Kai Tietz
2010-07-28 17:40 ` Richard Henderson
2010-07-28 18:14 ` Kai Tietz
2010-07-16 20:53 ` Gerald Pfeifer
2010-07-18 12:20 ` Kai Tietz
2010-07-18 20:52 ` Gerald Pfeifer
2010-07-18 20:54 ` Kai Tietz
2010-07-28 18:06 ` Kai Tietz
2010-07-16 23:57 ` Andi Kleen [this message]
2010-07-17 5:34 ` Kai Tietz
2010-07-17 9:45 ` Andi Kleen
2010-07-18 11:37 ` Kai Tietz
2010-07-18 11:46 ` Kai Tietz
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=20100716235724.GK7338@basil.fritz.box \
--to=andi@firstfloor.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=ktietz70@googlemail.com \
--cc=rth@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).