kern_ktr.c (87793) | kern_ktr.c (88088) |
---|---|
1/* 2 * Copyright (c) 2000 3 * John Baldwin <jhb@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 2000 3 * John Baldwin <jhb@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/kern/kern_ktr.c 87793 2001-12-13 10:33:20Z jhb $ | 29 * $FreeBSD: head/sys/kern/kern_ktr.c 88088 2001-12-18 00:27:18Z jhb $ |
30 */ 31 32/* 33 * This module holds the global variables used by KTR and the ktr_tracepoint() 34 * function that does the actual tracing. 35 */ 36 37#include "opt_ddb.h" --- 90 unchanged lines hidden (view full) --- 128 129 if (panicstr) 130 return; 131 if ((ktr_mask & mask) == 0) 132 return; 133 td = curthread; 134 if (td->td_inktr) 135 return; | 30 */ 31 32/* 33 * This module holds the global variables used by KTR and the ktr_tracepoint() 34 * function that does the actual tracing. 35 */ 36 37#include "opt_ddb.h" --- 90 unchanged lines hidden (view full) --- 128 129 if (panicstr) 130 return; 131 if ((ktr_mask & mask) == 0) 132 return; 133 td = curthread; 134 if (td->td_inktr) 135 return; |
136 savecrit = critical_enter(); | 136 savecrit = cpu_critical_enter(); |
137 if (((1 << KTR_CPU) & ktr_cpumask) == 0) { | 137 if (((1 << KTR_CPU) & ktr_cpumask) == 0) { |
138 critical_exit(savecrit); | 138 cpu_critical_exit(savecrit); |
139 return; 140 } 141 td->td_inktr++; 142 do { 143 saveindex = ktr_idx; 144 newindex = (saveindex + 1) & (KTR_ENTRIES - 1); 145 } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); 146 entry = &ktr_buf[saveindex]; 147 entry->ktr_cpu = KTR_CPU; | 139 return; 140 } 141 td->td_inktr++; 142 do { 143 saveindex = ktr_idx; 144 newindex = (saveindex + 1) & (KTR_ENTRIES - 1); 145 } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); 146 entry = &ktr_buf[saveindex]; 147 entry->ktr_cpu = KTR_CPU; |
148 critical_exit(savecrit); | 148 cpu_critical_exit(savecrit); |
149 nanotime(&entry->ktr_tv); 150#ifdef KTR_EXTEND 151 entry->ktr_filename = filename; 152 entry->ktr_line = line; 153 va_start(ap, format); 154 vsnprintf(entry->ktr_desc, KTRDESCSIZE, format, ap); 155 va_end(ap); 156 if (ktr_verbose) { --- 112 unchanged lines hidden --- | 149 nanotime(&entry->ktr_tv); 150#ifdef KTR_EXTEND 151 entry->ktr_filename = filename; 152 entry->ktr_line = line; 153 va_start(ap, format); 154 vsnprintf(entry->ktr_desc, KTRDESCSIZE, format, ap); 155 va_end(ap); 156 if (ktr_verbose) { --- 112 unchanged lines hidden --- |