编译powerdebug源码

来源:互联网 发布:java论坛源码 编辑:程序博客网 时间:2024/06/04 01:24
# 编译powerdebug源码


# v0.1 2013.12.11 ***


# 简介:powerdebug是linaro自己做的一个关于功耗的调试工具。之前的版本是0.6.4,
               目前为止linaro网站上最新的版本是0.7.1


# 编译过程:
1. 下载powerdebug源代码:
     http://releases.linaro.org/13.09/components/power-management/powerdebug/


2. 直接make编译,发现没有libncurses库


3. 下载ncurses库的源代码, configure, make, make install得到编译好的库
    (1)  http://ftp.gnu.org/pub/gnu/ncurses/
    (2)  ./configure --prefix=/vm/***/development/powerdebug/ncurses
           --host=arm-linux --without-cxx
           export CC=arm-linux-gnueabi-gcc
           make
           make install
           注:--prefix 表明最后把编译好的库放到哪里, --host 表明库的运行在什么架构
                   的机器上,这里是在x86机器上编译放在arm机器上运行的库, --build(没有用
                   到) 表明是在什么机器上编译,这里是x86-linux,没有直接指出,编译的时候
                  会自动的检测到. --target(没有用到) 表明编译好的软件处理什么架构下的
                  程序, 一般用不到,在编译gcc源码的时候要用到


4. 改powerdebug的Makefile,在其中添加静态连接库的搜索路径
    (1) LDFLAGS=-L/vm/***/development/powerdebug/ncurses
    (2) $(CC) ${CFLAGS} $(OBJS) ${LDFLAGS} -lncurses -o powerdebug -v
    注:直接在Makefile中加入(1), 在(2)所在的行中加入${LDFLAGS}


5. make编译得到可在arm平台上运行的powerdebug, adb push到相应的平台上:
            到powerdebug路径下:make
            adb push powerdebug /


6. 修改arm平台上的终端配置:
     export TERM=xterm-256color
     export TERM=/system/etc/terminfo
     (注:export TERM=/system/etc/terminfo/x/xterm-256color,指定terminfo后面
              的具体内容后会出现Error opening terminal: xterm-256color.)


# 最终结果:
1. root@android:/ # /powerdebug                                                   
    failed to initialize clock details (check debugfs)


  linaro的网站上有人提出这是一个bug:
  https://bugs.launchpad.net/linaro-powerdebug/+bug/1229658


  但是没有做任何调整后(只是依照上面,查看了一下clk和gpio目录),clock竟然有
  了显示
  
1. clock栏的数据


  PowerDebug 0.7.1     Clocks  Regulators  Sensors  Gpio 
  Name                                Flags      Rate  Usecount   Children
  osc32khz                            0x30       32KHZ        0          1        
  0               0              0         
  osc26mhz                            0x30       26MHZ        0         15
  8               8              0
  apb_pclk                            0x30       26MHZ        0         29
  25              25             0
  armpll0                             0x30       1600MHZ      0          0
  0               0              0
  armpll1                             0x30       1600MHZ      0          0
  0               0              0
  armpll2                             0x30       1440MHZ      0         10
  4               4              0
  armpll3                             0x30       1440MHZ      0          1
  0               0              0
  armpll4                             0x30       1188MHZ      0          0
  0               0              0
  armpll5                             0x30       1300MHZ      0          0
  0               0              0
  14mhz                               0x30       14MHZ        0          0
  0               0              0
  orphans                             0x0        0            0          2
  


2. Regulators栏数据


PowerDebug 0.7.1     Clocks  Regulators  Sensors  Gpio 
Name        Status      State       Type        UsersMicrovolts  Min u-vo
regulator-dummy                         voltage     0       0           0   
0           
LDO0                    enabled     voltage     1           2850000     2850000
2850000     
008G4B                              MMC         0           0           0
0
LDO1                    enabled     voltage     0           1800000     1700000
2000000
LDO2                    enabled     voltage     0           1150000     1050000
1400000
LDO3                    enabled     voltage     0           1250000     1050000
1400000
LDO4                    enabled     voltage     0           2500000     1500000
3000000
LDO5                    enabled     voltage     0           2700000     1500000
3000000
008G4B                              MMC         0           0           0
0
LDO6                    enabled     voltage     0           2700000     1500000
3000000
ts-mxt224e                                      0           0           0









0 0
原创粉丝点击