Changeset 516adce in mainline for uspace


Ignore:
Timestamp:
2010-04-07T10:24:00Z (15 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36b5b0f
Parents:
1ba37fa
Message:

top echoes also physical memory overview

Location:
uspace
Files:
3 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/top/Makefile

    r1ba37fa r516adce  
    3535        screen.c \
    3636        input.c \
     37        func.c \
    3738        ps.c
    3839
  • uspace/app/top/screen.c

    r1ba37fa r516adce  
    4343#include "screen.h"
    4444#include "top.h"
     45#include "func.h"
    4546
    4647int rows;
     
    133134                ++up_rows;
    134135        }
     136}
     137
     138static inline void print_meminfo(data_t *data)
     139{
     140        uint64_t newsize;
     141        char suffix;
     142        order(data->mem_info.total, &newsize, &suffix);
     143        printf("Mem: %8llu %c total", newsize, suffix);
     144        order(data->mem_info.used, &newsize, &suffix);
     145        printf(", %8llu %c used", newsize, suffix);
     146        order(data->mem_info.free, &newsize, &suffix);
     147        printf(", %8llu %c free", newsize, suffix);
    135148}
    136149
     
    182195        ++up_rows;
    183196        print_cpuinfo(data);
     197        print_meminfo(data);
     198        puts("\n");
     199        ++up_rows;
    184200        puts("\n");
    185201        ++up_rows;
  • uspace/app/top/top.c

    r1ba37fa r516adce  
    4343#include <sys/time.h>
    4444#include <load.h>
     45#include <ps.h>
    4546#include "screen.h"
    4647#include "input.h"
     
    8485        /* Read cpu infos */
    8586        target->cpu_count = get_cpu_infos(&target->cpus);
     87
     88        /* Read mem info */
     89        get_mem_info(&target->mem_info);
    8690}
    8791
  • uspace/app/top/top.h

    r1ba37fa r516adce  
    6868        uspace_cpu_info_t *cpus;
    6969        cpu_perc_t *cpu_perc;
     70
     71        uspace_mem_info_t mem_info;
    7072} data_t;
    7173
  • uspace/lib/c/Makefile

    r1ba37fa r516adce  
    9292        generic/stacktrace.c \
    9393        generic/ps.c \
    94         generic/cpu.c \
     94        generic/cpuinfo.c \
     95        generic/meminfo.c \
    9596        generic/load.c \
    9697        generic/uptime.c
  • uspace/lib/c/include/ps.h

    r1ba37fa r516adce  
    3939#include <kernel/ps/taskinfo.h>
    4040#include <kernel/ps/cpuinfo.h>
     41#include <kernel/ps/meminfo.h>
    4142
    4243extern int get_cpu_info(uspace_cpu_info_t *cpus);
     44extern int get_mem_info(uspace_mem_info_t *meminfo);
    4345extern size_t get_task_ids(task_id_t *ids, size_t size);
    4446extern int get_task_info(task_id_t id, task_info_t *info);
Note: See TracChangeset for help on using the changeset viewer.