kernel - Use unused thread_t field for lock tracker.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Sep 2015 00:49:13 +0000 (17:49 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Sep 2015 00:49:13 +0000 (17:49 -0700)
* Repurpose an unused struct thread field to add td_tracker.  Structure
  size does not change.  Used for debugging only.

sys/sys/thread.h

index c6fa86b..c5a201e 100644 (file)
@@ -280,7 +280,7 @@ struct thread {
     int                td_wakefromcpu; /* who woke me up? */
     int                td_upri;        /* user priority (sub-priority under td_pri) */
     int                td_type;        /* thread type, TD_TYPE_ */
-    int                td_unused02[1]; /* for future fields */
+    int                td_tracker;     /* for callers to debug lock counts */
     int                td_unused03[4]; /* for future fields */
     struct iosched_data td_iosdata;    /* Dynamic I/O scheduling data */
     struct timeval td_start;   /* start time for a thread/process */