summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingFile.c
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
commit60e43fa0a2d84de06d5bac153b931844886ded9e (patch)
treeab352e4b546281e65d580dfb748d28d9b918cfa6 /lib/profile/InstrProfilingFile.c
parentab438674114181b4253a91e17ed7d75b498fc17f (diff)
downloadcompiler-rt-60e43fa0a2d84de06d5bac153b931844886ded9e.tar.gz
[Profile] bug fix: profile dir not recursively created
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r--lib/profile/InstrProfilingFile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index 76d81d064..1b49d6f42 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/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