From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22533 invoked by alias); 3 Jul 2014 22:06:39 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 22437 invoked by uid 48); 3 Jul 2014 22:06:31 -0000 From: "jlebon at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/17073] SystemTap doesn't support module given by full path Date: Thu, 03 Jul 2014 22:06:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jlebon at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q3/txt/msg00004.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17073 --- Comment #3 from Jonathan Lebon --- (In reply to Jonathan Lebon from comment #1) > NB: note the TODO item in the patch re. calculating the proper offset for > the module name. Looking at this more deeply now, this is not as easy as it seems. The struct is defined in but clearly userspace apps shouldn't include that. We could instead simply rely on DWARF information and retrieve the DW_AT_data_member_location attribute from the name DW_TAG_member. But this assumes we have DWARF info to begin with. Since we are now able to probe functions without DWARF info, this would be a sad requirement to add. Another way would be to defer this work until runtime, at which point we can directly use offsetof(), although I'm not too sure how feasible ELF inspection is there. The deferring also adds complexity which I'd rather avoid. The easy way out is to go the 'heuristicky' way and simply assume that the module name is the $(basename $path .ko). This is more or less what elfutils does but in reverse (i.e. find the ko file from the module name, see libdwfl/linux-kernel-module.c). We can also do a combination of the two, i.e. if we have DWARF, then use that, otherwise just use the basename. Thoughts? -- You are receiving this mail because: You are the assignee for the bug.