gcov: add support for GCC 4.9
PATCH 1/1 gcov: add support for GCC 4.9
From: Yuan Pengfei <[email protected]>
This patch handles the gcov-related changes in GCC 4.9:
A new counter (time profile) is added.
See http://gcc.gnu.org/gcc-4.9/changes.html
Signed-off-by Yuan Pengfei <[email protected]>
--- kernel/gcov/base.c | 6 ++++++ kernel/gcov/gcc_3_4.c | 2 +- kernel/gcov/gcc_4_7.c | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-)
kernel/gcov/base.c +0 -0
@@ -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() *
kernel/gcov/gcc_3_4.c +1 -1
@@ -269,7 +269,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info) dup->counts[i].num = ctr->num; dup->counts[i].merge = ctr->merge; dup->counts[i].values =vmalloc (size); -if (!dup->counts[i].values) +if (size && !dup->counts[i].values) goto err_free;memcpy (dup->counts[i].values, ctr->values, size); }
kernel/gcov/gcc_4_7.c +6 -1
@@ -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 3static struct gcov_info *gcov_info_head;
@@ -290,7 +295,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info) dci_ptr->values =vmalloc (cv_size); -if (!dci_ptr->values) +if (cv_size && !dci_ptr->values) goto err_free; dci_ptr->num = sci_ptr->num;
Signature · 1 line
2.0.0.rc2