Skip to content

Commit c5773d3

Browse files
committed
ktr: Make debug.ktr.verbose available whenever KTR is configured
This is more useful and matches the documentation. While here, make it settable as a tunable and add a sysctl description. PR: 139425 MFC after: 2 weeks
1 parent d35c4cf commit c5773d3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sys/kern/kern_ktr.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,12 @@ SYSCTL_PROC(_debug_ktr, OID_AUTO, entries,
251251

252252
#ifdef KTR_VERBOSE
253253
int ktr_verbose = KTR_VERBOSE;
254-
TUNABLE_INT("debug.ktr.verbose", &ktr_verbose);
255-
SYSCTL_INT(_debug_ktr, OID_AUTO, verbose, CTLFLAG_RW, &ktr_verbose, 0, "");
254+
#else
255+
int ktr_verbose = 0;
256256
#endif
257+
TUNABLE_INT("debug.ktr.verbose", &ktr_verbose);
258+
SYSCTL_INT(_debug_ktr, OID_AUTO, verbose, CTLFLAG_RWTUN, &ktr_verbose, 0,
259+
"Print extra info when logging to the console");
257260

258261
#ifdef KTR_ALQ
259262
struct alq *ktr_alq;
@@ -375,7 +378,6 @@ ktr_tracepoint(uint64_t mask, const char *file, int line, const char *format,
375378
file += 3;
376379
entry->ktr_file = file;
377380
entry->ktr_line = line;
378-
#ifdef KTR_VERBOSE
379381
if (ktr_verbose) {
380382
#ifdef SMP
381383
printf("cpu%d ", cpu);
@@ -387,7 +389,6 @@ ktr_tracepoint(uint64_t mask, const char *file, int line, const char *format,
387389
printf(format, arg1, arg2, arg3, arg4, arg5, arg6);
388390
printf("\n");
389391
}
390-
#endif
391392
entry->ktr_desc = format;
392393
entry->ktr_parms[0] = arg1;
393394
entry->ktr_parms[1] = arg2;

0 commit comments

Comments
 (0)