aboutsummaryrefslogtreecommitdiff
path: root/coverity-model.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-12-20 13:16:23 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-20 22:15:36 -0600
commit76d9bcdca58936d761458f8f05960239c4dd8dec (patch)
treec8377b11be33e62d312810645b8044d3a6f427aa /coverity-model.c
parentca612b802adac0c72cd0f10c51a51275e5914101 (diff)
downloadskiboot-76d9bcdca58936d761458f8f05960239c4dd8dec.zip
skiboot-76d9bcdca58936d761458f8f05960239c4dd8dec.tar.gz
skiboot-76d9bcdca58936d761458f8f05960239c4dd8dec.tar.bz2
lock: Add additional lock auditing code
Keep track of lock owner name and replace lock_depth counter with a per-cpu list of locks held by the cpu. This allows us to print the actual locks held in case we hit the (in)famous message about opal_pollers being run with a lock held. It also allows us to warn (and drop them) if locks are still held when returning to the OS or completing a scheduled job. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix unit tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'coverity-model.c')
-rw-r--r--coverity-model.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coverity-model.c b/coverity-model.c
index b11f3bf..ca23751 100644
--- a/coverity-model.c
+++ b/coverity-model.c
@@ -10,7 +10,8 @@ void mem_free(struct mem_region *region, void *mem, const char *location) {
__coverity_free__(mem);
}
-void lock(struct lock *l) {
+void lock_caller(struct lock *l, const char *caller)
+{
__coverity_exclusive_lock_acquire__(l);
}