Skip to content

Commit

Permalink
gcov: add support for GCC 4.9
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
coolypf authored and torvalds committed Jun 10, 2014
1 parent 79deb3c commit a992bf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/gcov/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*
Expand Down
5 changes: 5 additions & 0 deletions kernel/gcov/gcc_4_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a992bf8

Please sign in to comment.