[PATCH] D48538: Make __gcov_flush flush counters for all shared libraries

Marco Castelluccio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 16:29:01 PDT 2018


marco-c updated this revision to Diff 154015.
marco-c added a comment.

I've taken another approach which looks simpler to me. Instead of having two lists, I only have a shared list and I use a static variable's address as an identifier for a dynamic object.

I've also added another test (which would have failed with the previous iteration of the patch) which dlopens three libraries.

I will file follow-up bugs for things that don't look right in the llvm-cov output which are not regressions from this patch:

- instrprof-shared-main-gcov-flush_no-writeout.c.gcov: lines 23, 26 and 30 should not be covered; lines 33 and 35 should not be covered (they are considered as uncoverable instead).
- instrprof-dlopen-func{2,3}.c.gcov: the only line in the function should be covered once and not thrice

Regarding removing writeout and only always using __gcov_flush, do you see any disadvantage if we do that?

Regarding llvm_gcov_flush that was recently added, should I remove it since we can now unhide __gcov_flush?


https://reviews.llvm.org/D48538

Files:
  lib/profile/GCDAProfiling.c
  test/profile/Inputs/instrprof-dlopen-dlclose-main.c
  test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov
  test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov
  test/profile/Inputs/instrprof-dlopen-func.c.gcov
  test/profile/Inputs/instrprof-dlopen-func2.c.gcov
  test/profile/Inputs/instrprof-dlopen-func3.c
  test/profile/Inputs/instrprof-dlopen-func3.c.gcov
  test/profile/Inputs/instrprof-shared-lib.c.gcov
  test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov
  test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov
  test/profile/Inputs/instrprof-shared-main-gcov-flush.c
  test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov
  test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov
  test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov
  test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov
  test/profile/Inputs/instrprof-shared-main.c.gcov
  test/profile/instrprof-dlopen-dlclose-gcov.test
  test/profile/instrprof-gcov-two-objects.test
  test/profile/instrprof-shared-gcov-flush.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48538.154015.patch
Type: text/x-patch
Size: 38198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180703/4af1b747/attachment.bin>


More information about the llvm-commits mailing list