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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 11:51:55 PDT 2018


davidxl added a comment.

This change will cause each dynamic library to dump modules (gcda files) from other dynamic objects as well -- leading to wrong profile count merged.



================
Comment at: lib/profile/GCDAProfiling.c:524
+    prev = writeout_fn_head;
+    while (prev->next != writeout_fn_this);
+    prev->next = writeout_fn_this->next;
----------------
This code looks wrong.    I don't see how this can delete all write nodes from this dynamic object.  


================
Comment at: test/profile/Inputs/instrprof-dlopen-func.c.gcov:6
+// CHECK-NEXT:        -:    0:Programs:1
+// CHECK-NEXT:        3:    1:void func(int K) { if (K) {} }
----------------
this is not correct. func is executed only once.


================
Comment at: test/profile/Inputs/instrprof-dlopen-func2.c.gcov:6
+// CHECK-NEXT:        -:    0:Programs:1
+// CHECK-NEXT:        3:    1:void func2(int K) { if (K) {} }
----------------
this is not correct.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D48538





More information about the llvm-commits mailing list