Hi members,
I am a LLVM newbee. I am working in path profiling. I got an error message when reading the path profile data
I made a sample source named foo.c
The command chain to make llvm path profiling as follows:
- Compile to LLVM Bitcode
llvm-gcc –emit-llvm foo.c –c –o foo.bc
- Insert Path Instruments
opt –insert-path-profiling foo.bc –o foo_path.bc
- Link with profile runtime library and make machine code
llvm-ld –lprofile_rt –native foo_path.bc –o foo_path
- Run program to get profile info
./foo_path –llvmprof-out
- Create path count map from raw data
opt –path-profile-loader-file =llvmprof.out –path-profile-loader foo_path.bc –o path.out
- Load Profile info:
llvm-prof path.out
The error message from llvm-prof is: llvm-prof: Unkknown packet #5
Could you explain me the error message?
Are there errors in the command chain?
What is the format of file llvmprof.out? Is it possible to read llvmprof.out from command llvm-prof by ignoring step 5?
What is the purpose of command in step 5?
Thanks so much
Linh
Hi Linh,
We had considerable interest in path profiling several months ago, but it was purely an experimental feature and I’m not sure if anyone is committed to maintaining the code base. I’m copying some of the interested parties to find out the current level of interest and activity. If you find the time to fix any issues, please send a patch. If the code isn’t being maintained it will eventually be pruned from the source tree.
-Andy
Hi, Linh
You can use util/profile.pl to do some profiling. Some progiling
options provided by the script is not provided by opt though. See,
Mismatch options between profile.pl and opt
http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-April/039734.html
Regards,
chenwj
Hi All!
I was involved in the LLVM profiling business during late 2009 and
early 2010 but I was not working on the path profiling but the
"regular" profiling code. So I'm only guessing in case there is not
other answer.
[...]
The error message from llvm-prof is: llvm-prof: Unkknown packet #5
Could you explain me the error message?
Are there errors in the command chain?
What is the format of file llvmprof.out? Is it possible to read
llvmprof.out from command llvm-prof by ignoring step 5?
What is the purpose of command in step 5?
Most of the LLVM profiling uses a binary format to dump the data, this
dump consists of several blocks with block headers, those headers
define the content of the block. To me it seem (again speculating
here) that there is a block header in this dump that is not recognised
by llvm-prof.
Ensure that the version of llvm-prof is from the same build as the
version of opt that you are using to instrument the code. If those
versions match then code is most likely broken.
Cheers, Andi
Hi All,
I use llvm version 2.9. llvm-prof does not support to read path profiling info. So could I use any way else to read path profiling info?
Thanks
Linh