#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,
+DECLARE_EVENT_CLASS(wake_lock_template,
TP_PROTO(struct wake_lock *lock),
TP_ARGS(lock),
TP_STRUCT__entry(
- __field( void *, lock )
+ __string(name, lock->name)
+ __field(unsigned long, expires)
+ __field(int, flags)
),
TP_fast_assign(
- __entry->lock = lock;
+ __assign_str(name, lock->name);
+ __entry->expires = lock->expires;
+ __entry->flags = lock->flags;
),
- TP_printk("timer=%p", __entry->lock)
+ TP_printk("name=%s, flags=%d, expires=%lu",
+ __get_str(name),
+ __entry->flags,
+ __entry->expires)
);
-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)
-);
+DEFINE_EVENT(wake_lock_template, wake_lock,
+ TP_PROTO(struct wake_lock *lock),
+ TP_ARGS(lock));
+DEFINE_EVENT(wake_lock_template, wake_unlock,
+ TP_PROTO(struct wake_lock *lock),
+ TP_ARGS(lock));
#endif /* _TRACE_WAKELOCK_H */
queue_work(suspend_work_queue, &suspend_work);
}
}
+ trace_wake_lock(lock);
spin_unlock_irqrestore(&list_lock, irqflags);
}
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);
+ trace_wake_unlock(lock);
type = lock->flags & WAKE_LOCK_TYPE_MASK;
#ifdef CONFIG_WAKELOCK_STAT
wake_unlock_stat_locked(lock, 0);