]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: support kernels built with RANDOMIZE_BASE
authorKris Van Hees <kris.van.hees@oracle.com>
Sun, 13 Jan 2019 03:10:01 +0000 (22:10 -0500)
committerBrian Maly <brian.maly@oracle.com>
Tue, 12 Feb 2019 19:14:32 +0000 (14:14 -0500)
commita08c810b9965a5a76f4c600e8ed73a714a59173e
tree96503e69d3c44f54890b0ae52acca5ae3e749ed0
parentceea9d71d84a402818f9b070d1e932a05fa46c8d
dtrace: support kernels built with RANDOMIZE_BASE

SDT probe addresses were being generated as absolute addresses which
breaks when the kernel may get relocated to a place other than the
default load address.

The solution is to generate the probe locations as an offset relative to
the _stext symbol in the .tmp_sdtinfo.S source file (generated at build
time), so that the actual addresses are processed as relocations when the
kernel boots.

This fix also optimizes the SDT info data (function and probe names) by
using de-duplication since especially with perf probes) many of those
strings are non-unique.

Orabug: 29204005
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
Tested-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
include/linux/dtrace_sdt.h
kernel/dtrace/dtrace_sdt_core.c
scripts/dtrace_sdt.sh