]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: add support for DTrace on sparc64
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 10 Feb 2015 17:12:27 +0000 (12:12 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Mon, 20 Apr 2015 08:04:49 +0000 (04:04 -0400)
commitfb3238e92c2cafd1cff73e181202bdc94b7625f3
tree27907ca64c7c2913007919a6cf331b1a47a5cad3
parentab27b30ac795c2c9807cf8f393fd1af5e81a0791
dtrace: add support for DTrace on sparc64

This commit adds support for sparc64 to the DTrace modules.  It also
includes some changes to the arch-independent code, to account for
some extra support pieces that are necessary for sparc64 without needing
to unnecessarily increase the portion of arch-dependent code.

- Add sparc64 implementations for arch-specific portions of DTrace.

- Add support for a provider API function (dtps_cleanup_module) to be
  called for modules when a provider module is being unloaded.  When
  defined, this function can take care of any final cleanup that may
  be necessary.  This facility is used by the SDT code on sparc64 to
  clean up the trampolines for the SDT probes.

- Add support for the pdata member in the module struct.  This member
  (generic pointer) can be populated with a pointer to a structure that
  holds implementation specific DTrace data for the module.  Each arch
  must define dtrace_module_t (in include/<arch>/dtrace/mod_arch.h),
  containing at a minimum:

size_t sdt_probe_cnt
int sdt_enabled
size_t fbt_probe_cnt

  For sparc64 there is also a sdt_instr_t *sdt_tab member that will
  hold a memory block for SDT trampolines.

  The dtrace_module_t structs are allocated from a kmem cache.  For
  modules that exist before dtrace is loaded, the pdata member is
  populated during the loading of dtrace.  Modules loaded after dtrace
  get it populated from a module notifier.  When modules are unloaded,
  the module notifier cleans up the pdata member.  When dtrace itself
  is unloaded, all remaining modules have their pdata member cleaned
  up.

- Provide a generic method for calling a function on every loaded
  module in the absence of a kernel facility to allow modules access
  to the actual list of loaded modules.  This adds an exported function

void dtrace_for_each_module(for_each_module_fn *fn, void *arg)

  to be used from module code to call fn(arg, modile) for every module
  that is loaded.

Orabug: 19005048

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
20 files changed:
dtrace/dt_perf_mod.c
dtrace/dt_test_mod.c
dtrace/dtrace_asm_sparc64.S [new file with mode: 0644]
dtrace/dtrace_dev.c
dtrace/dtrace_isa_sparc64.c [new file with mode: 0644]
dtrace/dtrace_probe.c
dtrace/dtrace_util.c
dtrace/fasttrap_dev.c
dtrace/include/dtrace/dtrace_impl.h
dtrace/include/dtrace/dtrace_impl_defines.h
dtrace/include/dtrace/provider.h
dtrace/include/sparc64/dtrace/mod_arch.h [new file with mode: 0644]
dtrace/include/sparc64/dtrace/sdt_arch.h [new file with mode: 0644]
dtrace/include/x86_64/dtrace/mod_arch.h [new file with mode: 0644]
dtrace/profile_mod.c
dtrace/sdt_dev.c
dtrace/sdt_impl.h
dtrace/sdt_mod.c
dtrace/sdt_sparc64.c [new file with mode: 0644]
dtrace/systrace_mod.c