add packaging
[platform/upstream/powertop.git] / README
1 Building & Installing PowerTOP
2 ------------------------------
3
4 To build and install PowerTOP type the following commands, 
5         ./configure 
6         ./make
7         ./make install
8
9 Note: For Android (running Intel Architecture ) there is a Android.mk 
10 that was provided by community members, and at this time is supported
11  mostly by community members. 
12
13 Build dependencies
14 ------------------
15
16 PowerTOP uses C++, and expects g++ and libstdc++ to be functional 
17 along with a glibc/pthreadsi, autoconf, automake, and libtool in the 
18 development environment.
19  
20
21 in addition to that, PowerTOP requires the following components:
22
23 pciutils-devel (is only required if you have PCI) 
24 ncurses-devel  (required) 
25 libnl-devel    (required)
26 kernel version => 2.6.38
27
28 Kernel Parameters:
29 ------------------
30
31 PowerTOP needs some kernel config options enabled in order function properly.
32 As of linux-3.3.0 these are (list probably incomplete):
33
34 CONFIG_NO_HZ
35 CONFIG_HIGH_RES_TIMERS
36 CONFIG_HPET_TIMER
37 CONFIG_CPU_FREQ_GOV_ONDEMAND
38 CONFIG_USB_SUSPEND
39 CONFIG_SND_AC97_POWER_SAVE
40 CONFIG_TIMER_STATS
41 CONFIG_PERF_EVENTS
42 CONFIG_PERF_COUNTERS
43 CONFIG_TRACEPOINTS
44 CONFIG_TRACING
45 CONFIG_EVENT_POWER_TRACING_DEPRECATED
46 CONFIG_X86_MSR
47 ACPI_PROCFS_POWER
48 CONFIG_DEBUG_FS
49
50 The patches in the patches/ sub-directory are required for PowerTOP to function
51 fully.
52
53
54
55 Outputting a report
56 -------------------
57 When invoking PowerTOP without arguments, PowerTOP starts in interactive mode.
58 However, for reporting bugs etc there is a special reporting modes:
59
60 For an HTML formatted report simply execute PowerTOP with the following,  
61
62 powertop --html
63
64 which will create a "powertop.html" file which is static and can be sent to
65 others to help diagnose power issues. Additionally has the feature of showing 
66 the tunables executions withing the report as a reference. 
67
68 Note for the developers: If you make changes on the report format please
69 make sure that the output can be cleanly validated by the W3C Markup
70 Validation Service and W3C CSS Validation Service:
71  * http://validator.w3.org/#validate_by_upload
72  * http://jigsaw.w3.org/css-validator/#validate_by_upload
73
74 For a CSV formatted report, simply execute PowerTOP with the following, 
75
76 Powertop --csv 
77
78 which will create a “powertop.csv” file which is static and can be used in 
79 reporting, diagnoses, and analytical data analysis. 
80
81 Also you can set the number of iterations, and duration of test, in which case 
82 all reports will time stamp for you. 
83
84 Calibrating & Power Numbers
85 ---------------------------
86 PowerTOP will, when running on battery, track your power consumption as well
87 as your activity on the system. Once there are sufficient such measurements,
88 PowerTOP can start to report power estimates for various activities.
89 You can help get this estimation more accurate by running a calibration
90 cycle:
91
92 powertop --calibrate
93
94 at least once; this will cycle through various display brightness levels
95 (including "off") as well as USB device activities and some other workloads.
96
97
98 Code from other open source projects
99 ------------------------------------
100 PowerTOP contains some code from other open source projects; we'd like to
101 thank the authors of those projects for their work. 
102 Specifically PowerTOP contains code from
103
104 Parse Event Library - Copyright 2009, 2010 Red Hat Inc  Steven Rosted <srostedt@redhat.com>
105 nl80211 userspace tool - Copyright 2007, 2008   Johannes Berg <johannes@sipsolutions.net>
106
107
108 Extech Power Analyzer / Datalogger support
109 ------------------------------------------
110 I use, and our analysis teams use, the Extech Power Analyzer/Datalogger
111 (model number 380803) quite a lot, and PowerTOP supports using this
112 device over the serial cable. Just pass the device node on the command line
113 like this
114
115 powertop --extech=/dev/ttyUSB0
116
117 (where ttyUSB0 is the devicenode of the serial-to-usb adapter on my system)
118