]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: ensure pdata is large enough
authorKris Van Hees <kris.van.hees@oracle.com>
Sat, 21 May 2016 13:43:55 +0000 (06:43 -0700)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 23 May 2016 15:44:24 +0000 (16:44 +0100)
With the sudden (large) increase of SDT probe points, the previously
statically defined default size for the kernel pdata block was not
sufficient.  The code has been modified to calculate the required size
for the pdata block at runtime.

This primarily affects sparc where the pdata also covers the memory
block used for SDT trampolines.  It is now dependent on the actual
number of SDT probes in the kernel.

This does not affect modules because they were already allocating the
needed memory block at load time based on the actual number of probes.

Orabug: 23004534
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
arch/sparc/include/asm/dtrace_arch.h
arch/x86/include/asm/dtrace_arch.h
kernel/dtrace/dtrace_os.c

index 729ca60423e8bcc958d0a75c96b9c5b04f262e33..68cf5478a67159e9da44d14eb33cc8c95d2136aa 100644 (file)
@@ -5,6 +5,10 @@
 
 typedef uint32_t       asm_instr_t;
 
-#define SDT_TRAMP_SIZE 11
+#define SDT_TRAMP_SIZE         11
+#define DTRACE_PDATA_SIZE      64
+#define DTRACE_PDATA_EXTRA     (dtrace_sdt_nprobes * SDT_TRAMP_SIZE * \
+                                sizeof(asm_instr_t))
+#define DTRACE_PDATA_MAXSIZE   (DTRACE_PDATA_SIZE + DTRACE_PDATA_EXTRA)
 
 #endif /* _SPARC_DTRACE_ARCH_H */
index 4806af6188ad7013e0f14fc7a25f6ab68f53cd06..12165fae33c3f1ff123009923e0c09ea471f3cc6 100644 (file)
@@ -5,4 +5,8 @@
 
 typedef uint8_t                asm_instr_t;
 
+#define DTRACE_PDATA_SIZE      64
+#define DTRACE_PDATA_EXTRA      0
+#define DTRACE_PDATA_MAXSIZE    (DTRACE_PDATA_SIZE + DTRACE_PDATA_EXTRA)
+
 #endif /* _X86_DTRACE_ARCH_H */
index ff94fd9b442089b5b7f9014d370548ad861ff1be..48947b6deebcdd7d42f22f7808a7fff687f8eaf2 100644 (file)
@@ -31,8 +31,6 @@
 /*---------------------------------------------------------------------------*\
 (* OS SPECIFIC DTRACE SETUP                                                  *)
 \*---------------------------------------------------------------------------*/
-#define DTRACE_PDATA_MAXSIZE   2048
-
 struct module          *dtrace_kmod = NULL;
 EXPORT_SYMBOL(dtrace_kmod);