[COMMON] lib: dss: add spinlock logging
authorHosung Kim <hosung0.kim@samsung.com>
Mon, 22 May 2017 14:19:55 +0000 (23:19 +0900)
committerYoungmin Nam <youngmin.nam@samsung.com>
Fri, 29 Jun 2018 09:17:50 +0000 (18:17 +0900)
Change-Id: Iba4a6b003f5ab9af4d020d30131bb701d503807e
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
include/linux/spinlock_api_smp.h

index 42dfab89e740aeb08de1896e491607789eacda4b..edcc2330db1097276c35c3934da099bb01a36284 100644 (file)
@@ -107,6 +107,7 @@ static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
 
        local_irq_save(flags);
        preempt_disable();
+       dbg_snapshot_spinlock(lock, 1);
        spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        /*
         * On lockdep we dont want the hand-coded irq-enable of
@@ -118,6 +119,7 @@ static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
 #else
        do_raw_spin_lock_flags(lock, &flags);
 #endif
+       dbg_snapshot_spinlock(lock, 2);
        return flags;
 }
 
@@ -125,8 +127,10 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock)
 {
        local_irq_disable();
        preempt_disable();
+       dbg_snapshot_spinlock(lock, 1);
        spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
+       dbg_snapshot_spinlock(lock, 2);
 }
 
 static inline void __raw_spin_lock_bh(raw_spinlock_t *lock)
@@ -139,8 +143,10 @@ static inline void __raw_spin_lock_bh(raw_spinlock_t *lock)
 static inline void __raw_spin_lock(raw_spinlock_t *lock)
 {
        preempt_disable();
+       dbg_snapshot_spinlock(lock, 1);
        spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
+       dbg_snapshot_spinlock(lock, 2);
 }
 
 #endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */
@@ -149,6 +155,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
 {
        spin_release(&lock->dep_map, 1, _RET_IP_);
        do_raw_spin_unlock(lock);
+       dbg_snapshot_spinlock(lock, 3);
        preempt_enable();
 }
 
@@ -157,6 +164,7 @@ static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
 {
        spin_release(&lock->dep_map, 1, _RET_IP_);
        do_raw_spin_unlock(lock);
+       dbg_snapshot_spinlock(lock, 3);
        local_irq_restore(flags);
        preempt_enable();
 }
@@ -165,6 +173,7 @@ static inline void __raw_spin_unlock_irq(raw_spinlock_t *lock)
 {
        spin_release(&lock->dep_map, 1, _RET_IP_);
        do_raw_spin_unlock(lock);
+       dbg_snapshot_spinlock(lock, 3);
        local_irq_enable();
        preempt_enable();
 }