public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* How to associate Elf with Dwfl_Module returned by dwfl_report_module
@ 2018-03-17 13:15 Milian Wolff
  2018-03-20 22:05 ` Mark Wielaard
  0 siblings, 1 reply; 11+ messages in thread
From: Milian Wolff @ 2018-03-17 13:15 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]

Hey there,

a recurring issue in the libdwfl integration of perf and perfparser are 
supposedly overlapping modules. The perf data file contains the exact mappings 
for all files corresponding to the actual mmap events that occurred during 
runtime, e.g.:

```
$ perf script --show-mmap-events | grep MMAP | grep stdc
heaptrack_print 13962 87163.483450: PERF_RECORD_MMAP2 13962/13962: 
[0x7fd0aea84000(0x387000) @ 0 08:03 413039 3864781083]: r-xp /usr/lib/libstdc+
+.so.6.0.24
heaptrack_print 13962 87163.483454: PERF_RECORD_MMAP2 13962/13962: 
[0x7fd0aebfc000(0x1ff000) @ 0x178000 08:03 413039 3864781083]: ---p /usr/lib/
libstdc++.so.6.0.24
heaptrack_print 13962 87163.483458: PERF_RECORD_MMAP2 13962/13962: 
[0x7fd0aedfb000(0xd000) @ 0x177000 08:03 413039 3864781083]: rw-p /usr/lib/
libstdc++.so.6.0.24
heaptrack_print 13962 87163.484860: PERF_RECORD_MMAP2 13962/13962: 
[0x7fd0aedfb000(0xc000) @ 0x177000 08:03 413039 3864781083]: r--p /usr/lib/
libstdc++.so.6.0.24
```
So far, both perf and perfparser are using dwfl_report_elf to report the file. 
But that API is deducing the mapping addresses internally, which may or may 
not be what we saw at runtime. I suspect that this is the reason for some 
issues we are seeing, such as supposedly overlapping modules. 

Looking at the Dwfl API, I cannot figure out how to feed the mapping directly. 
There's dwfl_report_module, but how would I associate an Elf* and int fd with 
it, as done by dwfl_report_elf?

Thanks
-- 
Milian Wolff
mail@milianw.de
http://milianw.de

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-03-22 12:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-17 13:15 How to associate Elf with Dwfl_Module returned by dwfl_report_module Milian Wolff
2018-03-20 22:05 ` Mark Wielaard
2018-03-21 13:01   ` Milian Wolff
2018-03-21 14:23     ` Milian Wolff
2018-03-21 14:35       ` Ulf Hermann
2018-03-21 21:31       ` Mark Wielaard
2018-03-22 12:30         ` Milian Wolff
2018-03-21 21:21     ` Mark Wielaard
2018-03-22 12:29       ` Milian Wolff
2018-03-22  9:11     ` Ulf Hermann
2018-03-22 12:33       ` Milian Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).