2 * Library for getting power usage statistics
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __POWERTOP_WRAPPER_H__
21 #define __POWERTOP_WRAPPER_H__
27 #define POWERTOP "powertop"
28 #define LOGFILE "./powertop-wrapper.log"
29 #define REPORTHEADER "/usr/share/powertop-wrapper/header.html"
32 #define UNUSED __attribute__((unused))
35 /* ************************************************************************ */
40 S_SOFTWARE_POWER_CONSUMERS,
41 S_DEVICE_POWER_REPORT,
42 S_PROCESS_DEVICE_ACTIVITY,
43 S_POWER_CONSUMPTION_SUMMARY,
44 S_SOFTWARE_SETTINGS_TUNING,
45 S_UNTUNABLE_SOFTWARE_ISSUES,
46 S_OPTIMAL_TUNED_SOFTWARE_SETTINGS,
47 S_PROCESSOR_IDLE_STATE_REPORT,
48 S_PROCESSOR_FREQUENCY_REPORT,
49 S_MALI_GPU_POWER_CONSUMERS
52 /* ************************************************************************ */
55 /* gpu, harddisk and disk are unneeded now */
56 double usage, wakeups, gpu, harddisk, disk, gfx;
57 char *category, *description;
60 /* ************************************************************************ */
68 /* ************************************************************************ */
73 char *name, *description;
74 } mali_power_consumer;
76 /* ************************************************************************ */
78 class power_consumer_cmp
82 operator()(const char *a, const char *b) const
84 return (strcmp(a, b) < 0);
88 /* ************************************************************************ */
90 typedef std::map<const char *, sw_power_consumer, power_consumer_cmp>
91 sw_power_consumer_map;
92 typedef std::map<const char *, hw_power_consumer, power_consumer_cmp>
93 hw_power_consumer_map;
94 typedef std::map<pid_t, mali_power_consumer> mali_power_consumer_map;
96 /* ************************************************************************ */
99 sw_power_consumer_map swpc;
100 hw_power_consumer_map hwpc;
101 mali_power_consumer_map malipc;
103 const char *report_file;
106 #endif /* __POWERTOP_WRAPPER_H__ */