Changeset 638927a in mainline for uspace/app/top/ps.c


Ignore:
Timestamp:
2010-04-09T11:18:08Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e43cdac
Parents:
faf38b2
Message:

top echoes also thread state overview
write_barrier() after computing percentages

File:
1 edited

Legend:

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

    rfaf38b2 r638927a  
    5858};
    5959
    60 unsigned int get_tasks(task_info_t **out_infos)
     60size_t get_tasks(task_info_t **out_infos)
    6161{
    62         int task_count = TASK_COUNT;
     62        size_t task_count = TASK_COUNT;
    6363        task_id_t *tasks = malloc(task_count * sizeof(task_id_t));
    64         int result = get_task_ids(tasks, sizeof(task_id_t) * task_count);
     64        size_t result = get_task_ids(tasks, sizeof(task_id_t) * task_count);
    6565
    6666        while (result > task_count) {
     
    7070        }
    7171
    72         int i;
     72        size_t i;
    7373        task_info_t *taskinfos = malloc(result * sizeof(task_info_t));
    7474        for (i = 0; i < result; ++i) {
     
    8282}
    8383
    84 thread_info_t *get_threads(task_id_t taskid)
     84size_t get_threads(thread_info_t **thread_infos)
    8585{
    86         int thread_count = THREAD_COUNT;
     86        size_t thread_count = THREAD_COUNT;
    8787        thread_info_t *threads = malloc(thread_count * sizeof(thread_info_t));
    88         int result = get_task_threads(threads, sizeof(thread_info_t) * thread_count);
     88        size_t result = get_task_threads(threads, sizeof(thread_info_t) * thread_count);
    8989
    9090        while (result > thread_count) {
     
    9494        }
    9595       
    96         return threads;
     96        *thread_infos = threads;
     97        return result;
    9798}
    9899
Note: See TracChangeset for help on using the changeset viewer.