为什么wakeup_sources里有active_since属性不等于0的项时不休眠

[复制链接]
604|1
手机看帖
扫描二维码
随时随地手机跟帖
keer_zu|  楼主 | 2020-4-2 11:11 | 显示全部楼层 |阅读模式
本帖最后由 keer_zu 于 2020-4-2 11:15 编辑

为什么/sys/kernel/debug/wakeup_sources下面有active_since属性不等于0的项时系统不休眠




wakeup events framework代码在:  /kernel/drivers/base/power/wakeup.c中实现。在wakeup events framework中重要的数据结构就是wakeup_source,字面意思就是产生wakeup events的设备。
/**
* struct wakeup_source - Representation of wakeup sources
*
* @total_time: Total time this wakeup source has been active.
* @max_time: Maximum time this wakeup source has been continuously active.
* @last_time: Monotonic clock when the wakeup source's was touched last time.
* @prevent_sleep_time: Total time this source has been preventing autosleep.
* @event_count: Number of signaled wakeup events.
* @active_count: Number of times the wakeup source was activated.
* @relax_count: Number of times the wakeup source was deactivated.
* @expire_count: Number of times the wakeup source's timeout has expired.
* @wakeup_count: Number of times the wakeup source might abort suspend.
* @active: Status of the wakeup source.
* @has_timeout: The wakeup source has been activated with a timeout.
*/
struct wakeup_source {
        const char                 *name;
        struct list_head        entry;
        spinlock_t                lock;
        struct timer_list        timer;
        unsigned long                timer_expires;
        ktime_t total_time;
        ktime_t max_time;
        ktime_t last_time;
        ktime_t start_prevent_time;
        ktime_t prevent_sleep_time;
        unsigned long                event_count;
        unsigned long                active_count;
        unsigned long                relax_count;
        unsigned long                expire_count;
        unsigned long                wakeup_count;
        bool                        active:1;
        bool                        autosleep_enabled:1;
};

.name:    唤醒源的名字。
.entry:     用来将唤醒源挂到链表上,用于管理。
.lock:       同步机制,用于访问链表时使用。
.timer:     定时器,用于设置该唤醒源的超时时间。
.timer_expires:  定时器的超时时间。
.total_time:  wakeup source处于active状态的总时间。
.max_time:  wakeup source处于active状态的最长时间。
.last_time:   wakeup source处于active状态的上次时间。
.start_prevent_time:   wakeup source阻止autosleep的开始时间。
.prevent_sleep_time:  wakeup source阻止autosleep的总时间。
.event_count:  wakeup source上报wakeup event的个数。
.active_count: wakeup source处于active状态的次数。
.relax_count:  wakeup source处于deactive状态的次数。
.expire_count:  wakeup source timeout次数。
.wakeup_count:  wakeup source abort睡眠的次数。
.active:  wakeup source的状态。
.autosleep_enabled:  autosleep使能的状态。


使用特权

评论回复

相关帖子

keer_zu|  楼主 | 2020-4-2 11:17 | 显示全部楼层
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:qq群:49734243 Email:zukeqiang@gmail.com

1304

主题

12233

帖子

53

粉丝