解决android系统唤醒时间偏长------healthd里的一些调用
2016-05-31 18:12
344 查看
目前定位到healthd的调用过程耗时太长,于是去看看power相关的一些东西
healthd里一共调用了如下的节点获取数据
openat(AT_FDCWD, "/sys/class/power_supply/battery/present", 1 *******
openat(AT_FDCWD, "/sys/class/power_supply/battery/capacity",100 *****
openat(AT_FDCWD, "/sys/class/power_supply/battery/voltage_now", 4389402 ********
openat(AT_FDCWD, "/sys/class/power_supply/battery/temp", 291 ********
openat(AT_FDCWD, "/sys/class/power_supply/battery/status", Full
到kernel里找节点
Power_supply_sysfs.c里
static struct device_attribute power_supply_attrs[] = {
/* Properties of type `int' */
POWER_SUPPLY_ATTR(status),
看看#define POWER_SUPPLY_ATTR(_name) \
{ \
.attr = { .name = #_name },
\
.show = power_supply_show_property,
\
.store = power_supply_store_property,
\
}
然后看static ssize_t power_supply_show_property(struct device *dev,
struct device_attribute *attr,
char *buf)
这个里面调用了
if (off == POWER_SUPPLY_PROP_TYPE)
value.intval = psy->type;
else
ret = psy->get_property(psy, off, &value);
这个get_property需要在qpnp-vm-bms.c
static int qpnp_vm_bms_power_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
switch (psp) {
case POWER_SUPPLY_PROP_CHARGE_NOW:
val->intval = get_remaining_usable_capacity(chip);
break;
}
这些的case都在power_supply.h
enum power_supply_property {
/* Properties of type `int' */
POWER_SUPPLY_PROP_STATUS = 0,
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_ONLINE,
POWER_SUPPLY_PROP_AUTHENTIC,
POWER_SUPPLY_PROP_CHARGING_ENABLED,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_VOLTAGE_MIN,
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
POWER_SUPPLY_PROP_VOLTAGE_OCV,
POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION,
POWER_SUPPLY_PROP_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM,
POWER_SUPPLY_PROP_INPUT_CURRENT_SETTLED,
POWER_SUPPLY_PROP_VCHG_LOOP_DBC_BYPASS,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_POWER_NOW,
POWER_SUPPLY_PROP_POWER_AVG,
如果找其中的一个比如POWER_SUPPLY_PROP_ONLINE
在kernel里搜索后只有在这几个文件里Qpnp-linear-charger.c 或者Smb358-charger.c 或者qpnp-vm-bms.c里找对应的
healthd里一共调用了如下的节点获取数据
openat(AT_FDCWD, "/sys/class/power_supply/battery/present", 1 *******
openat(AT_FDCWD, "/sys/class/power_supply/battery/capacity",100 *****
openat(AT_FDCWD, "/sys/class/power_supply/battery/voltage_now", 4389402 ********
openat(AT_FDCWD, "/sys/class/power_supply/battery/temp", 291 ********
openat(AT_FDCWD, "/sys/class/power_supply/battery/status", Full
到kernel里找节点
Power_supply_sysfs.c里
static struct device_attribute power_supply_attrs[] = {
/* Properties of type `int' */
POWER_SUPPLY_ATTR(status),
看看#define POWER_SUPPLY_ATTR(_name) \
{ \
.attr = { .name = #_name },
\
.show = power_supply_show_property,
\
.store = power_supply_store_property,
\
}
然后看static ssize_t power_supply_show_property(struct device *dev,
struct device_attribute *attr,
char *buf)
这个里面调用了
if (off == POWER_SUPPLY_PROP_TYPE)
value.intval = psy->type;
else
ret = psy->get_property(psy, off, &value);
这个get_property需要在qpnp-vm-bms.c
static int qpnp_vm_bms_power_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
switch (psp) {
case POWER_SUPPLY_PROP_CHARGE_NOW:
val->intval = get_remaining_usable_capacity(chip);
break;
}
这些的case都在power_supply.h
enum power_supply_property {
/* Properties of type `int' */
POWER_SUPPLY_PROP_STATUS = 0,
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_ONLINE,
POWER_SUPPLY_PROP_AUTHENTIC,
POWER_SUPPLY_PROP_CHARGING_ENABLED,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_VOLTAGE_MIN,
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
POWER_SUPPLY_PROP_VOLTAGE_OCV,
POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION,
POWER_SUPPLY_PROP_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM,
POWER_SUPPLY_PROP_INPUT_CURRENT_SETTLED,
POWER_SUPPLY_PROP_VCHG_LOOP_DBC_BYPASS,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_POWER_NOW,
POWER_SUPPLY_PROP_POWER_AVG,
如果找其中的一个比如POWER_SUPPLY_PROP_ONLINE
在kernel里搜索后只有在这几个文件里Qpnp-linear-charger.c 或者Smb358-charger.c 或者qpnp-vm-bms.c里找对应的
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件
- SourceProvider.getJniDirectories