summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-13 05:41:46 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-13 05:41:46 +0000
commitec9503cd0475c67b81826cc55a0dea1cf8f81775 (patch)
treefaa5c9764e0735ad055fed3a6440173e14455120 /sys/sys
parent3434de5c13263fd8a5698f3c7a01796478e4032a (diff)
downloadFreeBSD-src-ec9503cd0475c67b81826cc55a0dea1cf8f81775.zip
FreeBSD-src-ec9503cd0475c67b81826cc55a0dea1cf8f81775.tar.gz
track lock class name in a way that doesn't break WITNESS
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_lock.h11
-rw-r--r--sys/sys/lock.h1
-rw-r--r--sys/sys/lock_profile.h5
3 files changed, 10 insertions, 7 deletions
diff --git a/sys/sys/_lock.h b/sys/sys/_lock.h
index 2255349..cc1ea0a 100644
--- a/sys/sys/_lock.h
+++ b/sys/sys/_lock.h
@@ -36,11 +36,12 @@ struct lock_profile_object {
* This does not result in variant structure sizes because
* MUTEX_PROFILING is in opt_global.h
*/
- u_int64_t lpo_acqtime;
- u_int64_t lpo_waittime;
- const char *lpo_filename;
- u_int lpo_namehash;
- int lpo_lineno;
+ u_int64_t lpo_acqtime;
+ u_int64_t lpo_waittime;
+ const char *lpo_filename;
+ u_int lpo_namehash;
+ int lpo_lineno;
+ const char *lpo_type;
/*
* Fields relating to measuring contention on mutexes.
* holding must be accessed atomically since it's
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 9ca9376..29cdc76 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -213,6 +213,7 @@ extern struct lock_class lock_class_mtx_sleep;
extern struct lock_class lock_class_mtx_spin;
extern struct lock_class lock_class_sx;
extern struct lock_class lock_class_rw;
+extern struct lock_class lock_class_lockmgr;
extern struct lock_class *lock_classes[];
diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h
index c3a38a4..5a6465c 100644
--- a/sys/sys/lock_profile.h
+++ b/sys/sys/lock_profile.h
@@ -91,7 +91,7 @@ static inline void lock_profile_init(void)
}
}
-static inline void lock_profile_object_init(struct lock_object *lo, const char *name) {
+static inline void lock_profile_object_init(struct lock_object *lo, struct lock_class *class, const char *name) {
const char *p;
u_int hash = 0;
struct lock_profile_object *l = &lo->lo_profile_obj;
@@ -104,6 +104,7 @@ static inline void lock_profile_object_init(struct lock_object *lo, const char *
l->lpo_lineno = 0;
l->lpo_contest_holding = 0;
l->lpo_contest_locking = 0;
+ l->lpo_type = class->lc_name;
/* Hash the mutex name to an int so we don't have to strcmp() it repeatedly */
for (p = name; *p != '\0'; p++)
@@ -170,7 +171,7 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *
static inline void lock_profile_obtain_lock_success(struct lock_object *lo, uint64_t waittime,
const char *file, int line) {;}
static inline void lock_profile_object_destroy(struct lock_object *lo) {;}
-static inline void lock_profile_object_init(struct lock_object *lo, const char *name) {;}
+static inline void lock_profile_object_init(struct lock_object *lo, struct lock_class *class, const char *name) {;}
#endif /* !LOCK_PROFILING */
OpenPOWER on IntegriCloud