summaryrefslogtreecommitdiff
authorTri Vo <trong@android.com>2019-05-14 22:45:28 (GMT)
committer Tri Vo <trong@google.com>2019-05-23 23:51:34 (GMT)
commitd4894dbec0eefd6de3a4cd5904c9ec1f05fc49fe (patch)
tree5ed9ada409809581167ed418f26f95f8923a8996
parente98271e2b2eb9e9125838f86515258f7143a91cc (diff)
downloadcommon-d4894dbec0eefd6de3a4cd5904c9ec1f05fc49fe.zip
common-d4894dbec0eefd6de3a4cd5904c9ec1f05fc49fe.tar.gz
common-d4894dbec0eefd6de3a4cd5904c9ec1f05fc49fe.tar.bz2
UPSTREAM: 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 6a61b70b43c9 ("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> (cherry picked from commit aa069a23a220e9ab00d6837b76917952d0fb587e) Bug: 132997968 Test: defconfig + CONFIG_GCOV_KERNEL records coverage Change-Id: Id9a248d5e6d8fc643300230b2ab2ce902050a6ae
Diffstat
-rw-r--r--Documentation/dev-tools/gcov.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/dev-tools/gcov.rst b/Documentation/dev-tools/gcov.rst
index 19eedfe..adaae05 100644
--- a/Documentation/dev-tools/gcov.rst
+++ b/Documentation/dev-tools/gcov.rst
@@ -34,10 +34,6 @@ Configure the kernel with::
CONFIG_DEBUG_FS=y
CONFIG_GCOV_KERNEL=y
-select the gcc's gcov format, default is autodetect based on gcc version::
-
- CONFIG_GCOV_FORMAT_AUTODETECT=y
-
and to get coverage data for the entire kernel::
CONFIG_GCOV_PROFILE_ALL=y
@@ -169,6 +165,20 @@ b) gcov is run on the BUILD machine
[user@build] gcov -o /tmp/coverage/tmp/out/init main.c
+Note on compilers
+-----------------
+
+GCC and LLVM gcov tools are not necessarily compatible. Use gcov_ to work with
+GCC-generated .gcno and .gcda files, and use llvm-cov_ for Clang.
+
+.. _gcov: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
+.. _llvm-cov: https://llvm.org/docs/CommandGuide/llvm-cov.html
+
+Build differences between GCC and Clang gcov are handled by Kconfig. It
+automatically selects the appropriate gcov format depending on the detected
+toolchain.
+
+
Troubleshooting
---------------