--- /dev/null
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM wakelock
+
+#if !defined(_TRACE_WAKELOCK_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_WAKELOCK_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+#include <linux/wakelock.h>
+
+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 <trace/define_trace.h>
#include <linux/suspend.h>
#include <linux/syscalls.h> /* sys_sync */
#include <linux/wakelock.h>
+
+#ifndef CREATE_TRACE_POINTS
+#define CREATE_TRACE_POINTS
+#include <trace/events/wakelock.h>
+#undef CREATE_TRACE_POINTS
+#endif
+
#ifdef CONFIG_WAKELOCK_STAT
#include <linux/proc_fs.h>
#endif
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);
{
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