Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Issue 91111: Add line numbers to OProfile (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 11 months ago by Jeffrey Yasskin
Modified:
5 years, 11 months ago
Reviewers:
CC:
llvm-commits_cs.uiuc.edu, bruno.cardoso_gmail.com
Base URL:
https://llvm.org/svn/llvm-project/llvm/trunk/
Visibility:
Public.

Description

Add line numbers to OProfile. To do this, I added a beginDebugLoc() call to the MachineCodeEmitter interface and made copying the start line of a function not conditional on whether we're emitting Dwarf debug information. I still need to propagate the beginDebugLoc() calls to the non-X86 targets, but I'm waiting to do that until LLVMdev confirms that this is the right approach. In the long run, it'll probably be better to gather this information through the DwarfWriter, but the DwarfWriter currently depends on the AsmPrinter and TargetAsmInfo, and fixing that would be out of the way for this patch. Sample output: $ sudo opcontrol --reset; sudo opcontrol --start-daemon; sudo opcontrol --start; Debug/bin/lli fib.bc; sudo opcontrol --stop [sudo] password for jyasskin: Signalling daemon... done Profiler running. fib(40) == 165580141 Stopping profiling. $ opreport -g -d -l `pwd`/Debug/bin/lli|head -60 Overflow stats not available CPU: Core 2, speed 1998 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 vma samples % linenr info image name symbol name 00007f62689160b0 25420 60.7364 fib.c:24 20676.jo fib_left 00007f62689160b0 1741 6.8489 fib.c:24 00007f62689160b1 91 0.3580 fib.c:24 00007f62689160b9 1934 7.6082 fib.c:24 00007f62689160c6 2012 7.9150 fib.c:27 00007f62689160c8 1072 4.2172 fib.c:27 00007f62689160cd 1280 5.0354 fib.c:27 00007f62689160cf 287 1.1290 fib.c:27 00007f62689160d3 1242 4.8859 fib.c:27 00007f62689160d6 1093 4.2998 fib.c:27 00007f62689160db 963 3.7884 fib.c:27 00007f62689160dd 240 0.9441 fib.c:27 00007f62689160e1 2781 10.9402 fib.c:28 00007f62689160e5 3704 14.5712 fib.c:28 00007f62689160ea 1 0.0039 fib.c:28 00007f62689160eb 596 2.3446 (no location information) 00007f62689160f3 6383 25.1101 (no location information) 00007f6268916100 15900 37.9901 fib.c:29 20676.jo fib_right 00007f6268916100 1669 10.4969 fib.c:29 00007f6268916101 68 0.4277 fib.c:29 00007f6268916109 2416 15.1950 fib.c:29 00007f6268916116 2262 14.2264 fib.c:32 00007f6268916118 605 3.8050 fib.c:32 00007f626891611d 700 4.4025 fib.c:32 00007f626891611f 384 2.4151 fib.c:32 00007f6268916123 434 2.7296 fib.c:32 00007f6268916126 647 4.0692 fib.c:32 00007f626891612b 921 5.7925 fib.c:32 00007f626891612d 73 0.4591 fib.c:32 00007f6268916131 1824 11.4717 fib.c:33 00007f6268916135 2873 18.0692 fib.c:33 00007f626891613a 2 0.0126 fib.c:33 00007f626891613b 1008 6.3396 (no location information) 00007f6268916143 14 0.0881 (no location information) 0000000000000000 16 0.0382 (no location information) libstdc++.so.6.0.9 /usr/lib/libstdc++.so.6.0.9 0000000000052fa0 1 6.2500 (no location information) 00000000000530f0 1 6.2500 (no location information) 0000000000062c4c 1 6.2500 (no location information) 000000000006bf02 1 6.2500 (no location information) 000000000006c4d6 1 6.2500 (no location information) 00000000000a13dd 1 6.2500 (no location information) 00000000000a19a0 1 6.2500 (no location information) 00000000000a244d 1 6.2500 (no location information) 00000000000a2b74 1 6.2500 (no location information) 00000000000a2b82 1 6.2500 (no location information) 00000000000a2b91 1 6.2500 (no location information) 00000000000a2bb9 2 12.5000 (no location information) 00000000000a7f45 1 6.2500 (no location information) 00000000000c2f10 1 6.2500 (no location information) 00000000000c4b30 1 6.2500 (no location information) 0000000000815e2a 13 0.0311 stl_vector.h:396 lli std::vector<llvm::MachineOperand, std::allocator<llvm::MachineOperand> >::size() const 0000000000815e2a 2 15.3846 stl_vector.h:396 0000000000815e36 1 7.6923 stl_vector.h:397 OProfile 0.9.4 has a bug that causes it to ignore line numbers for code addresses above 4G. A fix is at http://thread.gmane.org/gmane.linux.oprofile/7634 but may or may not make it into OProfile 0.9.5.

Patch Set 1 #

Patch Set 2 : Add the DebugLoc for the function itself #

Patch Set 3 : Fix comments a bit #

Patch Set 4 : Remove a #include #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -9 lines) Patch
M include/llvm/CodeGen/MachineCodeEmitter.h View 2 chunks +7 lines, -1 line 0 comments Download
M include/llvm/ExecutionEngine/JITEventListener.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M include/llvm/Support/DebugLoc.h View 1 chunk +3 lines, -0 lines 0 comments Download
M lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp View 3 chunks +6 lines, -3 lines 0 comments Download
M lib/ExecutionEngine/JIT/JITEmitter.cpp View 1 6 chunks +29 lines, -3 lines 0 comments Download
M lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp View 1 2 3 3 chunks +69 lines, -1 line 0 comments Download
M lib/Target/X86/X86CodeEmitter.cpp View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 1
Jeffrey Yasskin
5 years, 11 months ago (2009-07-15 19:38:28 UTC) #1
Please take a look. I'll attach the patch shortly. Bruno, especially, let me
know how I can make this fit better with your long-term plans for full Dwarf
output.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld e6eadc5