public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Torsten Polle <Torsten.Polle@gmx.de>
To: Mark Wielaard <mjw@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: Prelinking on ARM
Date: Thu, 25 Jun 2015 20:10:00 -0000	[thread overview]
Message-ID: <m27fqrft2v.fsf@gmx.de> (raw)
In-Reply-To: <1434112811.3016.82.camel@bordewijk.wildebeest.org> (Mark	Wielaard's message of "Fri, 12 Jun 2015 14:40:11 +0200")

Hi Mark,

Mark Wielaard writes:
 > Hi Torsten,

 > On Fri, 2015-06-05 at 21:55 +0200, Torsten Polle wrote:
 >> >> I must admit to not have much experience with the
 >> >> cross-compiling/cross-stapping mechanism. If you could provide a
 >> >> small shared library (plus separate debuginfo file?) and the stap
 >> >> invocation that doesn't work correctly that would be helpful for
 >> >> understanding what goes wrong.
 >> 
 >> please find my example below. Unfortunately, I could not reproduce the
 >> problem with a smaller library. The prelinked library and the debug
 >> information is a little bit larger.
 >> 
 >> I set a function call and function return probe in function
 >> "__libc_malloc".
 >> 
 >> In the prelinked file [1], the address is 0x410ddd94. The offset from the load
 >> address is 0x410ddd94 - 0x41068000 = 0x75D94
 >> 
 >> But the offest given in the debug information is only 0x00074954.
 >> 
 >> The debug output from SystemTap [3] shows a pc of 0x74954 and a module bias
 >> 0x41079440.

 > That might, or might not, be correct. systemtap uses libdwfl to create a
 > memory layout mimicking how the process/library may be placed in memory.
 > It might pick a (fictional) load address for the library that is
 > different than what the dynamic loader might pick (the prelinked load
 > address). If so, that might explain the difference of module bias.

I've to apologies for my late answer.

I double checked my example again and again. I took a HW debugger to
check the place where kprobes set the "breakpoint" in the library. To my
embarassement SystemTap or better libdwfl is performing the right
calculations. The probe hit again. Since I'm very sure that I had a
cases where probes were not hit, I tried various ways to reproduce the
failure. Again without success.

 > It does look to me like the pc address that stap finds (0x74954) is
 > correct for the malloc function you are trying to probe.

 > Could you show the complete stap command line you are using?
 > What do you expect the output is and what does the full output actually
 > look like?

 > Thanks,

 > Mark

Thanks for your support,
Torsten

  reply	other threads:[~2015-06-25 20:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 20:43 Torsten Polle
2015-06-02 18:28 ` Mark Wielaard
2015-06-02 20:29   ` Torsten Polle
2015-06-03  9:28     ` Mark Wielaard
2015-06-04 20:42       ` Torsten Polle
2015-06-05 19:55         ` Torsten Polle
2015-06-12 12:40           ` Mark Wielaard
2015-06-25 20:10             ` Torsten Polle [this message]
2015-06-26  9:38               ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27fqrft2v.fsf@gmx.de \
    --to=torsten.polle@gmx.de \
    --cc=mjw@redhat.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).