Print this page
13178 ::msgbuf could see more than 8KB of logs
Reviewed by: Andy Fiddaman <Andy@omniosce.org>
Reviewed by: Toomas Soome <tsoome@me.com>


 199         /*
 200          * Create a backlog queue to consume console messages during periods
 201          * when there is no console reader (e.g. before syslogd(1M) starts).
 202          */
 203         log_backlogq = log_consq = log_makeq(0, LOG_HIWAT, NULL);
 204 
 205         /*
 206          * Create a queue to hold free message of size <= LOG_MSGSIZE.
 207          * Calls from high-level interrupt handlers will do a getq_noenab()
 208          * from this queue, so its q_lock must be a maximum SPL spin lock.
 209          */
 210         log_freeq = log_makeq(LOG_MINFREE, LOG_MAXFREE, (void *)ipltospl(SPL8));
 211 
 212         /*
 213          * Create a queue for messages from high-level interrupt context.
 214          * These messages are drained via softcall, or explicitly by panic().
 215          */
 216         log_intrq = log_makeq(0, LOG_HIWAT, (void *)ipltospl(SPL8));
 217 
 218         /*
 219          * Create a queue to hold the most recent 8K of console messages.
 220          * Useful for debugging.  Required by the "$<msgbuf" adb macro.
 221          */
 222         log_recentq = log_makeq(0, LOG_RECENTSIZE, NULL);
 223 
 224         /*
 225          * Create an id space for clone devices opened via /dev/log.
 226          * Need to limit the number of zones to avoid exceeding the
 227          * available minor number space.
 228          */
 229         log_maxzones = (L_MAXMIN32 - LOG_LOGMIN) / LOG_NUMCLONES - 1;
 230         if (log_maxzones < maxzones)
 231                 maxzones = log_maxzones;
 232         log_minorspace = id_space_create("logminor_space", LOG_LOGMIN + 1,
 233             L_MAXMIN32);
 234         /*
 235          * Put ourselves on the ZSD list.  Note that zones have not been
 236          * initialized yet, but our constructor will be called on the global
 237          * zone when they are.
 238          */
 239         zone_key_create(&log_zone_key, log_zoneinit, NULL, log_zonefree);




 199         /*
 200          * Create a backlog queue to consume console messages during periods
 201          * when there is no console reader (e.g. before syslogd(1M) starts).
 202          */
 203         log_backlogq = log_consq = log_makeq(0, LOG_HIWAT, NULL);
 204 
 205         /*
 206          * Create a queue to hold free message of size <= LOG_MSGSIZE.
 207          * Calls from high-level interrupt handlers will do a getq_noenab()
 208          * from this queue, so its q_lock must be a maximum SPL spin lock.
 209          */
 210         log_freeq = log_makeq(LOG_MINFREE, LOG_MAXFREE, (void *)ipltospl(SPL8));
 211 
 212         /*
 213          * Create a queue for messages from high-level interrupt context.
 214          * These messages are drained via softcall, or explicitly by panic().
 215          */
 216         log_intrq = log_makeq(0, LOG_HIWAT, (void *)ipltospl(SPL8));
 217 
 218         /*
 219          * Create a queue to hold the most recent 64K of console messages.
 220          * Useful for debugging.  Required by the "$<msgbuf" adb macro.
 221          */
 222         log_recentq = log_makeq(0, LOG_RECENTSIZE, NULL);
 223 
 224         /*
 225          * Create an id space for clone devices opened via /dev/log.
 226          * Need to limit the number of zones to avoid exceeding the
 227          * available minor number space.
 228          */
 229         log_maxzones = (L_MAXMIN32 - LOG_LOGMIN) / LOG_NUMCLONES - 1;
 230         if (log_maxzones < maxzones)
 231                 maxzones = log_maxzones;
 232         log_minorspace = id_space_create("logminor_space", LOG_LOGMIN + 1,
 233             L_MAXMIN32);
 234         /*
 235          * Put ourselves on the ZSD list.  Note that zones have not been
 236          * initialized yet, but our constructor will be called on the global
 237          * zone when they are.
 238          */
 239         zone_key_create(&log_zone_key, log_zoneinit, NULL, log_zonefree);