Lines Matching defs:log

79 // The debug log maintains a circular buffer of debug log records,
81 // to 224 bytes of textual log message. Records are aligned on
96 // Tail indicates the oldest message in the debug log to read
97 // from, Head indicates the next space in the debug log to write
109 dlog_t* log = &DLOG;
115 if (log->panic) {
140 spin_lock_irqsave(&log->lock, state);
144 while ((log->head - log->tail) > (DLOG_SIZE - wiresize)) {
145 uint32_t header = *reinterpret_cast<uint32_t*>(log->data + (log->tail & DLOG_MASK));
146 log->tail += DLOG_HDR_GET_FIFOLEN(header);
149 size_t offset = (log->head & DLOG_MASK);
155 memcpy(log->data + offset, &hdr, sizeof(hdr));
156 memcpy(log->data + offset + sizeof(hdr), ptr, len);
159 memcpy(log->data + offset, &hdr, fifospace);
160 memcpy(log->data, reinterpret_cast<uint8_t*>(&hdr) + fifospace, sizeof(hdr) - fifospace);
161 memcpy(log->data + (sizeof(hdr) - fifospace), ptr, len);
164 memcpy(log->data + offset, &hdr, sizeof(hdr));
167 memcpy(log->data + offset, ptr, fifospace);
168 memcpy(log->data, ptr + fifospace, len - fifospace);
170 log->head += wiresize;
172 // Need to check this before re-releasing the log lock, since we may
184 spin_unlock_irqrestore(&log->lock, state);
186 [log, holding_thread_lock]() TA_NO_THREAD_SAFETY_ANALYSIS {
190 event_signal_thread_locked(&log->event);
192 event_signal(&log->event, false);
210 dlog_t* log = rdr->log;
214 spin_lock_irqsave(&log->lock, state);
218 // If the read-tail is not within the range of log-tail..log-head
220 // to the current log-tail.
222 if ((log->head - log->tail) < (log->head - rtail)) {
223 rtail = log->tail;
226 if (rtail != log->head) {
228 uint32_t header = *reinterpret_cast<uint32_t*>(log->data + offset);
234 memcpy(ptr, log->data + offset, actual);
236 memcpy(ptr, log->data + offset, fifospace);
237 memcpy(ptr + fifospace, log->data, actual - fifospace);
248 spin_unlock_irqrestore(&log->lock, state);
254 dlog_t* log = &DLOG;
256 rdr->log = log;
260 mutex_acquire(&log->readers_lock);
261 list_add_tail(&log->readers, &rdr->node);
266 spin_lock_irqsave(&log->lock, state);
267 rdr->tail = log->tail;
268 do_notify = (log->tail != log->head);
269 spin_unlock_irqrestore(&log->lock, state);
277 mutex_release(&log->readers_lock);
281 dlog_t* log = rdr->log;
283 mutex_acquire(&log->readers_lock);
285 mutex_release(&log->readers_lock);
290 // have one so they can process new log messages.
292 dlog_t* log = &DLOG;
298 event_wait(&log->event);
300 // notify readers that new log items were posted
301 mutex_acquire(&log->readers_lock);
303 list_for_every_entry (&log->readers, rdr, dlog_reader_t, node) {
308 mutex_release(&log->readers_lock);
342 // assembly buffer with room for log text plus header text
384 // if we're panicing, stop processing log writes
390 // replay debug log?
414 // responsible for passing log records to the dumper.