Bug 2219333 - regression: perf probe fails to add uprobes for certain binaries
Summary: regression: perf probe fails to add uprobes for certain binaries
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-tools
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-03 09:05 UTC by Georg Müller
Modified: 2023-07-03 09:05 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Georg Müller 2023-07-03 09:05:38 UTC
When trying to add a probe point for systemd (with systemd-debuginfo installed), perf returns an error:

  A function DIE doesn't have decl_line. Maybe broken DWARF?

The problem comes down to kernel commit dc9a5d2ccd5c ("perf probe: Fix to get declared file name from clang DWARF5")

I tried to report and patch the issue directly on LKML, but I got no response so far:
https://lore.kernel.org/all/5a00d5a5-7be7-ef8a-4044-9a16249fff25@gmx.net/


Reproducible: Always

Steps to Reproduce:
1. install systemd and systemd-debuginfo
2. run 'sudo perf probe -x /usr/lib/systemd/systemd-logind match_unit_removed'

Actual Results:  
perf probe returns an error with the following output:

A function DIE doesn't have decl_line. Maybe broken DWARF?
A function DIE doesn't have decl_line. Maybe broken DWARF?
Probe point 'match_unit_removed' not found.
  Error: Failed to add events.


Expected Results:  
With the patch applied, perf probe returns the following output:

Added new event:
  probe_systemd:match_unit_removed (on match_unit_removed in /usr/lib/systemd/systemd-logind)

You can now use it in all perf tools, such as:

	perf record -e probe_systemd:match_unit_removed -aR sleep 1



The patch is inspired by a patch to elfutils:

https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=e1db5cdc9f230f8de4df1a0f38dca69b283ee57a

Full information is available in the upstream email:

https://lore.kernel.org/lkml/20230628084551.1860532-3-georgmueller@gmx.net/


Note You need to log in before you can comment on or make changes to this bug.