gcov: add support for gcc 4.7 gcov format
authorFrantisek Hrbata <fhrbata@redhat.com>
Tue, 12 Nov 2013 23:11:26 +0000 (15:11 -0800)
committerMark Brown <broonie@kernel.org>
Tue, 17 Mar 2015 21:51:18 +0000 (21:51 +0000)
commit8ad15c3280f52cbe9782c113edb49cdc5a8b67d5
tree43bb7215287ce16d6a229a8c92f83efb075a173e
parent2d3bc982a1908dd121739918b97192a418717514
gcov: add support for gcc 4.7 gcov format

The gcov in-memory format changed in gcc 4.7.  The biggest change, which
requires this special implementation, is that gcov_info no longer contains
array of counters for each counter type for all functions and gcov_fn_info
is not used for mapping of function's counters to these arrays(offset).
Now each gcov_fn_info contans it's counters, which makes things a little
bit easier.

This is heavily based on the previous gcc_3_4.c implementation and patches
provided by Peter Oberparleiter.  Specially the buffer gcda implementation
for iterator.

[akpm@linux-foundation.org: use kmemdup() and kcalloc()]
[oberpar@linux.vnet.ibm.com: gcc_4_7.c needs vmalloc.h]
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Reviewed-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Gospodarek <agospoda@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 5f41ea0386a53414d688cfcaa321a78310e5f7c1)
Signed-off-by: Mark Brown <broonie@kernel.org>
kernel/gcov/base.c
kernel/gcov/gcc_4_7.c [new file with mode: 0644]