[compiler-rt] r276234 - [Profile] bug fix: profile dir not recursively created

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 20:38:07 PDT 2016


Author: davidxl
Date: Wed Jul 20 22:38:07 2016
New Revision: 276234

URL: http://llvm.org/viewvc/llvm-project?rev=276234&view=rev
Log:
[Profile] bug fix: profile dir not recursively created

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingFile.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=276234&r1=276233&r2=276234&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Wed Jul 20 22:38:07 2016
@@ -236,6 +236,11 @@ static void truncateCurrentFile(void) {
     __llvm_profile_recursive_mkdir(Copy);
   }
 
+  /* By pass file truncation to allow online raw profile
+   * merging. */
+  if (lprofCurFilename.MergePoolSize)
+    return;
+
   /* Truncate the file.  Later we'll reopen and append. */
   File = fopen(Filename, "w");
   if (!File)
@@ -350,8 +355,7 @@ static void parseAndSetFilename(const ch
               getPNSStr(PNS));
   }
 
-  if (!lprofCurFilename.MergePoolSize)
-    truncateCurrentFile();
+  truncateCurrentFile();
 }
 
 /* Return buffer length that is required to store the current profile




More information about the llvm-commits mailing list