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

[复制链接]
 楼主| 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的设备。
  1. /**
  2. * struct wakeup_source - Representation of wakeup sources
  3. *
  4. * @total_time: Total time this wakeup source has been active.
  5. * @max_time: Maximum time this wakeup source has been continuously active.
  6. * @last_time: Monotonic clock when the wakeup source's was touched last time.
  7. * @prevent_sleep_time: Total time this source has been preventing autosleep.
  8. * @event_count: Number of signaled wakeup events.
  9. * @active_count: Number of times the wakeup source was activated.
  10. * @relax_count: Number of times the wakeup source was deactivated.
  11. * @expire_count: Number of times the wakeup source's timeout has expired.
  12. * @wakeup_count: Number of times the wakeup source might abort suspend.
  13. * @active: Status of the wakeup source.
  14. * @has_timeout: The wakeup source has been activated with a timeout.
  15. */
  16. struct wakeup_source {
  17.         const char                 *name;
  18.         struct list_head        entry;
  19.         spinlock_t                lock;
  20.         struct timer_list        timer;
  21.         unsigned long                timer_expires;
  22.         ktime_t total_time;
  23.         ktime_t max_time;
  24.         ktime_t last_time;
  25.         ktime_t start_prevent_time;
  26.         ktime_t prevent_sleep_time;
  27.         unsigned long                event_count;
  28.         unsigned long                active_count;
  29.         unsigned long                relax_count;
  30.         unsigned long                expire_count;
  31.         unsigned long                wakeup_count;
  32.         bool                        active:1;
  33.         bool                        autosleep_enabled:1;
  34. };

.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

1478

主题

12917

帖子

55

粉丝
快速回复 在线客服 返回列表 返回顶部
个人签名:qq群:49734243 Email:zukeqiang@gmail.com

1478

主题

12917

帖子

55

粉丝
快速回复 在线客服 返回列表 返回顶部