This is the mail archive of the
mailing list for the GCC project.
Re: [patch i386]: Add for win32 targets pre-prologue profiling feature
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
> 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.
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
@@ -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. */
+#define MCOUNT_NAME_BEFORE_PROLOGUE "__fentry__"
#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
+ default_profile_top_flag = 1;
+#if defined(MCOUNT_NAME) && defined (MCOUNT_NAME_BEFORE_PROLOGUE)
+ only_default = 0;
+ 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");
+ sorry ("-mno-fentry isn't supported for this target");
and PROFILE_BEFORE_PROLOGUE is never set for i386, default_profile_flag
is always 0