Until now KTR_ENTRIES, which defines the size of circular buffer used in
ktr(4), was constrained to be a power of two. Remove this constraint and update sys/conf/NOTES accordingly. Reviewed by: jhb Approved by: gnn (mentor) Sponsored by: Google Summer of Code 2012
This commit is contained in:
parent
82b89f4850
commit
6e465ac7ce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238925
@ -435,7 +435,7 @@ options KTRACE_REQUEST_POOL=101
|
||||
#
|
||||
# KTR is a kernel tracing facility imported from BSD/OS. It is
|
||||
# enabled with the KTR option. KTR_ENTRIES defines the number of
|
||||
# entries in the circular trace buffer; it must be a power of two.
|
||||
# entries in the circular trace buffer; it may be an arbitrary number.
|
||||
# KTR_COMPILE defines the mask of events to compile into the kernel as
|
||||
# defined by the KTR_* constants in <sys/ktr.h>. KTR_MASK defines the
|
||||
# initial value of the ktr_mask variable which determines at runtime
|
||||
|
@ -283,7 +283,7 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format,
|
||||
{
|
||||
do {
|
||||
saveindex = ktr_idx;
|
||||
newindex = (saveindex + 1) & (KTR_ENTRIES - 1);
|
||||
newindex = (saveindex + 1) % KTR_ENTRIES;
|
||||
} while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0);
|
||||
entry = &ktr_buf[saveindex];
|
||||
}
|
||||
@ -338,7 +338,7 @@ static int db_mach_vtrace(void);
|
||||
DB_SHOW_COMMAND(ktr, db_ktr_all)
|
||||
{
|
||||
|
||||
tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1);
|
||||
tstate.cur = (ktr_idx - 1) % KTR_ENTRIES;
|
||||
tstate.first = -1;
|
||||
db_ktr_verbose = 0;
|
||||
db_ktr_verbose |= (strchr(modif, 'v') != NULL) ? 2 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user