aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel_lock.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-15 08:49:32 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-15 08:49:32 -0800
commit7547a3e8a43d31aaf91c2daf5f597e43212ccddf (patch)
treeadd99b58ac3b490f6ede666b9dbf2333d87e24fa /lib/kernel_lock.c
parent0f5e182dff576e6f3cd9b805834f18d11f2882aa (diff)
parent3ea6b3d0e6d0ffd91c0f8cadeb69b7133c038b32 (diff)
downloadkernel_samsung_crespo-7547a3e8a43d31aaf91c2daf5f597e43212ccddf.zip
kernel_samsung_crespo-7547a3e8a43d31aaf91c2daf5f597e43212ccddf.tar.gz
kernel_samsung_crespo-7547a3e8a43d31aaf91c2daf5f597e43212ccddf.tar.bz2
Merge commit 'linus' into next
Diffstat (limited to 'lib/kernel_lock.c')
-rw-r--r--lib/kernel_lock.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/kernel_lock.c b/lib/kernel_lock.c
index 39f1029..5526b46 100644
--- a/lib/kernel_lock.c
+++ b/lib/kernel_lock.c
@@ -5,10 +5,13 @@
* relegated to obsolescence, but used by various less
* important (or lazy) subsystems.
*/
-#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/semaphore.h>
+#include <linux/smp_lock.h>
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/bkl.h>
/*
* The 'big kernel lock'
@@ -113,21 +116,28 @@ static inline void __unlock_kernel(void)
* This cannot happen asynchronously, so we only need to
* worry about other CPU's.
*/
-void __lockfunc lock_kernel(void)
+void __lockfunc _lock_kernel(const char *func, const char *file, int line)
{
- int depth = current->lock_depth+1;
- if (likely(!depth))
+ int depth = current->lock_depth + 1;
+
+ trace_lock_kernel(func, file, line);
+
+ if (likely(!depth)) {
+ might_sleep();
__lock_kernel();
+ }
current->lock_depth = depth;
}
-void __lockfunc unlock_kernel(void)
+void __lockfunc _unlock_kernel(const char *func, const char *file, int line)
{
BUG_ON(current->lock_depth < 0);
if (likely(--current->lock_depth < 0))
__unlock_kernel();
+
+ trace_unlock_kernel(func, file, line);
}
-EXPORT_SYMBOL(lock_kernel);
-EXPORT_SYMBOL(unlock_kernel);
+EXPORT_SYMBOL(_lock_kernel);
+EXPORT_SYMBOL(_unlock_kernel);