]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: ensure that PID 0 has a psinfo struct
authorKris Van Hees <kris.van.hees@oracle.com>
Mon, 18 Jan 2016 09:19:53 +0000 (04:19 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Sat, 30 Jan 2016 09:55:04 +0000 (04:55 -0500)
Test builtinvar/tst.psinfo.d lists a large amount of memory access
errors trying to read from non-existant psinfo information for PID 0.
This commit enusres that prior to dtrace doing any work, PID 0 (the
init_task) has a psinfo structure associated with it.

Orabug: 22561297
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
kernel/dtrace/dtrace_os.c

index cb07fb10d92f23ea11109b1a8c3f9064db175bee..ff94fd9b442089b5b7f9014d370548ad861ff1be 100644 (file)
@@ -85,6 +85,11 @@ void dtrace_os_init(void)
                                SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK,
                                NULL);
 
+       /*
+        * We need to set up a psinfo structure for PID 0 (swapper).
+        */
+       dtrace_psinfo_alloc(&init_task);
+
        dtrace_sdt_init();
        dtrace_sdt_register(dtrace_kmod);
 }