Loading cmds/dumpstate/Android.mk +2 −2 Original line number Diff line number Diff line LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := libdumpstate_default.c LOCAL_SRC_FILES := libdumpstate_default.cpp LOCAL_MODULE := libdumpstate.default include $(BUILD_STATIC_LIBRARY) Loading @@ -10,7 +10,7 @@ ifdef BOARD_WLAN_DEVICE LOCAL_CFLAGS := -DFWDUMP_$(BOARD_WLAN_DEVICE) endif LOCAL_SRC_FILES := dumpstate.c utils.c LOCAL_SRC_FILES := dumpstate.cpp utils.cpp LOCAL_MODULE := dumpstate Loading cmds/dumpstate/dumpstate.c→cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ static unsigned long property_get_size(const char *key) { } /* timeout in ms */ static unsigned long logcat_timeout(char *name) { static unsigned long logcat_timeout(const char *name) { static const char global_tuneable[] = "persist.logd.size"; // Settings App static const char global_default[] = "ro.logd.size"; // BoardConfig.mk char key[PROP_NAME_MAX]; Loading cmds/dumpstate/dumpstate.h +8 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ #define SU_PATH "/system/xbin/su" #ifdef __cplusplus extern "C" { #endif typedef void (for_each_pid_func)(int, const char *); typedef void (for_each_tid_func)(int, int, const char *); Loading Loading @@ -84,4 +88,8 @@ void play_sound(const char *path); /* Implemented by libdumpstate_board to dump board-specific info */ void dumpstate_board(); #ifdef __cplusplus } #endif #endif /* _DUMPSTATE_H_ */ cmds/dumpstate/libdumpstate_default.c→cmds/dumpstate/libdumpstate_default.cpp +0 −0 File moved. View file cmds/dumpstate/utils.c→cmds/dumpstate/utils.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -117,19 +117,19 @@ static void __for_each_pid(void (*helper)(int, const char *, void *), const char } static void for_each_pid_helper(int pid, const char *cmdline, void *arg) { for_each_pid_func *func = arg; for_each_pid_func *func = (for_each_pid_func*) arg; func(pid, cmdline); } void for_each_pid(for_each_pid_func func, const char *header) { __for_each_pid(for_each_pid_helper, header, func); __for_each_pid(for_each_pid_helper, header, (void *)func); } static void for_each_tid_helper(int pid, const char *cmdline, void *arg) { DIR *d; struct dirent *de; char taskpath[255]; for_each_tid_func *func = arg; for_each_tid_func *func = (for_each_tid_func *) arg; sprintf(taskpath, "/proc/%d/task", pid); Loading Loading @@ -174,7 +174,7 @@ static void for_each_tid_helper(int pid, const char *cmdline, void *arg) { } void for_each_tid(for_each_tid_func func, const char *header) { __for_each_pid(for_each_tid_helper, header, func); __for_each_pid(for_each_tid_helper, header, (void *) func); } void show_wchan(int pid, int tid, const char *name) { Loading Loading @@ -322,7 +322,7 @@ int dump_files(const char *title, const char *dir, DIR *dirp; struct dirent *d; char *newpath = NULL; char *slash = "/"; const char *slash = "/"; int fd, retval = 0; if (title) { Loading Loading @@ -640,6 +640,10 @@ const char *dump_traces() { return NULL; } /* Variables below must be initialized before 'goto' statements */ int dalvik_found = 0; int ifd, wfd = -1; /* walk /proc and kill -QUIT all Dalvik processes */ DIR *proc = opendir("/proc"); if (proc == NULL) { Loading @@ -648,20 +652,19 @@ const char *dump_traces() { } /* use inotify to find when processes are done dumping */ int ifd = inotify_init(); ifd = inotify_init(); if (ifd < 0) { fprintf(stderr, "inotify_init: %s\n", strerror(errno)); goto error_close_fd; } int wfd = inotify_add_watch(ifd, traces_path, IN_CLOSE_WRITE); wfd = inotify_add_watch(ifd, traces_path, IN_CLOSE_WRITE); if (wfd < 0) { fprintf(stderr, "inotify_add_watch(%s): %s\n", traces_path, strerror(errno)); goto error_close_ifd; } struct dirent *d; int dalvik_found = 0; while ((d = readdir(proc))) { int pid = atoi(d->d_name); if (pid <= 0) continue; Loading Loading
cmds/dumpstate/Android.mk +2 −2 Original line number Diff line number Diff line LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := libdumpstate_default.c LOCAL_SRC_FILES := libdumpstate_default.cpp LOCAL_MODULE := libdumpstate.default include $(BUILD_STATIC_LIBRARY) Loading @@ -10,7 +10,7 @@ ifdef BOARD_WLAN_DEVICE LOCAL_CFLAGS := -DFWDUMP_$(BOARD_WLAN_DEVICE) endif LOCAL_SRC_FILES := dumpstate.c utils.c LOCAL_SRC_FILES := dumpstate.cpp utils.cpp LOCAL_MODULE := dumpstate Loading
cmds/dumpstate/dumpstate.c→cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ static unsigned long property_get_size(const char *key) { } /* timeout in ms */ static unsigned long logcat_timeout(char *name) { static unsigned long logcat_timeout(const char *name) { static const char global_tuneable[] = "persist.logd.size"; // Settings App static const char global_default[] = "ro.logd.size"; // BoardConfig.mk char key[PROP_NAME_MAX]; Loading
cmds/dumpstate/dumpstate.h +8 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ #define SU_PATH "/system/xbin/su" #ifdef __cplusplus extern "C" { #endif typedef void (for_each_pid_func)(int, const char *); typedef void (for_each_tid_func)(int, int, const char *); Loading Loading @@ -84,4 +88,8 @@ void play_sound(const char *path); /* Implemented by libdumpstate_board to dump board-specific info */ void dumpstate_board(); #ifdef __cplusplus } #endif #endif /* _DUMPSTATE_H_ */
cmds/dumpstate/libdumpstate_default.c→cmds/dumpstate/libdumpstate_default.cpp +0 −0 File moved. View file
cmds/dumpstate/utils.c→cmds/dumpstate/utils.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -117,19 +117,19 @@ static void __for_each_pid(void (*helper)(int, const char *, void *), const char } static void for_each_pid_helper(int pid, const char *cmdline, void *arg) { for_each_pid_func *func = arg; for_each_pid_func *func = (for_each_pid_func*) arg; func(pid, cmdline); } void for_each_pid(for_each_pid_func func, const char *header) { __for_each_pid(for_each_pid_helper, header, func); __for_each_pid(for_each_pid_helper, header, (void *)func); } static void for_each_tid_helper(int pid, const char *cmdline, void *arg) { DIR *d; struct dirent *de; char taskpath[255]; for_each_tid_func *func = arg; for_each_tid_func *func = (for_each_tid_func *) arg; sprintf(taskpath, "/proc/%d/task", pid); Loading Loading @@ -174,7 +174,7 @@ static void for_each_tid_helper(int pid, const char *cmdline, void *arg) { } void for_each_tid(for_each_tid_func func, const char *header) { __for_each_pid(for_each_tid_helper, header, func); __for_each_pid(for_each_tid_helper, header, (void *) func); } void show_wchan(int pid, int tid, const char *name) { Loading Loading @@ -322,7 +322,7 @@ int dump_files(const char *title, const char *dir, DIR *dirp; struct dirent *d; char *newpath = NULL; char *slash = "/"; const char *slash = "/"; int fd, retval = 0; if (title) { Loading Loading @@ -640,6 +640,10 @@ const char *dump_traces() { return NULL; } /* Variables below must be initialized before 'goto' statements */ int dalvik_found = 0; int ifd, wfd = -1; /* walk /proc and kill -QUIT all Dalvik processes */ DIR *proc = opendir("/proc"); if (proc == NULL) { Loading @@ -648,20 +652,19 @@ const char *dump_traces() { } /* use inotify to find when processes are done dumping */ int ifd = inotify_init(); ifd = inotify_init(); if (ifd < 0) { fprintf(stderr, "inotify_init: %s\n", strerror(errno)); goto error_close_fd; } int wfd = inotify_add_watch(ifd, traces_path, IN_CLOSE_WRITE); wfd = inotify_add_watch(ifd, traces_path, IN_CLOSE_WRITE); if (wfd < 0) { fprintf(stderr, "inotify_add_watch(%s): %s\n", traces_path, strerror(errno)); goto error_close_ifd; } struct dirent *d; int dalvik_found = 0; while ((d = readdir(proc))) { int pid = atoi(d->d_name); if (pid <= 0) continue; Loading