[Bug 1182888] New: perf: Fix jump parsing for C++ code
https://bugzilla.suse.com/show_bug.cgi?id=1182888 Bug ID: 1182888 Summary: perf: Fix jump parsing for C++ code Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: jslaby@suse.com Reporter: jslaby@suse.com QA Contact: qa-bugs@suse.de CC: mliska@suse.cz Found By: --- Blocker: --- Considering the following testcase: int foo(int a, int b) { for (unsigned i = 0; i < 1000000000; i++) a += b; return a; } int main() { foo (3, 4); return 0; } perf annotate displays: 86.52 ���40055e: ��� ja 40056c <foo(int, int)+0x26> 13.37 ���400560: mov -0x18(%rbp),%eax ���400563: add %eax,-0x14(%rbp) ���400566: addl $0x1,-0x4(%rbp) 0.11 ���40056a: ��� jmp 400557 <foo(int, int)+0x11> ���40056c: mov -0x14(%rbp),%eax ���40056f: pop %rbp and the 'ja 40056c' does not link to the location in the function. It's caused by fact that comma is wrongly parsed, it's part of function signature. With my patch I see: 86.52 ��� ���������ja 26 13.37 ��� ��� mov -0x18(%rbp),%eax ��� ��� add %eax,-0x14(%rbp) ��� ��� addl $0x1,-0x4(%rbp) 0.11 ��� ������ jmp 11 ���26:���������mov -0x14(%rbp),%eax and 'o' output prints: 86.52 ���4005��������� ��� ja 40056c <foo(int, int)+0x26> 13.37 ���4005���0: mov -0x18(%rbp),%eax ���4005���3: add %eax,-0x14(%rbp) ���4005���6: addl $0x1,-0x4(%rbp) 0.11 ���4005���a: ��� jmp 400557 <foo(int, int)+0x11> ���4005��������� mov -0x14(%rbp),%eax On the contrary, compiling the very same file with gcc -x c, the parsing is fine because function arguments are not displyed: jmp 400543 <foo+0x1d> -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1182888 https://bugzilla.suse.com/show_bug.cgi?id=1182888#c1 Jiri Slaby <jslaby@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |IN_PROGRESS --- Comment #1 from Jiri Slaby <jslaby@suse.com> --- Fixed by: commit 1f0e6edcd968ff19211245f7da6039e983aa51e5 Author: Martin Li��ka <mliska@suse.cz> Date: Thu Feb 11 13:37:55 2021 +0100 perf annotate: Fix jump parsing for C++ code. in 5.12-rc1. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1182888 https://bugzilla.suse.com/show_bug.cgi?id=1182888#c2 Jiri Slaby <jslaby@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED --- Comment #2 from Jiri Slaby <jslaby@suse.com> --- Committed. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1182888 https://bugzilla.suse.com/show_bug.cgi?id=1182888#c3 --- Comment #3 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1182888) was mentioned in https://build.opensuse.org/request/show/876132 Factory / perf -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com