Merge branch 'vendor/OPENSSL'
[dragonfly.git] / sys / kern / kern_ktr.c
index 34b9f6f..238762e 100644 (file)
@@ -117,11 +117,11 @@ KTR_INFO(KTR_TESTLOG, testlog, test6, 5, "test6", 0);
 #ifdef SMP
 KTR_INFO(KTR_TESTLOG, testlog, pingpong, 6, "pingpong", 0);
 KTR_INFO(KTR_TESTLOG, testlog, pipeline, 7, "pipeline", 0);
-#endif
 KTR_INFO(KTR_TESTLOG, testlog, crit_beg, 8, "crit_beg", 0);
 KTR_INFO(KTR_TESTLOG, testlog, crit_end, 9, "crit_end", 0);
 KTR_INFO(KTR_TESTLOG, testlog, spin_beg, 10, "spin_beg", 0);
 KTR_INFO(KTR_TESTLOG, testlog, spin_end, 11, "spin_end", 0);
+#endif
 #define logtest(name)  KTR_LOG(testlog_ ## name, 0, 0, 0, 0)
 #define logtest_noargs(name)   KTR_LOG(testlog_ ## name)
 #endif
@@ -146,7 +146,9 @@ SYSCTL_INT(_debug_ktr, OID_AUTO, resynchronize, CTLFLAG_RW, &ktr_resynchronize,
 static int     ktr_testlogcnt = 0;
 SYSCTL_INT(_debug_ktr, OID_AUTO, testlogcnt, CTLFLAG_RW, &ktr_testlogcnt, 0, "");
 static int     ktr_testipicnt = 0;
+#ifdef SMP
 static int     ktr_testipicnt_remainder;
+#endif
 SYSCTL_INT(_debug_ktr, OID_AUTO, testipicnt, CTLFLAG_RW, &ktr_testipicnt, 0, "");
 static int     ktr_testcritcnt = 0;
 SYSCTL_INT(_debug_ktr, OID_AUTO, testcritcnt, CTLFLAG_RW, &ktr_testcritcnt, 0, "");
@@ -207,9 +209,11 @@ SYSINIT(ktr_sysinit, SI_BOOT2_KLD, SI_ORDER_ANY, ktr_sysinit, NULL);
  * This callback occurs on cpu0.
  */
 #if KTR_TESTLOG
+#ifdef SMP
 static void ktr_pingpong_remote(void *dummy);
 static void ktr_pipeline_remote(void *dummy);
 #endif
+#endif
 
 #if defined(SMP) && defined(_RDTSC_SUPPORTED_)
 
@@ -276,18 +280,12 @@ ktr_resync_callback(void *dummy __unused)
                struct spinlock spin;
 
                spin_init(&spin);
-               spin_lock_wr(&spin);
-               spin_unlock_wr(&spin);
+               spin_lock(&spin);
+               spin_unlock(&spin);
                logtest_noargs(spin_beg);
                for (count = ktr_testspincnt; count; --count) {
-                       spin_lock_wr(&spin);
-                       spin_unlock_wr(&spin);
-               }
-               logtest_noargs(spin_end);
-               logtest_noargs(spin_beg);
-               for (count = ktr_testspincnt; count; --count) {
-                       spin_lock_rd(&spin);
-                       spin_unlock_rd(&spin);
+                       spin_lock(&spin);
+                       spin_unlock(&spin);
                }
                logtest_noargs(spin_end);
                ktr_testspincnt = 0;
@@ -631,8 +629,10 @@ db_mach_vtrace(int cpu, struct ktr_entry *kp, int idx)
        }
        db_printf("%s\t", kp->ktr_info->kf_name);
        db_printf("from(%p,%p) ", kp->ktr_caller1, kp->ktr_caller2);
+#ifdef __i386__
        if (kp->ktr_info->kf_format)
                db_vprintf(kp->ktr_info->kf_format, (__va_list)kp->ktr_data);
+#endif
        db_printf("\n");
 
        return(1);