From: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Linux 4.15.0-rc3 perf probe/uprobe issue with address randomization
Date: Fri, 15 Dec 2017 15:14:37 +0100 [thread overview]
Message-ID: <8402bed0-bb40-53dc-faf8-bd26f6997de5@linux.vnet.ibm.com> (raw)
During debugging of perf probe tool I discovered an issue with
uprobes and address randomization.
To set a uprobe on a function named inet_pton in libc library, you
obtain the address of the symbol inet_pton using command nm and
then use the following command to set the uprobe:
# echo "p:probe_libc/inet_pton /usr/lib64/libc-2.26.so:0x142060"
> /sys/kernel/debug/tracing/uprobe_events
0x142060 is the address of inet_pton on my system.
This works nicely and the uprobe is usable.
The issue is with the output:
# cat /sys/kernel/debug/tracing/uprobe_events
p:probe_libc/inet_pton /usr/lib64/libc-2.26.so:0x000000002d0f8952
#
The displayed address 0x000000002d0f8952 is wrong, probably
randomized and post processing of this output with the perf
probe tool fails due to this random address:
# linux/tools/perf/perf probe -l
Failed to find debug information for address 2d0f8952
probe_libc:inet_pton (on 0x2d0f8952 in /usr/lib64/libc-2.26.so)
#
So how to fix this (if at all)?
Is replacing %p by %llx in line 612 of file kernel/trace/trace_uprobe.c
seq_printf(m, "0x%p", (void *)tu->offset)
an option?
Or is this broken by design and intention?
Thanks for hints and suggestions.
--
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
next reply other threads:[~2017-12-15 14:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-15 14:14 Thomas-Mich Richter [this message]
2017-12-15 14:21 ` Peter Zijlstra
2017-12-15 15:11 ` Thomas-Mich Richter
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=8402bed0-bb40-53dc-faf8-bd26f6997de5@linux.vnet.ibm.com \
--to=tmricht@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
/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
all inboxes | Powered by JetHome®