David Blaikie
2005-Aug-23 01:49 UTC
[LLVMdev] Profiling - basic block execution frequencies
I've read some small amounts of documentation including the Doxygen docs on the LLVM Profiling capabilities. I'm looking to extract basic block execution frequencies (I just need relative values within a function) in to a simplified custom format for my work (research in to instruction selection). The API seems geared more towards the use of profiling data in LLVM Passes and I was wondering if anyone could just give me a brief overview or point me in the direction of the right part of the docs on how to easily generate profiling data and use C++ to interact with it and get what I need. Thanks for your time and a great tool, David Blaikie -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+@ s++: a-- C++++ ULS++ P L++ !E W++ N+ o? K? w(+) O? M@ V? PS+ PE@ Y+ PGP- t(+) 5 X+ R tv+ b+ DI++ D++ G+ e h! r y-(-) ------END GEEK CODE BLOCK------
Chris Lattner
2005-Aug-23 05:21 UTC
[LLVMdev] Profiling - basic block execution frequencies
On Tue, 23 Aug 2005, David Blaikie wrote:> I've read some small amounts of documentation including the Doxygen > docs on the LLVM Profiling capabilities. I'm looking to extract basic > block execution frequencies (I just need relative values within a > function) in to a simplified custom format for my work (research in to > instruction selection). The API seems geared more towards the use of > profiling data in LLVM Passes and I was wondering if anyone could just > give me a brief overview or point me in the direction of the right > part of the docs on how to easily generate profiling data and use C++ > to interact with it and get what I need.Check out the code in tools/llvm-prof. llvm-prof is a thin wrapper around the profiling APIs the loads the data and prints it out for human consumption. From this you can figure out the APIs and convert it to whatever interface you'd like. -Chris -- http://nondot.org/sabre/ http://llvm.org/