diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/atrace/atrace.cpp | 2 | ||||
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 25 | ||||
-rw-r--r-- | cmds/installd/commands.c | 20 | ||||
-rw-r--r-- | cmds/installd/installd.c | 6 | ||||
-rw-r--r-- | cmds/installd/installd.h | 1 |
5 files changed, 53 insertions, 1 deletions
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index 9e5c910..f0a52d8 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -77,7 +77,7 @@ static const TracingCategory k_categories[] = { { "webview", "WebView", ATRACE_TAG_WEBVIEW, { } }, { "wm", "Window Manager", ATRACE_TAG_WINDOW_MANAGER, { } }, { "am", "Activity Manager", ATRACE_TAG_ACTIVITY_MANAGER, { } }, - { "sync", "Sync Manager", ATRACE_TAG_SYNC_MANAGER, { } }, + { "sm", "Sync Manager", ATRACE_TAG_SYNC_MANAGER, { } }, { "audio", "Audio", ATRACE_TAG_AUDIO, { } }, { "video", "Video", ATRACE_TAG_VIDEO, { } }, { "camera", "Camera", ATRACE_TAG_CAMERA, { } }, diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 1fbcef6..f9942e9 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <dirent.h> #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -75,6 +76,28 @@ static void get_tombstone_fds(tombstone_data_t data[NUM_TOMBSTONES]) { } } +static void dump_dev_files(const char *title, const char *driverpath, const char *filename) +{ + DIR *d; + struct dirent *de; + char path[PATH_MAX]; + + d = opendir(driverpath); + if (d == NULL) { + return; + } + + while ((de = readdir(d))) { + if (de->d_type != DT_LNK) { + continue; + } + snprintf(path, sizeof(path), "%s/%s/%s", driverpath, de->d_name, filename); + dump_file(title, path); + } + + closedir(d); +} + /* dumps the current system state to stdout */ static void dumpstate() { time_t now = time(NULL); @@ -107,7 +130,9 @@ static void dumpstate() { printf("Command line: %s\n", strtok(cmdline_buf, "\n")); printf("\n"); + dump_dev_files("TRUSTY VERSION", "/sys/bus/platform/drivers/trusty", "trusty_version"); run_command("UPTIME", 10, "uptime", NULL); + dump_file("MMC PERF", "/sys/block/mmcblk0/stat"); dump_file("MEMORY INFO", "/proc/meminfo"); run_command("CPU INFO", 10, "top", "-n", "1", "-d", "1", "-m", "30", "-t", NULL); run_command("PROCRANK", 20, "procrank", NULL); diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 5cd2593..344a5a3 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -20,6 +20,7 @@ #include <cutils/sched_policy.h> #include <diskusage/dirsize.h> #include <selinux/android.h> +#include <system/thread_defs.h> /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; @@ -1029,6 +1030,10 @@ int dexopt(const char *apk_path, uid_t uid, bool is_public, ALOGE("set_sched_policy failed: %s\n", strerror(errno)); exit(70); } + if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { + ALOGE("setpriority failed: %s\n", strerror(errno)); + exit(71); + } if (flock(out_fd, LOCK_EX | LOCK_NB) != 0) { ALOGE("flock(%s) failed: %s\n", out_path, strerror(errno)); exit(67); @@ -1076,6 +1081,21 @@ fail: return -1; } +int mark_boot_complete(const char* instruction_set) +{ + char boot_marker_path[PKG_PATH_MAX]; + sprintf(boot_marker_path,"%s%s/.booting", DALVIK_CACHE_PREFIX, instruction_set); + + ALOGV("mark_boot_complete : %s", boot_marker_path); + if (unlink(boot_marker_path) != 0) { + ALOGE("Unable to unlink boot marker at %s, error=%s", boot_marker_path, + strerror(errno)); + return -1; + } + + return 0; +} + void mkinnerdirs(char* path, int basepos, mode_t mode, int uid, int gid, struct stat* statbuf) { diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 4864516..86f7468 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -42,6 +42,11 @@ static int do_dexopt(char **arg, char reply[REPLY_MAX] __unused) return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0); } +static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] __unused) +{ + return mark_boot_complete(arg[0] /* instruction set */); +} + static int do_move_dex(char **arg, char reply[REPLY_MAX] __unused) { return move_dex(arg[0], arg[1], arg[2]); /* src, dst, instruction_set */ @@ -160,6 +165,7 @@ struct cmdinfo cmds[] = { { "ping", 0, do_ping }, { "install", 4, do_install }, { "dexopt", 6, do_dexopt }, + { "markbootcomplete", 1, do_mark_boot_complete }, { "movedex", 3, do_move_dex }, { "rmdex", 2, do_rm_dex }, { "remove", 2, do_remove }, diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 36c3e8c..a3a5c16 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -221,6 +221,7 @@ int get_size(const char *pkgname, userid_t userid, const char *apkpath, const ch int free_cache(int64_t free_size); int dexopt(const char *apk_path, uid_t uid, bool is_public, const char *pkgName, const char *instruction_set, bool vm_safe_mode, bool should_relocate); +int mark_boot_complete(const char *instruction_set); int movefiles(); int linklib(const char* target, const char* source, int userId); int idmap(const char *target_path, const char *overlay_path, uid_t uid); |