summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-11-29 18:37:01 +0000
committerjhb <jhb@FreeBSD.org>2000-11-29 18:37:01 +0000
commit35b8911585c3fe418def486b03f35edcafb08529 (patch)
treebeba107fc5ad6c61e3c35f1d4f724808426fb05f /sys
parent896b5da5191ff4114d68d09f418bf72a8bddc52d (diff)
downloadFreeBSD-src-35b8911585c3fe418def486b03f35edcafb08529.zip
FreeBSD-src-35b8911585c3fe418def486b03f35edcafb08529.tar.gz
Save the line number and filename of the last mtx_enter operation for
spin locks. We already do this for sleep locks.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_mutex.c8
-rw-r--r--sys/kern/subr_turnstile.c8
-rw-r--r--sys/kern/subr_witness.c8
3 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index e66e6f8..37ddc8f 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -791,6 +791,10 @@ witness_enter(struct mtx *m, int flags, const char *file, int line)
}
PCPU_SET(witness_spin_check, i | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
if (w->w_spin)
@@ -942,6 +946,10 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line)
mtx_enter(&w_mtx, MTX_SPIN);
PCPU_SET(witness_spin_check, witness_spin_check | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index e66e6f8..37ddc8f 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -791,6 +791,10 @@ witness_enter(struct mtx *m, int flags, const char *file, int line)
}
PCPU_SET(witness_spin_check, i | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
if (w->w_spin)
@@ -942,6 +946,10 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line)
mtx_enter(&w_mtx, MTX_SPIN);
PCPU_SET(witness_spin_check, witness_spin_check | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index e66e6f8..37ddc8f 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -791,6 +791,10 @@ witness_enter(struct mtx *m, int flags, const char *file, int line)
}
PCPU_SET(witness_spin_check, i | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
if (w->w_spin)
@@ -942,6 +946,10 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line)
mtx_enter(&w_mtx, MTX_SPIN);
PCPU_SET(witness_spin_check, witness_spin_check | w->w_level);
mtx_exit(&w_mtx, MTX_SPIN);
+ w->w_file = file;
+ w->w_line = line;
+ m->mtx_line = line;
+ m->mtx_file = file;
return;
}
OpenPOWER on IntegriCloud