From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94481 invoked by alias); 17 Mar 2018 13:15:35 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 92161 invoked by uid 89); 17 Mar 2018 13:15:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: dd17628.kasserver.com Received: from dd17628.kasserver.com (HELO dd17628.kasserver.com) (85.13.138.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Mar 2018 13:15:05 +0000 Received: from agathebauer.localnet (ip5f5bd6b7.dynamic.kabel-deutschland.de [95.91.214.183]) by dd17628.kasserver.com (Postfix) with ESMTPSA id 2D8CB6280075 for ; Sat, 17 Mar 2018 14:15:03 +0100 (CET) From: Milian Wolff To: elfutils-devel@sourceware.org Subject: How to associate Elf with Dwfl_Module returned by dwfl_report_module Date: Sat, 17 Mar 2018 13:15:00 -0000 Message-ID: <3517953.ztkfjMdy38@agathebauer> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1829638.xAWQPLB1pU"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00080.txt.bz2 --nextPart1829638.xAWQPLB1pU Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 1520 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 --nextPart1829638.xAWQPLB1pU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEezawi1aUvUGg3A1+8zYW/HGdOX8FAlqtFMgACgkQ8zYW/HGd OX+XkBAA0opWu49ZHtufv0HuLaOON9wbox/SIgav670Y4EBePFgcVYA4oBYmsVVr 3kB2NzwlVRlnUT1wK0jyxgB0lkszRKiYua2EgemVM+kQDqS628t+FK3RtSi++MZD 7Lp7mlOq+PEhDkOVUfVVi3OXi0JlGcqHezrnUbEpqLtlyQwJTIuuKMrjBF8HaDly Oywtcfsp6M0yUl+TOesedkdQHWDkIf3BMmnGT5xfRGo6uuOCMr5DKiLRsTZ1jyuo 3+74YasFJHgmoezKBaM8nWOCu9oawBPKzv3eFf6woORVnObA/S1pB76A0p7sIeAC sC8W0SbJBGsztmzTwDMw09jeZtb5D1V4+TslQphKCB3YL62oW4WQ7jsLtbal7qZQ CdqFMev0CcInL9LjaLIHHYBlHi9C9oOHhAWjJDix5AfnvHluLDJU3BWaVdO0KhtL epO3DpGP8V9YPcF2u+ISxii2z86zxpUiSQRzxKcwHdhr+M/n6/QFcLJNTj2oX6+R GUthTEeivHJZit8VXm8a/6nBezrKz35Jor1L4ebYdxWlGIRJOhiiwP/GAo6fCCwc TTdkVuYw2j5DWpBg4lPDENwVrbm/5gZZtC7mBG7AO2iNcI/BZl+HYESIw9yINKUu rsVuySRi1MGV/9hPJUvHGPnGPmrriBP/l6WkX87xe2wrMFAtBU8= =OvpJ -----END PGP SIGNATURE----- --nextPart1829638.xAWQPLB1pU--