[PATCH] D23106: [Profile] introduce interface __llvm_profile_dump

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 10:38:39 PDT 2016


vsk added inline comments.

================
Comment at: lib/profile/InstrProfiling.c:81
@@ -70,2 +80,3 @@
   }
+  ProfileDumped = 0;
 }
----------------
davidxl wrote:
> vsk wrote:
> > Should probably also be cleared when llvm_prof_set_filename() or llvm_profile_merge_from_buffer() are called.
> It is a mistake to not call reset counter before dumping again (due to double counting) regardless whether merging is used or not
Oh, I see. This sequence of calls doesn't make sense: dump(), merge_profile_from_buffer(), dump(). You're saying you'd need to reset the counters some time before the second call to dump() anyway.

What about: dump(), set_filename(), dump()?. The second 'dump()' wouldn't go through, which seems like a problem.


https://reviews.llvm.org/D23106





More information about the llvm-commits mailing list