Add option for block profiling, pass in the "correct" argv[0] to the program
llvm-svn: 9566
This commit is contained in:
parent
5564406f6e
commit
2c14d253c4
|
@ -8,10 +8,8 @@
|
||||||
# Syntax: profile.pl [OPTIONS] bytecodefile <arguments>
|
# Syntax: profile.pl [OPTIONS] bytecodefile <arguments>
|
||||||
#
|
#
|
||||||
# OPTIONS may include one or more of the following:
|
# OPTIONS may include one or more of the following:
|
||||||
# NONE SO FAR
|
# -block - Enable basic block level profiling
|
||||||
#
|
#
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
my $ProfilePass = "-insert-function-profiling";
|
my $ProfilePass = "-insert-function-profiling";
|
||||||
|
|
||||||
|
@ -21,7 +19,7 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
|
||||||
last if /^--$/; # Stop processing arguments on --
|
last if /^--$/; # Stop processing arguments on --
|
||||||
|
|
||||||
# List command line options here...
|
# List command line options here...
|
||||||
#if (/^-enable-foo$/) { $FOO = 1; next; }
|
if (/^-block$/) { $ProfilePass = "-insert-block-profiling"; next; }
|
||||||
|
|
||||||
print "Unknown option: $_ : ignoring!\n";
|
print "Unknown option: $_ : ignoring!\n";
|
||||||
}
|
}
|
||||||
|
@ -38,7 +36,7 @@ chomp $LLIPath;
|
||||||
|
|
||||||
my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so";
|
my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so";
|
||||||
|
|
||||||
system "opt $ProfilePass < $BytecodeFile | lli -load $LibProfPath - " .
|
system "opt $ProfilePass < $BytecodeFile | lli -fake-argv0 '$BytecodeFile'" .
|
||||||
(join ' ', @ARGV);
|
" -load $LibProfPath - " . (join ' ', @ARGV);
|
||||||
|
|
||||||
system "llvm-prof $BytecodeFile";
|
system "llvm-prof $BytecodeFile";
|
||||||
|
|
Loading…
Reference in New Issue