Skip to content
This repository was archived by the owner on Nov 21, 2022. It is now read-only.

Commit aa069a2

Browse files
vo4torvalds
authored andcommitted
gcov: docs: add a note on GCC vs Clang differences
Document some things of note to gcov users: 1. GCC gcov and Clang llvm-cov tools are not compatible. 2. The use of GCC vs Clang is transparent at build-time. Also adjust the documentation to account for the removal of config symbol CONFIG_GCOV_FORMAT_AUTODETECT by commit 6a61b70 ("gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT"). Link: http://lkml.kernel.org/r/20190318025411.98014-4-trong@android.com Signed-off-by: Tri Vo <trong@android.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Cc: Daniel Mentz <danielmentz@google.com> Cc: Greg Hackmann <ghackmann@android.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Petri Gynther <pgynther@google.com> Cc: Prasad Sodagudi <psodagud@quicinc.com> Cc: Trilok Soni <tsoni@quicinc.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 826eba0 commit aa069a2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Documentation/dev-tools/gcov.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ Configure the kernel with::
3434
CONFIG_DEBUG_FS=y
3535
CONFIG_GCOV_KERNEL=y
3636

37-
select the gcc's gcov format, default is autodetect based on gcc version::
38-
39-
CONFIG_GCOV_FORMAT_AUTODETECT=y
40-
4137
and to get coverage data for the entire kernel::
4238

4339
CONFIG_GCOV_PROFILE_ALL=y
@@ -169,6 +165,20 @@ b) gcov is run on the BUILD machine
169165
[user@build] gcov -o /tmp/coverage/tmp/out/init main.c
170166

171167

168+
Note on compilers
169+
-----------------
170+
171+
GCC and LLVM gcov tools are not necessarily compatible. Use gcov_ to work with
172+
GCC-generated .gcno and .gcda files, and use llvm-cov_ for Clang.
173+
174+
.. _gcov: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
175+
.. _llvm-cov: https://llvm.org/docs/CommandGuide/llvm-cov.html
176+
177+
Build differences between GCC and Clang gcov are handled by Kconfig. It
178+
automatically selects the appropriate gcov format depending on the detected
179+
toolchain.
180+
181+
172182
Troubleshooting
173183
---------------
174184

0 commit comments

Comments
 (0)