赞
踩
展讯平台功耗调试记录
1、查看应用持有锁:dumpsys power | grep LOCK
2、查看内核持有锁:cat /d/wakeup_sources
休眠后查看唤醒源:串口 log 打印 Wake up by xx,xx 为一级唤醒源
static void sprd_pm_print_wakeup_source(struct power_debug *pdebug_entry)
{
...
for (j = 0; j < BIT_NUM_IN_PER_REG; j++) {
if (reg_value & BIT(j)) {
log_wakeup_reason(i * BIT_NUM_IN_PER_REG + j);
pr_info("#--Wake up by %d(%s_%s)!\n",
i * BIT_NUM_IN_PER_REG + j, "INT_APCPU",
pintc_info->pint_name[j]);
}
}
...
}
具体是那个中断判断函数是在
static irqreturn_t regmap_irq_thread(int irq, void *d)
{
for (i = 0; i < chip->num_irqs; i++) {
306 if (data->status_buf[chip->irqs[i].reg_offset /
307 map->reg_stride] & chip->irqs[i].mask) {
如下就知道是那个2级
308 handle_nested_irq(irq_find_mapping(data->domain, i));
309 handled = true;
310 }
311 }
}
因为为了系统性能,不建议在中断里加打印 , pmic gpio 和ap gpio 中断代码里都有打印,只是打印等级低pr_debug ,打不出
static irqreturn_t regmap_irq_thread(int irq, void *d)
{
for (i = 0; i < chip->num_irqs; i++) {
306 if (data->status_buf[chip->irqs[i].reg_offset /
307 map->reg_stride] & chip->irqs[i].mask) {
//如下就知道是那个2级 【log_wakeup_reason(irq_find_mapping(data->domain, i));】
308 handle_nested_irq(irq_find_mapping(data->domain, i));
309 handled = true;
310 }
311 }
查看RTC 唤醒源 AlarmManagerService 中打开调试信息
1、 static final boolean DEBUG_SPRD_ALARM = true;
2、关闭modemlog
alarm.type = 2或者0是唤醒
019A3 <6> [ 190.279566][08-31 15:38:29.279] Resume caused by IRQ 38
019A4 <6> [ 190.279566][08-31 15:38:29.279] sprd-powerdebug power-debug: #--Wake up by 38(INT_APCPU_ANA)!
019A5 <0> [ 280.050737][08-31 15:39:59.050] sc27xx-pmic spi4.0: regmap_irq_thread:PMIC INTC status: 0x2
019A6 <3> [ 280.050746][08-31 15:39:59.050] sprd_rtc_handler: RTC ***********
S005FDD 08-31 15:40:01.652 967 1152 D AlarmManager: sending alarm.type = 2, action = com.google.android.gms.gcm.ACTION_CHECK_QUEUE, cn = ComponentInfo{com.google.android.gms/com.google.android.gms.gcm.nts.SchedulerInternalReceiver}, operation = PendingIntent{ea61381: PendingIntentRecord{5cfa9d3 com.google.android.gms broadcastIntent}}
S005FE1 08-31 15:40:01.658 967 1152 D AlarmManager: sending alarm.type = 2, action = com.google.android.intent.action.GCM_RECONNECT, cn = null, operation = PendingIntent{4e07c70: PendingIntentRecord{620dc68 com.google.android.gms broadcastIntent}}
S005FDD 08-31 15:40:01.652 967 1152 D AlarmManager: sending alarm.type = 2, action = com.google.android.gms.gcm.ACTION_CHECK_QUEUE, cn = ComponentInfo{com.google.android.gms/com.google.android.gms.gcm.nts.SchedulerInternalReceiver}, operation = PendingIntent{ea61381: PendingIntentRecord{5cfa9d3 com.google.android.gms broadcastIntent}}
S005FE1 08-31 15:40:01.658 967 1152 D AlarmManager: sending alarm.type = 2, action = com.google.android.intent.action.GCM_RECONNECT, cn = null, operation = PendingIntent{4e07c70: PendingIntentRecord{620dc68 com.google.android.gms broadcastIntent}}
上述是RTC 唤醒,对应是google service,和healthd (这两个alarm重叠,一块唤醒)
01A96 <6> [ 282.409547][08-31 15:40:01.409] sprd-powerdebug power-debug: #--Wake up by 38(INT_APCPU_ANA)!
01A97 <0> [ 312.050588][08-31 15:40:31.050] sc27xx-pmic spi4.0: regmap_irq_thread:PMIC INTC status: 0x2
01A98 <3> [ 312.050598][08-31 15:40:31.050] sprd_rtc_handler: RTC ***********
S006023 08-31 15:40:32.785 967 1152 D AlarmManager: sending alarm.type = 2, action = null, cn = null, operation = null
上述是RTC 唤醒,对应是来自system server的scheduler job
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。