]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: FBT module support and SPARCs return probes
authorTomas Jedlicka <tomas.jedlicka@oracle.com>
Fri, 7 Apr 2017 22:23:04 +0000 (18:23 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Fri, 14 Jul 2017 04:09:26 +0000 (00:09 -0400)
commit98320804470d626a34ea8f1f0e40635180cab7ba
tree30e5f79309e4fe560f9cb380ffe8ffc2f83d84e9
parentf6cbef1b72c5225beca683af589170a40fa13eac
dtrace: FBT module support and SPARCs return probes

This fix contains following changes:
- Modification of provider ops vector
- Move of fbt hash table to x86 platform specific code
- Instrumentation of return probes on SPARC

DTrace provider has semantics that allows to create a probe on the fly or to provide
probes for given module. There is no way how a provider can attach its own per-module
data through the framework.

With this change a provider my allocate per-module data inside provide_module() call.
Once module is about to go it will be notified by framework by destroy_module() op.
To stay binary compatible I extended the ops vector on its end but used C99 style to
init ops structures to keep callbacks grouped per their logic.

SPARC now does two passes over available kernel symbols. The first one is used to
count how many symbols are present to be able to allocate correctly sized trampoline.
Second pass performs actuall disassembly and creates return probes. It is possible that
not every probe is instrumentable so we may end up wasting some memory. It is a tradeoff
between speed and memory consumption.

It is not possible to instrument arbitrary return places so we support only some variants
that are used in the stream. Current implementation relies on usage of JMPL thus it is
not possible to instrument return from tail call optimized code.

Another change is in patching of the code. The JMPL requires to store NOP in its delay
slot. This prevents us to do this atomically on the running kernel and must stop CPUs
for safety reasons.

Linux probes may fire from non-standart context like TL1 so it is not safe to assume
anything about %g registers. Thanks to having few free %l we are able to temporarly
store %gs and restor them back to avoid breaking up trap handlers.

Orabug: 26384179
Orabug: 26384765

Signed-off-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
23 files changed:
dtrace/dt_perf_mod.c
dtrace/dt_test_mod.c
dtrace/dtrace_dev.c
dtrace/dtrace_isa_sparc64.c
dtrace/dtrace_probe_ctx.c
dtrace/dtrace_ptofapi.c
dtrace/fasttrap_dev.c
dtrace/fbt_dev.c
dtrace/fbt_impl.h
dtrace/fbt_mod.c
dtrace/fbt_sparc64.c
dtrace/fbt_x86_64.c
dtrace/include/dtrace/provider.h
dtrace/include/sparc64/dtrace/fbt_arch.h
dtrace/include/sparc64/dtrace/isa_arch.h
dtrace/include/x86_64/dtrace/fbt_arch.h
dtrace/profile_mod.c
dtrace/sdt_dev.c
dtrace/sdt_impl.h
dtrace/sdt_mod.c
dtrace/sdt_sparc64.c
dtrace/sdt_x86_64.c
dtrace/systrace_mod.c