aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaojie Sun <shaojie.sun@linaro.com>2013-09-11 10:24:48 +0800
committerShaojie Sun <shaojie.sun@linaro.com>2013-09-18 16:24:34 +0800
commit0ff9d431c3a8771d06a53431ddee63c2c9132492 (patch)
tree27826b55bf82c976ec9b967dfb34527a3af1996b
parentc56b89942afc7472e975b7ed00025cdb2e1561fc (diff)
downloadidlestat-0ff9d431c3a8771d06a53431ddee63c2c9132492.tar.gz
Build idlestat tool on Android platform.
Idlestat tool must be used on differenet platform, such as ubuntu, Android and so on. Add Android.mk file, then idle tool could be built on Android. Signed-off-by: Shaojie Sun <shaojie.sun@linaro.com>
-rw-r--r--Android.mk17
-rw-r--r--idlestat.c4
2 files changed, 18 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..e4c1696
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_SHARED_LIBRARIES := libstlport
+
+LOCAL_MODULE := idlestat
+
+LOCAL_C_INCLUDES += bionic \
+
+LOCAL_SRC_FILES += \
+ idlestat.c \
+ topology.c \
+ trace.c \
+ utils.c \
+
+include $(BUILD_EXECUTABLE)
diff --git a/idlestat.c b/idlestat.c
index 640a690..efd0fea 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -6,10 +6,8 @@
#include <unistd.h>
#include <sched.h>
#include <string.h>
-#include <values.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/signal.h>
#include <sys/resource.h>
#include "idlestat.h"
@@ -263,7 +261,7 @@ static struct cpuidle_datas *idlestat_load(const char *path)
{
FILE *f;
unsigned int state = 0, cpu = 0, nrcpus= 0;
- double time, begin, end;
+ double time, begin = 0, end = 0;
size_t count, start = 1;
struct cpuidle_datas *datas;