]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: ensure SDT stub function returns 0
authorKris Van Hees <kris.van.hees@oracle.com>
Fri, 29 Sep 2017 16:58:09 +0000 (12:58 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 3 Oct 2017 18:08:31 +0000 (14:08 -0400)
The SDT stub function is used during the kernel boot process (prior to
the patching of SDT probe points).  Since it is used for both regular
SDT probes and is-enabled SDT probes, it should return 0 to be a no-op
before call patching takes place.

Orabug: 26909775
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
include/linux/sdt.h
scripts/dtrace_sdt.sh

index 68a31cecd5f276afa9a672d9f4649febe8260283..371449843c04871ba1d2ff2ffa93bba7c94b54bb 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/stringify.h>
 
 #define        DTRACE_PROBE(name, ...) {                               \
-       extern void __dtrace_probe_##name(__DTRACE_TYPE_APPLY_DEFAULT(__DTRACE_UINTPTR_EACH, void, ## __VA_ARGS__)); \
-       __dtrace_probe_##name(__DTRACE_ARG_APPLY(__DTRACE_UINTCAST_EACH, ## __VA_ARGS__)); \
+       extern int __dtrace_probe_##name(__DTRACE_TYPE_APPLY_DEFAULT(__DTRACE_UINTPTR_EACH, void, ## __VA_ARGS__)); \
+       (void)__dtrace_probe_##name(__DTRACE_ARG_APPLY(__DTRACE_UINTCAST_EACH, ## __VA_ARGS__)); \
        asm volatile(".pushsection _dtrace_sdt_names, \"a\", @progbits\n" \
                     ".ascii \"" __stringify(name) "\"\n"               \
                     ".byte 0\n"                                        \
index 156ccdd48bf0708c839188226866f52ab3ef5553..ddf9559f918a60daa39323d7e275513bf38c740b 100755 (executable)
@@ -50,7 +50,8 @@ if [ "$opr" = "sdtstub" ]; then
                END {
                    if (count) {
                        if (arch == "x86" || arch == "x86_64") {
-                           print "\tret";
+                           print "\txor %eax,%eax";
+                           print "\tretq";
                        } else if (arch == "sparc" || arch == "sparc64") {
                            print "\tretl";
                            print "\tnop";