-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lit: Add module to produce and merge profile data for benchmarks comp…
…iled with -fprofile-instr-generate git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@260357 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
5 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import shellcommand | ||
|
||
|
||
def wrapScript(context, script): | ||
"""Adjust runscript to set a different value to the LLVM_PROFILE_FILE | ||
environment variable for each execution.""" | ||
i = 0 | ||
adjusted_script = [] | ||
context.profilefiles = [] | ||
for line in script: | ||
number = "" | ||
if len(script) > 1: | ||
number = "-%s" % (i,) | ||
i += 1 | ||
profilefile = "%s%s.profraw" % (context.tmpBase, number) | ||
prefix = "LLVM_PROFILE_FILE=%s " % quote(profilefile) | ||
context.profilefiles.append(profilefile) | ||
adjusted_script.append(prefix + line) | ||
return adjusted_script | ||
|
||
|
||
def getMergeProfilesScript(context): | ||
executable = shellcommand.getMainExecutable(context) | ||
if not executable: | ||
return None | ||
profdatafile = executable + ".profdata" | ||
mergecmd = [config.llvm_profdata, 'merge', '-output=%s' % profdatafile] | ||
mergecmd += context.profilefiles | ||
return [mergecmd] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters