Save the line number and filename of the last mtx_enter operation for

spin locks.  We already do this for sleep locks.
This commit is contained in:
John Baldwin 2000-11-29 18:37:01 +00:00
parent e2979dcc85
commit bbc7a98a31
3 changed files with 24 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}