mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] gcov: add support for GCC 4.9
@ 2014-05-14  0:07 Yuan Pengfei
  2014-05-14  3:23 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Pengfei @ 2014-05-14  0:07 UTC (permalink / raw)
  To: 'Andrew Morton'; +Cc: 'Peter Oberparleiter', linux-kernel

From: Yuan Pengfei <coolypf@qq.com>

This patch handles the gcov-related changes in GCC 4.9:
  A new counter (time profile) is added. The total number is 9 now.
  A new profile merge function __gcov_merge_time_profile is added.
See gcc/gcov-io.h and libgcc/libgcov-merge.c
For the first change, the layout of struct gcov_info is affected.
For the second one, a dummy function is added to kernel/gcov/base.c
similarly.
Signed-off-by: Yuan Pengfei <coolypf@qq.com>
---
 kernel/gcov/base.c    | 6 ++++++
 kernel/gcov/gcc_4_7.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c
index f45b75b..b358a80 100644
--- a/kernel/gcov/base.c
+++ b/kernel/gcov/base.c
@@ -85,6 +85,12 @@ void __gcov_merge_ior(gcov_type *counters, unsigned int
n_counters)
 }
 EXPORT_SYMBOL(__gcov_merge_ior);
 
+void __gcov_merge_time_profile(gcov_type *counters, unsigned int
n_counters)
+{
+	/* Unused. */
+}
+EXPORT_SYMBOL(__gcov_merge_time_profile);
+
 /**
  * gcov_enable_events - enable event reporting through gcov_event()
  *
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index 7465944..7f74b59 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -18,7 +18,12 @@
 #include <linux/vmalloc.h>
 #include "gcov.h"
 
+#if __GNUC__ == 4 && __GNUC_MINOR__ >= 9
+#define GCOV_COUNTERS			9
+#else
 #define GCOV_COUNTERS			8
+#endif
+
 #define GCOV_TAG_FUNCTION_LENGTH	3
 
 static struct gcov_info *gcov_info_head;
-- 
2.0.0.rc2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] gcov: add support for GCC 4.9
  2014-05-14  0:07 [PATCH v3] gcov: add support for GCC 4.9 Yuan Pengfei
@ 2014-05-14  3:23 ` Andi Kleen
  2014-05-14  4:20   ` Yuan Pengfei
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2014-05-14  3:23 UTC (permalink / raw)
  To: Yuan Pengfei
  Cc: 'Andrew Morton', 'Peter Oberparleiter', linux-kernel

"Yuan Pengfei" <yuanpf12@sei.pku.edu.cn> writes:

> This patch handles the gcov-related changes in GCC 4.9:
>   A new counter (time profile) is added. The total number is 9 now.
>   A new profile merge function __gcov_merge_time_profile is added.
> See gcc/gcov-io.h and libgcc/libgcov-merge.c
> For the first change, the layout of struct gcov_info is affected.
> For the second one, a dummy function is added to kernel/gcov/base.c
> similarly.


Thanks for doing that. I tried it too at some point, but failed.
>  
> +void __gcov_merge_time_profile(gcov_type *counters, unsigned int
> n_counters)

But can you repost please without word wrapping?

Except for that the patch looks good to me.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v3] gcov: add support for GCC 4.9
  2014-05-14  3:23 ` Andi Kleen
@ 2014-05-14  4:20   ` Yuan Pengfei
  0 siblings, 0 replies; 3+ messages in thread
From: Yuan Pengfei @ 2014-05-14  4:20 UTC (permalink / raw)
  To: 'Andi Kleen'; +Cc: linux-kernel

> >
> > +void __gcov_merge_time_profile(gcov_type *counters, unsigned int
> > n_counters)
> 
> But can you repost please without word wrapping?
> 
> Except for that the patch looks good to me.

Sorry. I will configure my email client and send again.

--
Yuan, Pengfei
Peking University, China


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-14  4:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-14  0:07 [PATCH v3] gcov: add support for GCC 4.9 Yuan Pengfei
2014-05-14  3:23 ` Andi Kleen
2014-05-14  4:20   ` Yuan Pengfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®