summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-07-21 03:38:07 +0000
committerXinliang David Li <davidxl@google.com>2016-07-21 03:38:07 +0000
commite3fc4d0fdda3762fc0e88bb426274d8fc946e480 (patch)
treed733650334141a57846c89cca81c3083e54a9908
parent38136197bb13beaa7dec4351eb997c1e40823423 (diff)
downloadbcm5719-llvm-e3fc4d0fdda3762fc0e88bb426274d8fc946e480.tar.gz
bcm5719-llvm-e3fc4d0fdda3762fc0e88bb426274d8fc946e480.zip
[Profile] bug fix: profile dir not recursively created
llvm-svn: 276234
-rw-r--r--compiler-rt/lib/profile/InstrProfilingFile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 76d81d0644d..1b49d6f42e3 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -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 char *FilenamePat,
getPNSStr(PNS));
}
- if (!lprofCurFilename.MergePoolSize)
- truncateCurrentFile();
+ truncateCurrentFile();
}
/* Return buffer length that is required to store the current profile
OpenPOWER on IntegriCloud