Changeset dd6c71c in mainline
- Timestamp:
- 2010-04-02T08:27:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 175ad5c6
- Parents:
- 62550dce
- Location:
- uspace/app
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/Makefile
r62550dce rdd6c71c 34 34 top.c \ 35 35 screen.c \ 36 input.c 36 input.c \ 37 ps.c 37 38 38 39 include $(USPACE_PREFIX)/Makefile.common -
uspace/app/top/screen.c
r62550dce rdd6c71c 38 38 #include <io/console.h> 39 39 #include <vfs/vfs.h> 40 #include <load.h> 40 41 #include "screen.h" 41 42 #include "top.h" … … 73 74 static inline void print_uptime(data_t *data) 74 75 { 75 printf("up %4d days, %02d:%02d:%02d ", data->uptime_d, data->uptime_h,76 printf("up %4d days, %02d:%02d:%02d, ", data->uptime_d, data->uptime_h, 76 77 data->uptime_m, data->uptime_s); 77 78 } 78 79 79 static int i = 0; 80 static inline void print_load(data_t *data) 81 { 82 puts("load avarage: "); 83 print_load_fragment(data->load[0], 2); 84 puts(" "); 85 print_load_fragment(data->load[1], 2); 86 puts(" "); 87 print_load_fragment(data->load[2], 2); 88 } 89 90 static inline void print_taskstat(data_t *data) 91 { 92 puts("Tasks: "); 93 printf("%4u total", data->task_count); 94 } 95 80 96 void print_data(data_t *data) 81 97 { … … 85 101 print_time(data); 86 102 print_uptime(data); 87 puts(" ... \n"); 88 printf("A dalsi radek topu - jiz po %dte", ++i); 103 print_load(data); 104 puts("\n"); 105 print_taskstat(data); 106 puts("\n"); 89 107 fflush(stdout); 90 108 } -
uspace/app/top/top.c
r62550dce rdd6c71c 47 47 #include "input.h" 48 48 #include "top.h" 49 #include "ps.h" 49 50 50 51 #define UPDATE_INTERVAL 1 … … 76 77 /* Read load */ 77 78 get_load(target->load); 79 80 /* Read task ids */ 81 target->task_count = get_tasks(&target->tasks); 78 82 } 79 83 … … 111 115 } 112 116 117 free(new_data.tasks); 113 118 puts("\n\n"); 114 119 fflush(stdout); -
uspace/app/top/top.h
r62550dce rdd6c71c 34 34 #define TOP_TOP_H_ 35 35 36 #include <task.h> 37 36 38 typedef struct { 37 39 unsigned int hours; … … 45 47 46 48 unsigned long load[3]; 49 50 task_id_t *tasks; 51 unsigned int task_count; 47 52 } data_t; 48 53 -
uspace/app/uptime/uptime.c
r62550dce rdd6c71c 44 44 #define MINUTE 60 45 45 46 #define ECHOLOAD1(x) ((x) >> 11)47 #define ECHOLOAD2(x) (((x) & 0x7ff) / 2)48 49 46 int main(int argc, char *argv[]) 50 47 {
Note:
See TracChangeset
for help on using the changeset viewer.