]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Consistently use fbt_excluded() on all architectures.
authormarkj <markj@FreeBSD.org>
Sat, 10 Dec 2016 03:11:05 +0000 (03:11 +0000)
committermarkj <markj@FreeBSD.org>
Sat, 10 Dec 2016 03:11:05 +0000 (03:11 +0000)
MFC after: 2 weeks

sys/cddl/dev/fbt/arm/fbt_isa.c
sys/cddl/dev/fbt/powerpc/fbt_isa.c
sys/cddl/dev/fbt/x86/fbt_isa.c

index 068610acf83379a1c0ec77efa6386f2a97f7f805..f1fae1ca66f4255eb70aaf07ab4f79ee3ae982de 100644 (file)
@@ -95,16 +95,8 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
        uint32_t *instr, *limit;
        int popm;
 
-       if (strncmp(name, "dtrace_", 7) == 0 &&
-           strncmp(name, "dtrace_safe_", 12) != 0) {
-               /*
-                * Anything beginning with "dtrace_" may be called
-                * from probe context unless it explicitly indicates
-                * that it won't be called from probe context by
-                * using the prefix "dtrace_safe_".
-                */
+       if (fbt_excluded(name))
                return (0);
-       }
 
        instr = (uint32_t *)symval->value;
        limit = (uint32_t *)(symval->value + symval->size);
index e67e837742a8331987cb7b0c67ca27031f9b4e0e..cea849e31d3621c1377049f22bf737dc81eb09ae 100644 (file)
@@ -127,16 +127,8 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
                return (0);
 #endif
 
-       if (strncmp(name, "dtrace_", 7) == 0 &&
-           strncmp(name, "dtrace_safe_", 12) != 0) {
-               /*
-                * Anything beginning with "dtrace_" may be called
-                * from probe context unless it explicitly indicates
-                * that it won't be called from probe context by
-                * using the prefix "dtrace_safe_".
-                */
+       if (fbt_excluded(name) == 0)
                return (0);
-       }
 
        instr = (uint32_t *) symval->value;
        limit = (uint32_t *) (symval->value + symval->size);
index 51cfc64c1127fa919f3f5cb6baa348c19e5277e5..3f4d8c58ad0d8c95f731524368aaace98f8c514f 100644 (file)
@@ -158,21 +158,15 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
        int size;
        uint8_t *instr, *limit;
 
-       if ((strncmp(name, "dtrace_", 7) == 0 &&
-           strncmp(name, "dtrace_safe_", 12) != 0) ||
-           strcmp(name, "trap_check") == 0) {
-               /*
-                * Anything beginning with "dtrace_" may be called
-                * from probe context unless it explicitly indicates
-                * that it won't be called from probe context by
-                * using the prefix "dtrace_safe_".
-                *
-                * Additionally, we avoid instrumenting trap_check() to avoid
-                * the possibility of generating a fault in probe context before
-                * DTrace's fault handler is called.
-                */
+       if (fbt_excluded(name))
+               return (0);
+
+       /*
+        * trap_check() is a wrapper for DTrace's fault handler, so we don't
+        * want to be able to instrument it.
+        */
+       if (strcmp(name, "trap_check") == 0)
                return (0);
-       }
 
        size = symval->size;