[LLVMdev] RFC: Binary format for instrumentation based profiling data (original) (raw)
Xinliang David Li xinliangli at gmail.com
Thu Mar 13 14:37:28 PDT 2014
- Previous message: [LLVMdev] RFC: Binary format for instrumentation based profiling data
- Next message: [LLVMdev] RFC: Binary format for instrumentation based profiling data
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Mar 13, 2014 at 2:14 PM, Diego Novillo <dnovillo at google.com> wrote:
On Thu, Mar 13, 2014 at 11:51 AM, Bob Wilson <bob.wilson at apple.com> wrote: > > On Mar 13, 2014, at 5:48 AM, Diego Novillo <dnovillo at google.com> wrote: >> >> How are counters represented? Are these line numbers together with the >> counter? Basic blocks? Edges? > > There are no line numbers, basic blocks, or edges. It is just a sequence of counters that the front-end knows how to map to the code (the same as with our current textual file format).
Sorry, you lost me. How exactly does the FE map them to the code? In the sample profiler, each instrumented line consists of a line offset, a discriminator (to distinguish distinct control flow paths on the same line) and the counter. We match them by computing the absolute line number from the offset and assign the counter to the corresponding basic block.
For GCC, it is CFG based matching -- it requires exact match of sources between instrumentation and annotation (the counters are laid out in some CFG order).
David
I think we should be able to use the same pass in lib/Transforms/Scalar/SampleProfile.cpp to read profiles generated from instrumentation. The information is basically the same, so a bit of generalization of that code should be all we need to pass those counters down into the analysis module.
Diego.
LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140313/eca45609/attachment.html>
- Previous message: [LLVMdev] RFC: Binary format for instrumentation based profiling data
- Next message: [LLVMdev] RFC: Binary format for instrumentation based profiling data
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]