| Summary: | OProfile summary reports line numbers in the wrong files, when inlining and -O2 or -O3 is used | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Corey Ashford <cjashfor> | ||||||||
| Component: | LinuxTools | Assignee: | Roland Grunberg <rgrunber> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | kksebasti, wainersm | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=359076 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Corey Ashford
Created attachment 201759 [details]
Screen shot showing the incorrect line number reporting. "3.77% on line 41"
Created attachment 201760 [details]
main file for the test case
Created attachment 201761 [details]
.h file which defines the inline function
I've committed http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/commit/?id=f71494378039c6c7733a2f1a876679568a40846e to rely on opreport for location of symbols in the source. When I run opreport after reproducing I see the following : CPU: Intel Architectural Perfmon, speed 1600 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 vma samples % linenr info image name symbol name 08048310 839 59.0429 sample_c.c:20 test_summary main 08048320 109 12.9917 do_nothing.h:41 08048327 729 86.8892 sample_c.c:25 0804832c 1 0.1192 sample_c.c:23 08048420 580 40.8163 sample_c.c:16 test_summary local_do_nothing 08048420 1 0.1724 sample_c.c:16 08048427 579 99.8276 sample_c.c:17 So it seems that even though the sample shows up under main (sample_c.c:20), the source location refers to do_nothing.h:41. I could have each sample in the view list the file name to which it refers as well, although double clicking on the sample should take the user to the desired location. Great! Looking through the patch, it appears you didn't need to add the -g | --debug-info switch to opreport to get the file and line # info? Currently the plugin calls addr2line on the set of addresses provided in the XML. Initially it looked like -g didn't provide file info for all possible samples. However, it seems that for a given sample, if it resides in the same file as it's parent, the file is omitted, which makes sense. I'll file a bug against that. Marking this as closed. |