From 39a0fa94e5a3a723e2432a8e0ce07136df5d2dc0 Mon Sep 17 00:00:00 2001 From: Zhang Dongxing Date: Wed, 16 Nov 2011 14:08:23 +0800 Subject: [PATCH] [PORT FROM R2]POWERDK: Powerdk upgrade for enhancements for android wuwatch BZ: 17764 Powerdk upgrade for enancements for android wuwatch version 2.2.2 release. Signed-off-by: Zhang Dongxing Change-Id: I5a64d6068a28e70808f1c6b6cbef31ad73b640e7 Org-Change-Id: I5c1851bc119079e8b48cdaa6a3585c6d967b28b6 Reviewed-on: http://android.intel.com:8080/28038 Reviewed-by: Zhang, Dongxing Reviewed-by: Guerard, Christophe Tested-by: Zhang, Dongxing Reviewed-by: buildbot Tested-by: buildbot --- include/trace/events/wakelock.h | 48 +++++++++++++++++++++++++++++++++++++++++ kernel/power/wakelock.c | 14 ++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 include/trace/events/wakelock.h diff --git a/include/trace/events/wakelock.h b/include/trace/events/wakelock.h new file mode 100644 index 0000000..1e729c7 --- /dev/null +++ b/include/trace/events/wakelock.h @@ -0,0 +1,48 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM wakelock + +#if !defined(_TRACE_WAKELOCK_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_WAKELOCK_H + +#include +#include +#include + +TRACE_EVENT(wake_lock, + + TP_PROTO(struct wake_lock *lock), + + TP_ARGS(lock), + + TP_STRUCT__entry( + __field( void *, lock ) + ), + + TP_fast_assign( + __entry->lock = lock; + ), + + TP_printk("timer=%p", __entry->lock) +); + +TRACE_EVENT(wake_unlock, + + TP_PROTO(struct wake_lock *lock), + + TP_ARGS(lock), + + TP_STRUCT__entry( + __field( void *, lock ) + ), + + TP_fast_assign( + __entry->lock = lock; + ), + + TP_printk("timer=%p", __entry->lock) +); + +#endif /* _TRACE_WAKELOCK_H */ + +/* This part must be outside protection */ +#include diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 81e1b7c..d8aa156 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -19,6 +19,13 @@ #include #include /* sys_sync */ #include + +#ifndef CREATE_TRACE_POINTS +#define CREATE_TRACE_POINTS +#include +#undef CREATE_TRACE_POINTS +#endif + #ifdef CONFIG_WAKELOCK_STAT #include #endif @@ -490,12 +497,16 @@ static void wake_lock_internal( void wake_lock(struct wake_lock *lock) { wake_lock_internal(lock, 0, 0); + + trace_wake_lock(lock); } EXPORT_SYMBOL(wake_lock); void wake_lock_timeout(struct wake_lock *lock, long timeout) { wake_lock_internal(lock, timeout, 1); + + trace_wake_lock(lock); } EXPORT_SYMBOL(wake_lock_timeout); @@ -503,6 +514,9 @@ void wake_unlock(struct wake_lock *lock) { int type; unsigned long irqflags; + + trace_wake_unlock(lock); + spin_lock_irqsave(&list_lock, irqflags); type = lock->flags & WAKE_LOCK_TYPE_MASK; #ifdef CONFIG_WAKELOCK_STAT -- 2.7.4