From 6a2bedba84d0cc0b4a8837341e516a491218b729 Mon Sep 17 00:00:00 2001 From: Zach Clark Date: Wed, 1 May 2019 11:18:13 -0500 Subject: Developer Improvement: Get code coverage tool working with Hostboot This commit fixes GCOV code coverage for P9 with GCC 4.9.2 Change-Id: Ie1e7c35f67414531dbd6e7a771ac1529a9ebd59d RTC: 208351 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76812 Tested-by: Jenkins Server Reviewed-by: Nicholas E. Bofferding Reviewed-by: Ilya Smirnov Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- makefile | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 16217fd5d..fc344b76c 100644 --- a/makefile +++ b/makefile @@ -56,14 +56,28 @@ docs: src/build/doxygen/doxygen.conf citest: src/build/citest/cxxtest-start.sh +gcov: HOSTBOOT_PROFILE := 1 + +export HOSTBOOT_PROFILE + .PHONY: gcov gcov: - rm -rf obj/gcov/* - $(MAKE) gcov_pass - find obj/gcov/ -size 0c | xargs rm # Delete empty files. - genhtml obj/gcov/*.lcov -o obj/gcov/html --prefix `pwd` \ - --title `git describe --dirty` - @echo "View GCOV results with: firefox obj/gcov/html/index.html" + @echo Building Hostboot with profiling enabled. + $(MAKE) + @echo Run simics and execute the hb-Gcov command at the end of the simulation to extract gcov data. + @echo Then you can "make lcov" to generate the coverage report. + +.PHONY: lcov +lcov: + rm -f obj/lcov_data + lcov -c --dir . -o obj/lcov_data --gcov-tool $(GCOV) + rm -rf obj/gcov_report + genhtml obj/lcov_data -o obj/gcov_report --ignore-errors source + @echo Coverage report now available in obj/gcov_report + +.PHONY: gcda_clean +gcda_clean: + find -name '*.gcda' -exec rm -f {} \; $(GENDIR)/hwp_id.html : $(ROOTPATH)/src/build/tools/hwp_id.pl -i -l > $@ -- cgit v1.2.1