| 232 | } |
| 233 | |
| 234 | static inline void |
| 235 | epoch_trace_exit(struct thread *td, epoch_t epoch, epoch_tracker_t et, |
| 236 | const char *file, int line) |
| 237 | { |
| 238 | |
| 239 | if (SLIST_FIRST(&td->td_epochs) != et) { |
| 240 | epoch_trace_report("Exiting epoch %s in a not nested order " |
| 241 | "at %s:%d. Most recently entered %s at %s:%d\n", |
| 242 | epoch->e_name, |
| 243 | file, line, |
| 244 | SLIST_FIRST(&td->td_epochs)->et_epoch->e_name, |
| 245 | SLIST_FIRST(&td->td_epochs)->et_file, |
| 246 | SLIST_FIRST(&td->td_epochs)->et_line); |
| 247 | /* This will panic if et is not anywhere on td_epochs. */ |
| 248 | SLIST_REMOVE(&td->td_epochs, et, epoch_tracker, et_tlink); |
| 249 | } else |
| 250 | SLIST_REMOVE_HEAD(&td->td_epochs, et_tlink); |
| 251 | } |
| 252 | |
| 253 | /* Used by assertions that check thread state before going to sleep. */ |
| 254 | void |
no test coverage detected