]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: migrate pdata size assertion out of generic code
authorNick Alcock <nick.alcock@oracle.com>
Mon, 23 May 2016 21:27:40 +0000 (22:27 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 23 May 2016 21:52:40 +0000 (22:52 +0100)
Only arch-specific code cares about this invariant, and it may not exist
on other future arches, so duplicate it on all arches that care.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace_dev.c
dtrace/include/x86_64/dtrace/mod_arch.h
dtrace/sdt_sparc64.c
dtrace/sdt_x86_64.c

index 8d79da22d46b8415c8ffe51a48a9cc1f707c4d93..cce388c389e0679044fd365a4372b68043f8e9c1 100644 (file)
@@ -1385,12 +1385,6 @@ int dtrace_dev_init(void)
        int                     rc = 0;
        struct cred             *cred;
 
-       /*
-        * Sanity check to ensure that the memory allocated by the kernel is
-        * sufficient for what PDATA needs.
-        */
-       ASSERT(sizeof(dtrace_module_t) < DTRACE_PDATA_SIZE);
-
        /*
         * Register the device for the DTrace core.
         */
index 5db59861d2b27c49c4033ad69733299783082a62..583baca0d65fb61a9bf8c8dd6ff886351f2570cd 100644 (file)
@@ -25,6 +25,8 @@
  * Use is subject to license terms.
  */
 
+#include <asm/dtrace_arch.h>
+
 /*
  * Structure to hold DTrace specific information about modules (including the
  * core kernel module).  Note that each module (and the main kernel) already
index 8fe02a0b08b655089e80f5c29186079e6224e0be..a1f77431d4b614775de8bb9b6428212a23e4d10f 100644 (file)
@@ -178,6 +178,12 @@ void sdt_disable_arch(sdt_probe_t *sdp, dtrace_id_t id, void *arg)
 
 int sdt_dev_init_arch(void)
 {
+       /*
+        * Sanity check to ensure that the memory allocated by the kernel is
+        * sufficient for what PDATA needs.
+        */
+       ASSERT(sizeof(dtrace_module_t) < DTRACE_PDATA_SIZE);
+
        return 0;
 }
 
index 1faac5b601da6103ecfb50e23f2252e1d07b7a9f..ac0226c7079da8636964663b65f5af21360a1bad 100644 (file)
@@ -116,6 +116,12 @@ uint64_t sdt_getarg(void *arg, dtrace_id_t id, void *parg, int argno,
 
 int sdt_dev_init_arch(void)
 {
+       /*
+        * Sanity check to ensure that the memory allocated by the kernel is
+        * sufficient for what PDATA needs.
+        */
+       ASSERT(sizeof(dtrace_module_t) < DTRACE_PDATA_SIZE);
+
        return dtrace_invop_add(sdt_invop);
 }