bootchart: fix bootchart can not be triggered problem

bootchart uses a file on the data partition to decide if it should collect
data for bootchart, but the data partition will be mounted by the mount_all
command in the "on fs" section, and it will be only added into the action
queue when command "trigger fs" is executed, but that's after the
bootchart_init action (late_init).

This change makes bootchart_init a builtin command of init,
and make it executed as the first command of "on post-fs" section
which will be triggered after the "on fs" section.

This change also refactors the bootchart code to all be in bootchart.cpp.

Change-Id: Ia74aa34ca5b785f51fcffdd383075a549b2a99d9
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
diff --git a/init/keywords.h b/init/keywords.h
index 0805cdd..a8f29d1 100644
--- a/init/keywords.h
+++ b/init/keywords.h
@@ -1,4 +1,5 @@
 #ifndef KEYWORD
+int do_bootchart_init(int nargs, char **args);
 int do_chroot(int nargs, char **args);
 int do_chdir(int nargs, char **args);
 int do_class_start(int nargs, char **args);
@@ -105,6 +106,7 @@
     KEYWORD(load_persist_props,    COMMAND, 0, do_load_persist_props)
     KEYWORD(load_all_props,        COMMAND, 0, do_load_all_props)
     KEYWORD(ioprio,      OPTION,  0, 0)
+    KEYWORD(bootchart_init,        COMMAND, 0, do_bootchart_init)
 #ifdef __MAKE_KEYWORD_ENUM__
     KEYWORD_COUNT,
 };