Jeffrey Yasskin
2010-Jun-19 21:14 UTC
[LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
Have you found http://llvm.org/docs/DebuggingJITedCode.html? The JIT already has support for something like this for gdb's benefit. Perftools and valgrind just don't know how to find it yet. On Sat, Jun 19, 2010 at 2:03 PM, Yuri <yuri at rawbw.com> wrote:> This new option (--jit-emit-debug-function-range) will allow to output > function information for memory ranges that functions occupy in memory while > they run in JIT. File format generated is like this: > ... > 0x5000000 0x5001000 function_name_is_here > ... > > This feature is useful for external tools like valgrind and google-perftools > to profile the code when it is run in JIT. Particularly google-perftools > will have a special option (--external_symbols) that will be able to import > this file. > > Note: to be useful this flag should be used with -disable-fp-elim to > generate standard prologs. > > Thank you, > Yuri > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Yuri
2010-Jun-19 21:30 UTC
[LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
On 06/19/2010 14:14, Jeffrey Yasskin wrote:> Have you found http://llvm.org/docs/DebuggingJITedCode.html? The JIT > already has support for something like this for gdb's benefitYes, I saw it and tried it. -jit-emit-debug generates ELF image in memory with debug info. Another option -jit-emit-debug-to-disk creates .o ELF files with debug info, one per function. If there are thousands of functions there will be thousands of files. perftools can't use the first option, since it only collects stack address information during the run. And it would be very difficult/impractical to list all (thousands) of the resulting .o files into pprof's command line. Same with valgrind and very slow to load them since pprof runs addr2line per object file. This will take forever. So option -jit-emit-debug-function-range is meant to amend the above two. It creates just one file with information just sufficient for perftools. Yuri
Reid Kleckner
2010-Jun-19 22:12 UTC
[LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
On Sat, Jun 19, 2010 at 5:30 PM, Yuri <yuri at rawbw.com> wrote:> On 06/19/2010 14:14, Jeffrey Yasskin wrote: >> Have you found http://llvm.org/docs/DebuggingJITedCode.html? The JIT >> already has support for something like this for gdb's benefit > > Yes, I saw it and tried it. -jit-emit-debug generates ELF image in > memory with debug info. > Another option -jit-emit-debug-to-disk creates .o ELF files with debug > info, one per function. If there are thousands of functions there will > be thousands of files. > > perftools can't use the first option, since it only collects stack > address information during the run. And it would be very > difficult/impractical to list all (thousands) of the resulting .o files > into pprof's command line. Same with valgrind and very slow to load them > since pprof runs addr2line per object file. This will take forever. > > So option -jit-emit-debug-function-range is meant to amend the above > two. It creates just one file with information just sufficient for > perftools.Sounds good. It's probably overkill, but it would be nice if perftools could be made to Just Work with the JIT debugging interface. Reid
Apparently Analagous Threads
- [LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
- [LLVMdev] [patch] New feature: debug info in add2line format (--jit-emit-debug-addr2line)
- [LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
- MultiDatabase shard count limitations
- [LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)