Changeset 8b2aba5 in mainline for uspace/app/top/screen.c


Ignore:
Timestamp:
2010-04-02T20:22:14Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee35ba0b
Parents:
8f56d93
Message:

top echoes also basic cpu info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/screen.c

    r8f56d93 r8b2aba5  
    4646int rows;
    4747int colls;
     48int up_rows;
    4849
    4950#define WHITE 0xf0f0f0
     
    5960{
    6061        console_get_size(fphone(stdout), &colls, &rows);
     62        up_rows = 0;
    6163        console_cursor_visibility(fphone(stdout), 0);
    6264        resume_normal();
     
    6870        console_clear(fphone(stdout));
    6971        moveto(0, 0);
     72        up_rows = 0;
     73        fflush(stdout);
    7074}
    7175
     
    103107}
    104108
     109static inline void print_cpuinfo(data_t *data)
     110{
     111        unsigned int i;
     112        uspace_cpu_info_t *cpus = data->cpus;
     113        for (i = 0; i < data->cpu_count; ++i) {
     114                printf("Cpu%u (%4u Mhz): Busy ticks: %6llu, Idle Ticks: %6llu\n",
     115                        i, (unsigned int)cpus[i].frequency_mhz, cpus[i].busy_ticks,
     116                        cpus[i].idle_ticks);
     117                ++up_rows;
     118        }
     119}
     120
    105121static inline void print_tasks(data_t *data, int row)
    106122{
     
    116132        }
    117133}
    118 
    119134
    120135static inline void print_head(void)
     
    139154        print_load(data);
    140155        puts("\n");
     156        ++up_rows;
    141157        print_taskstat(data);
    142         puts("\n\n");
     158        puts("\n");
     159        ++up_rows;
     160        print_cpuinfo(data);
     161        puts("\n");
     162        ++up_rows;
    143163        print_head();
    144164        puts("\n");
Note: See TracChangeset for help on using the changeset viewer.