diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-28 22:52:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-28 22:52:05 +0000 |
commit | 8a209dd030e9bc4beb0cda1e1482035ce3ae8147 (patch) | |
tree | ba136b6e966e4793506b029b95a52db8d7594488 /utils/profile.pl | |
parent | e69671d65b45b6a1bbbdc1b215b8c0f943171c29 (diff) | |
download | external_llvm-8a209dd030e9bc4beb0cda1e1482035ce3ae8147.zip external_llvm-8a209dd030e9bc4beb0cda1e1482035ce3ae8147.tar.gz external_llvm-8a209dd030e9bc4beb0cda1e1482035ce3ae8147.tar.bz2 |
Add option for block profiling, pass in the "correct" argv[0] to the program
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/profile.pl')
-rwxr-xr-x | utils/profile.pl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/profile.pl b/utils/profile.pl index 27bfd71..c91ac1a 100755 --- a/utils/profile.pl +++ b/utils/profile.pl @@ -8,10 +8,8 @@ # Syntax: profile.pl [OPTIONS] bytecodefile <arguments> # # OPTIONS may include one or more of the following: -# NONE SO FAR +# -block - Enable basic block level profiling # -# - my $ProfilePass = "-insert-function-profiling"; @@ -21,7 +19,7 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { last if /^--$/; # Stop processing arguments on -- # List command line options here... - #if (/^-enable-foo$/) { $FOO = 1; next; } + if (/^-block$/) { $ProfilePass = "-insert-block-profiling"; next; } print "Unknown option: $_ : ignoring!\n"; } @@ -38,7 +36,7 @@ chomp $LLIPath; my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so"; -system "opt $ProfilePass < $BytecodeFile | lli -load $LibProfPath - " . - (join ' ', @ARGV); +system "opt $ProfilePass < $BytecodeFile | lli -fake-argv0 '$BytecodeFile'" . + " -load $LibProfPath - " . (join ' ', @ARGV); system "llvm-prof $BytecodeFile"; |