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: 1. Compile to LLVM Bitcode llvm-gcc –emit-llvm foo.c –c –o foo.bc 2. Insert Path Instruments opt –insert-path-profiling foo.bc –o foo_path.bc 3. Link with profile runtime library and make machine code llvm-ld –lprofile_rt –native foo_path.bc –o foo_path 4. Run program to get profile info ./foo_path –llvmprof-out 5. Create path count map from raw data opt –path-profile-loader-file =llvmprof.out –path-profile-loader foo_path.bc –o path.out 6. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110509/0edb8a91/attachment.html>
On May 9, 2011, at 3:36 AM, Linh Ho Tran wrote:> 1. Compile to LLVM Bitcode > llvm-gcc –emit-llvm foo.c –c –o foo.bc > 2. Insert Path Instruments > opt –insert-path-profiling foo.bc –o foo_path.bc > 3. Link with profile runtime library and make machine code > llvm-ld –lprofile_rt –native foo_path.bc –o foo_path > 4. Run program to get profile info > ./foo_path –llvmprof-out > 5. Create path count map from raw data > opt –path-profile-loader-file =llvmprof.out –path-profile-loader foo_path.bc –o path.out > 6. 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?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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110509/ecd8ff97/attachment.html>
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 -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667
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. On 9 May 2011 20:19, Andrew Trick <atrick at apple.com> wrote:> > On May 9, 2011, at 3:36 AM, Linh Ho Tran wrote: > > [...] > > 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 ________________________________ From: Andreas Neustifter <andreas.neustifter at gmail.com> To: Andrew Trick <atrick at apple.com> Cc: Linh Ho Tran <hotranlinh at yahoo.com>; "llvmdev at cs.uiuc.edu Mailing List" <llvmdev at cs.uiuc.edu>; Bob Wilson <bob.wilson at apple.com>; Adam Preuss <apreuss at ualberta.ca>; Jeff Kunkel <jdkunk3 at gmail.com>; J Nelson Amaral <amaral at cs.ualberta.ca> Sent: Tue, May 10, 2011 3:44:46 PM Subject: Re: [LLVMdev] Path profiling command 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. On 9 May 2011 20:19, Andrew Trick <atrick at apple.com> wrote:> > On May 9, 2011, at 3:36 AM, Linh Ho Tran wrote: > > [...] > > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110510/27aaa15c/attachment.html>