summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-03-14 17:13:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-14 17:13:11 +0000
commited6178976d51a74449dfa0a5c377e60f82cb11a0 (patch)
tree20a8a6d70cf871ef7a9ebe072e095e30fa103513 /toolbox
parent032964f22893e81e91a7f7f04bdcfbbdf4ccc188 (diff)
parent713aedd74a9e7bf81929ccd8225d2784afcbb9c9 (diff)
downloadsystem_core-ed6178976d51a74449dfa0a5c377e60f82cb11a0.zip
system_core-ed6178976d51a74449dfa0a5c377e60f82cb11a0.tar.gz
system_core-ed6178976d51a74449dfa0a5c377e60f82cb11a0.tar.bz2
am 713aedd7: am 9e38da5f: am 1a379899: Merge "toolbox: schedtop 64 bit build issue"
* commit '713aedd74a9e7bf81929ccd8225d2784afcbb9c9': toolbox: schedtop 64 bit build issue
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/schedtop.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/toolbox/schedtop.c b/toolbox/schedtop.c
index a76f968..0c85e76 100644
--- a/toolbox/schedtop.c
+++ b/toolbox/schedtop.c
@@ -1,26 +1,23 @@
-#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
+#include <dirent.h>
#include <fcntl.h>
-#include <unistd.h>
-
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
-
#include <sys/stat.h>
#include <sys/types.h>
-#include <dirent.h>
-#include <signal.h>
-
-#include <pwd.h>
+#include <unistd.h>
struct thread_info {
int pid;
int tid;
char name[64];
- uint64_t exec_time;
- uint64_t delay_time;
- uint32_t run_count;
+ unsigned long long exec_time;
+ unsigned long long delay_time;
+ unsigned long long run_count;
};
struct thread_table {
@@ -110,7 +107,8 @@ static void add_thread(int pid, int tid, struct thread_info *proc_info)
sprintf(line, "/proc/%d/schedstat", pid);
if (read_line(line, sizeof(line)))
return;
- if(sscanf(line, "%llu %llu %u", &info->exec_time, &info->delay_time, &info->run_count) != 3)
+ if(sscanf(line, "%llu %llu %llu",
+ &info->exec_time, &info->delay_time, &info->run_count) != 3)
return;
if (proc_info) {
proc_info->exec_time += info->exec_time;
@@ -183,7 +181,7 @@ static void print_threads(int pid, uint32_t flags)
if (j == threads.active)
printf(" %5u died\n", tid);
else if (!(flags & FLAG_HIDE_IDLE) || threads.data[j].run_count - last_threads.data[i].run_count)
- printf(" %5u %2u.%0*u %2u.%0*u %5u %5u.%0*u %5u.%0*u %7u %s\n", tid,
+ printf(" %5u %2u.%0*u %2u.%0*u %5llu %5u.%0*u %5u.%0*u %7llu %s\n", tid,
NS_TO_S_D(threads.data[j].exec_time - last_threads.data[i].exec_time),
NS_TO_S_D(threads.data[j].delay_time - last_threads.data[i].delay_time),
threads.data[j].run_count - last_threads.data[i].run_count,
@@ -236,7 +234,7 @@ static void update_table(DIR *d, uint32_t flags)
if (j == processes.active)
printf("%5u died\n", pid);
else if (!(flags & FLAG_HIDE_IDLE) || processes.data[j].run_count - last_processes.data[i].run_count) {
- printf("%5u %2u.%0*u %2u.%0*u %5u %5u.%0*u %5u.%0*u %7u %s\n", pid,
+ printf("%5u %2u.%0*u %2u.%0*u %5llu %5u.%0*u %5u.%0*u %7llu %s\n", pid,
NS_TO_S_D(processes.data[j].exec_time - last_processes.data[i].exec_time),
NS_TO_S_D(processes.data[j].delay_time - last_processes.data[i].delay_time),
processes.data[j].run_count - last_processes.data[i].run_count,