[PATCH] D57530: Order File Instrumentation: dump the data in compiler-rt

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 28 10:11:33 PST 2019


davidxl added inline comments.


================
Comment at: lib/profile/InstrProfilingFile.c:115
+static uint32_t orderFileWriter(FILE *File, const uint32_t *DataStart) {
+  unsigned Len = fwrite(DataStart, sizeof(uint32_t), INSTR_ORDER_FILE_BUFFER_SIZE, File);
+#if 0
----------------
As follow up, I think it is better to make buffer size controllable by an internal option, and compiler can pass the size to runtime via a variable. Not needed for this patch.


================
Comment at: lib/profile/InstrProfilingFile.c:116
+  unsigned Len = fwrite(DataStart, sizeof(uint32_t), INSTR_ORDER_FILE_BUFFER_SIZE, File);
+#if 0
+#if 0
----------------
The #if 0 needs to be cleaned up.


================
Comment at: test/profile/Inputs/instrprof-order-file.c:10
+  int a = f(argc);
+  int t = g(a);
+  __llvm_profile_initialize_file();
----------------
Perfhaps call 'g' in a loop to show only one entry is recorded?


================
Comment at: test/profile/Inputs/instrprof-order-file.c:11
+  int t = g(a);
+  __llvm_profile_initialize_file();
+  __llvm_orderfile_dump();
----------------
add another call to 'f' after call to 'g' to test it is not double recorded.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57530/new/

https://reviews.llvm.org/D57530





More information about the llvm-commits mailing list