Changeset ea55bc4 in mainline
- Timestamp:
- 2010-03-29T16:44:12Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a10e34
- Parents:
- 07640dfd
- Location:
- uspace/app/ps
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/ps/Makefile
r07640dfd rea55bc4 32 32 33 33 SOURCES = \ 34 ps.c 34 ps.c \ 35 func.c 35 36 36 37 include $(USPACE_PREFIX)/Makefile.common -
uspace/app/ps/ps.c
r07640dfd rea55bc4 41 41 #include <errno.h> 42 42 #include <stdlib.h> 43 /* #include <string.h> */44 43 #include <malloc.h> 44 45 #include "func.h" 45 46 46 47 #define TASK_COUNT 10 … … 70 71 } 71 72 72 printf(" ID Threads Pages [k]uCycles [k]kCyclesCycle fault Name\n");73 printf(" ID Threads Pages uCycles kCycles Cycle fault Name\n"); 73 74 74 75 int i; … … 76 77 task_info_t taskinfo; 77 78 get_task_info(tasks[i], &taskinfo); 78 printf("%8llu %8u %8u %12llu %12llu %12llu %s\n", tasks[i], 79 taskinfo.thread_count, taskinfo.pages, taskinfo.ucycles / 1000, 80 taskinfo.kcycles / 1000, (taskinfo.ucycles + taskinfo.kcycles) - 81 taskinfo.cycles, taskinfo.name); 79 uint64_t ucycles, kcycles, fault; 80 char usuffix, ksuffix, fsuffix; 81 order(taskinfo.ucycles, &ucycles, &usuffix); 82 order(taskinfo.kcycles, &kcycles, &ksuffix); 83 order((taskinfo.kcycles + taskinfo.ucycles) - taskinfo.cycles, &fault, &fsuffix); 84 printf("%8llu %8u %8u %12llu%c %12llu%c %12llu%c %s\n", tasks[i], 85 taskinfo.thread_count, taskinfo.pages, ucycles, usuffix, 86 kcycles, ksuffix, fault, fsuffix, taskinfo.name); 82 87 } 83 88 } … … 101 106 102 107 int i; 103 printf(" ID State CPU Prio [k]uCycles [k]kcyclesCycle fault\n");108 printf(" ID State CPU Prio [k]uCycles [k]kcycles Cycle fault\n"); 104 109 for (i = 0; i < result; ++i) { 105 printf("%6llu %-8s %4u %6d %12llu %12llu %12llu\n", threads[i].tid, 110 uint64_t ucycles, kcycles, fault; 111 char usuffix, ksuffix, fsuffix; 112 order(threads[i].ucycles, &ucycles, &usuffix); 113 order(threads[i].kcycles, &kcycles, &ksuffix); 114 order((threads[i].kcycles + threads[i].ucycles) - threads[i].cycles, &fault, &fsuffix); 115 printf("%6llu %-8s %4u %6d %12llu%c %12llu%c %12llu%c\n", threads[i].tid, 106 116 thread_states[threads[i].state], threads[i].cpu, 107 threads[i].priority, threads[i].ucycles / 1000, 108 threads[i].kcycles / 1000, 109 threads[i].ucycles + threads[i].kcycles - threads[i].cycles); 117 threads[i].priority, ucycles, usuffix, 118 kcycles, ksuffix, fault, fsuffix); 110 119 } 111 120 }
Note:
See TracChangeset
for help on using the changeset viewer.