From 82d793a6c20e2031e0d67bed8326630e70d53427 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Mon, 22 Dec 2014 16:56:13 -0500 Subject: [PATCH] dtrace: add support for sparc64 2of3 This commit is the 2nd of 3 commits to add DTrace support to the sparc64 kernel. This particular commit covers the generic kernel code changes. The sparc64 implementation for SDT probe points utilizes a call to a trampoline function that in turn calls dtrace_probe() rather than using a trap-based mechanism. This requires an additional data item to be associated with each module. In order to facilitate this in a manner that is arch-dependent, DTrace specific data other than the list of SDT probes has been moved to a structure that is maintained by the DTrace module code and the module struct merely has a generic void *pdata member that can be populated with a pointer to the actual data. This commit also renames the num_dtrace_probes member of the module struct to be sdt_probec, since that is more consistent. Orabug: 19005031 Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/module.h | 9 +++------ scripts/mod/modpost.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 6b0a8f6af8d1..d9d5d76bf425 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -352,13 +352,10 @@ struct module { bool klp_alive; #endif -#if defined(CONFIG_DTRACE) || defined(CONFIG_DTRACE_MODULE) - size_t fbt_nprobes; - +#ifdef CONFIG_DTRACE sdt_probedesc_t *sdt_probes; - unsigned int num_dtrace_probes; /* from kernel build */ - size_t sdt_nprobes; /* managed at probe load time */ - int mod_nenabled; /* # of enabled dtrace probes in module */ + unsigned int sdt_probec; + void *pdata; #endif #ifdef CONFIG_MODULE_UNLOAD diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index b5bd379634de..148af0d92eae 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2128,7 +2128,7 @@ static void add_header(struct buffer *b, struct module *mod) buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n"); buf_printf(b, "#ifdef CONFIG_DTRACE\n"); buf_printf(b, "\t.sdt_probes = _sdt_probes,\n"); - buf_printf(b, "\t.num_dtrace_probes = _sdt_probec,\n"); + buf_printf(b, "\t.sdt_probec = _sdt_probec,\n"); buf_printf(b, "#endif\n"); buf_printf(b, "};\n"); } -- 2.50.1