Changes in / [88dea9d:5ba201d] in mainline


Ignore:
Files:
40 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r88dea9d r5ba201d  
    9292        $(USPACEDIR)/app/nettest2/nettest2 \
    9393        $(USPACEDIR)/app/netecho/netecho \
    94         $(USPACEDIR)/app/ping/ping \
    95         $(USPACEDIR)/app/ps/ps \
    96         $(USPACEDIR)/app/top/top \
    97         $(USPACEDIR)/app/uptime/uptime \
    98         $(USPACEDIR)/app/dummy_load/dummy_load
     94        $(USPACEDIR)/app/ping/ping
    9995
    10096COMPONENTS = \
  • kernel/Makefile

    r88dea9d r5ba201d  
    229229        generic/src/ipc/event.c \
    230230        generic/src/security/cap.c \
    231         generic/src/sysinfo/sysinfo.c \
    232         generic/src/ps/ps.c \
    233         generic/src/ps/cpu.c \
    234         generic/src/ps/load.c \
    235         generic/src/ps/uptime.c \
    236         generic/src/ps/mem.c
     231        generic/src/sysinfo/sysinfo.c
    237232
    238233## Kernel console support
  • kernel/generic/include/cpu.h

    r88dea9d r5ba201d  
    6868                                             are disabled. */
    6969
    70         bool idle;
    71         uint64_t idle_ticks;
    72         uint64_t busy_ticks;
    73 
    7470        /**
    7571         * Processor ID assigned by kernel.
  • kernel/generic/include/mm/frame.h

    r88dea9d r5ba201d  
    170170extern void zone_merge_all(void);
    171171extern uint64_t zone_total_size(void);
    172 extern void zone_busy_and_free(uint64_t *out_busy, uint64_t *out_free);
    173172
    174173/*
  • kernel/generic/include/proc/task.h

    r88dea9d r5ba201d  
    5757#include <mm/as.h>
    5858
    59 #include <ps/taskinfo.h>
     59#define TASK_NAME_BUFLEN        20
    6060
    6161struct thread;
     
    9494        answerbox_t answerbox;  /**< Communication endpoint */
    9595        phone_t phones[IPC_MAX_PHONES];
    96         task_ipc_info_t ipc_info; /**< IPC statistics */
    9796        /**
    9897         * Active asynchronous messages. It is used for limiting uspace to
     
    123122       
    124123        /** Accumulated accounting. */
    125         uint64_t ucycles;
    126         uint64_t kcycles;
     124        uint64_t cycles;
    127125} task_t;
    128126
     
    136134extern task_t *task_find_by_id(task_id_t id);
    137135extern int task_kill(task_id_t id);
    138 extern void task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles);
     136extern uint64_t task_get_accounting(task_t *t);
    139137extern void task_print_list(void);
    140138
  • kernel/generic/include/proc/thread.h

    r88dea9d r5ba201d  
    6969#define THREAD_FLAG_NOATTACH    (1 << 3)
    7070
    71 /* We need state_t enum definition */
    72 #include <ps/taskinfo.h>
     71/** Thread states. */
     72typedef enum {
     73        /** It is an error, if thread is found in this state. */
     74        Invalid,
     75        /** State of a thread that is currently executing on some CPU. */
     76        Running,
     77        /** Thread in this state is waiting for an event. */
     78        Sleeping,
     79        /** State of threads in a run queue. */
     80        Ready,
     81        /** Threads are in this state before they are first readied. */
     82        Entering,
     83        /** After a thread calls thread_exit(), it is put into Exiting state. */
     84        Exiting,
     85        /** Threads that were not detached but exited are Lingering. */
     86        Lingering
     87} state_t;
    7388
    7489/** Thread structure. There is one per thread. */
     
    174189       
    175190        /** Thread accounting. */
    176         uint64_t ucycles;
    177         uint64_t kcycles;
     191        uint64_t cycles;
    178192        /** Last sampled cycle. */
    179193        uint64_t last_cycle;
     
    238252extern void thread_print_list(void);
    239253extern void thread_destroy(thread_t *);
    240 extern void thread_update_accounting(bool);
     254extern void thread_update_accounting(void);
    241255extern bool thread_exists(thread_t *);
    242256
  • kernel/generic/include/syscall/syscall.h

    r88dea9d r5ba201d  
    8989        SYS_DEBUG_ENABLE_CONSOLE,
    9090        SYS_DEBUG_DISABLE_CONSOLE,
    91 
    92         SYS_PS_GET_CPU_INFO,
    93         SYS_PS_GET_MEM_INFO,
    94         SYS_PS_GET_TASKS,
    95         SYS_PS_GET_TASK_INFO,
    96         SYS_PS_GET_THREADS,
    97         SYS_PS_GET_UPTIME,
    98         SYS_PS_GET_LOAD,
    99 
    10091        SYS_IPC_CONNECT_KBOX,
    10192        SYSCALL_END
  • kernel/generic/src/console/cmd.c

    r88dea9d r5ba201d  
    10491049        ipl_t ipl = interrupts_disable();
    10501050        spinlock_lock(&TASK->lock);
    1051         uint64_t ucycles0, kcycles0;
    1052         task_get_accounting(TASK, &ucycles0, &kcycles0);
     1051        uint64_t t0 = task_get_accounting(TASK);
    10531052        spinlock_unlock(&TASK->lock);
    10541053        interrupts_restore(ipl);
     
    10591058       
    10601059        /* Update and read thread accounting */
    1061         uint64_t ucycles1, kcycles1;
    10621060        ipl = interrupts_disable();
    10631061        spinlock_lock(&TASK->lock);
    1064         task_get_accounting(TASK, &ucycles1, &kcycles1);
     1062        uint64_t dt = task_get_accounting(TASK) - t0;
    10651063        spinlock_unlock(&TASK->lock);
    10661064        interrupts_restore(ipl);
    10671065       
    1068         uint64_t ucycles, kcycles;
    1069         char usuffix, ksuffix;
    1070         order(ucycles1 - ucycles0, &ucycles, &usuffix);
    1071         order(kcycles1 - kcycles0, &kcycles, &ksuffix);
    1072                
    1073         printf("Time: %" PRIu64 "%c user cycles, %" PRIu64 "%c kernel cycles\n",
    1074                         ucycles, usuffix, kcycles, ksuffix);
     1066        uint64_t cycles;
     1067        char suffix;
     1068        order(dt, &cycles, &suffix);
     1069               
     1070        printf("Time: %" PRIu64 "%c cycles\n", cycles, suffix);
    10751071       
    10761072        if (ret == NULL) {
     
    10871083        uint32_t i;
    10881084        bool ret = true;
    1089         uint64_t ucycles, kcycles;
    1090         char usuffix, ksuffix;
     1085        uint64_t cycles;
     1086        char suffix;
    10911087       
    10921088        if (cnt < 1)
     
    11061102                ipl_t ipl = interrupts_disable();
    11071103                spinlock_lock(&TASK->lock);
    1108                 uint64_t ucycles0, kcycles0;
    1109                 task_get_accounting(TASK, &ucycles0, &kcycles0);
     1104                uint64_t t0 = task_get_accounting(TASK);
    11101105                spinlock_unlock(&TASK->lock);
    11111106                interrupts_restore(ipl);
     
    11181113                ipl = interrupts_disable();
    11191114                spinlock_lock(&TASK->lock);
    1120                 uint64_t ucycles1, kcycles1;
    1121                 task_get_accounting(TASK, &ucycles1, &kcycles1);
     1115                uint64_t dt = task_get_accounting(TASK) - t0;
    11221116                spinlock_unlock(&TASK->lock);
    11231117                interrupts_restore(ipl);
    1124 
     1118               
    11251119                if (ret != NULL) {
    11261120                        printf("%s\n", ret);
     
    11291123                }
    11301124               
    1131                 data[i] = ucycles1 - ucycles0 + kcycles1 - kcycles0;
    1132                 order(ucycles1 - ucycles0, &ucycles, &usuffix);
    1133                 order(kcycles1 - kcycles0, &kcycles, &ksuffix);
    1134                 printf("OK (%" PRIu64 "%c user cycles, %" PRIu64 "%c kernel cycles)\n",
    1135                                 ucycles, usuffix, kcycles, ksuffix);
     1125                data[i] = dt;
     1126                order(dt, &cycles, &suffix);
     1127                printf("OK (%" PRIu64 "%c cycles)\n", cycles, suffix);
    11361128        }
    11371129       
     
    11451137                }
    11461138               
    1147                 order(sum / (uint64_t) cnt, &ucycles, &usuffix);
    1148                 printf("Average\t\t%" PRIu64 "%c\n", ucycles, usuffix);
     1139                order(sum / (uint64_t) cnt, &cycles, &suffix);
     1140                printf("Average\t\t%" PRIu64 "%c\n", cycles, suffix);
    11491141        }
    11501142       
  • kernel/generic/src/cpu/cpu.c

    r88dea9d r5ba201d  
    4848#include <adt/list.h>
    4949#include <print.h>
    50 #include <sysinfo/sysinfo.h>
    5150
    5251cpu_t *cpus;
     
    7574                       
    7675                        cpus[i].id = i;
    77                         cpus[i].idle_ticks = 0;
    78                         cpus[i].busy_ticks = 0;
    7976                       
    8077                        spinlock_initialize(&cpus[i].lock, "cpu_t.lock");
     
    9794        cpu_identify();
    9895        cpu_arch_init();
    99 
    100         sysinfo_set_item_val("cpu.count", NULL, config.cpu_count);
    10196}
    10297
  • kernel/generic/src/interrupt/interrupt.c

    r88dea9d r5ba201d  
    5151#include <print.h>
    5252#include <symtab.h>
    53 #include <proc/thread.h>
    5453
    5554static struct {
     
    9291        ASSERT(n < IVT_ITEMS);
    9392
    94         /* Account user cycles */
    95         if (THREAD)
    96                 thread_update_accounting(true);
    97 
    9893#ifdef CONFIG_UDEBUG
    9994        if (THREAD) THREAD->udebug.uspace_state = istate;
     
    109104        if (THREAD && THREAD->interrupted && istate_from_uspace(istate))
    110105                thread_exit();
    111 
    112         if (THREAD)
    113                 thread_update_accounting(false);
    114106}
    115107
  • kernel/generic/src/ipc/ipc.c

    r88dea9d r5ba201d  
    219219        bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox));
    220220
    221         /* Count sent answer */
    222         spinlock_lock(&TASK->lock);
    223         TASK->ipc_info.answer_sent++;
    224         spinlock_unlock(&TASK->lock);
    225 
    226221        call->flags |= IPC_CALL_ANSWERED;
    227222
     
    281276static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call)
    282277{
    283         /* Count sent ipc call */
    284         spinlock_lock(&TASK->lock);
    285         TASK->ipc_info.call_sent++;
    286         spinlock_unlock(&TASK->lock);
    287 
    288278        if (!(call->flags & IPC_CALL_FORWARDED)) {
    289279                atomic_inc(&phone->active_calls);
     
    386376int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode)
    387377{
    388         /* Count forwarded calls */
    389         spinlock_lock(&TASK->lock);
    390         TASK->ipc_info.forwarded++;
    391         spinlock_unlock(&TASK->lock);
    392 
    393378        spinlock_lock(&oldbox->lock);
    394379        list_remove(&call->link);
     
    431416        spinlock_lock(&box->lock);
    432417        if (!list_empty(&box->irq_notifs)) {
    433 
    434                 /* Count recieved IRQ notification */
    435                 spinlock_lock(&TASK->lock);
    436                 TASK->ipc_info.irq_notif_recieved++;
    437                 spinlock_unlock(&TASK->lock);
    438 
    439418                ipl = interrupts_disable();
    440419                spinlock_lock(&box->irq_lock);
     
    446425                interrupts_restore(ipl);
    447426        } else if (!list_empty(&box->answers)) {
    448                 /* Count recieved answer */
    449                 spinlock_lock(&TASK->lock);
    450                 TASK->ipc_info.answer_recieved++;
    451                 spinlock_unlock(&TASK->lock);
    452 
    453427                /* Handle asynchronous answers */
    454428                request = list_get_instance(box->answers.next, call_t, link);
     
    456430                atomic_dec(&request->data.phone->active_calls);
    457431        } else if (!list_empty(&box->calls)) {
    458                 /* Count recieved call */
    459                 spinlock_lock(&TASK->lock);
    460                 TASK->ipc_info.call_recieved++;
    461                 spinlock_unlock(&TASK->lock);
    462 
    463432                /* Handle requests */
    464433                request = list_get_instance(box->calls.next, call_t, link);
  • kernel/generic/src/main/kinit.c

    r88dea9d r5ba201d  
    6767#include <debug.h>
    6868#include <str.h>
    69 #include <ps/load.h>
    7069
    7170#ifdef CONFIG_SMP
     
    164163#endif /* CONFIG_KCONSOLE */
    165164       
    166         /* Start thread computing system load */
    167         thread = thread_create(kload_thread, NULL, TASK, 0, "kload", false);
    168         if (thread != NULL)
    169                 thread_ready(thread);
    170         else
    171                 printf("Unable to create kload thread\n");
    172 
    173165        interrupts_enable();
    174166       
  • kernel/generic/src/main/main.c

    r88dea9d r5ba201d  
    226226        printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n",
    227227            config.cpu_count, SIZE2MB(zone_total_size()));
    228 
     228       
    229229        LOG_EXEC(cpu_init());
    230230       
  • kernel/generic/src/mm/frame.c

    r88dea9d r5ba201d  
    12181218}
    12191219
    1220 void zone_busy_and_free(uint64_t *out_busy, uint64_t *out_free)
    1221 {
    1222         ipl_t ipl = interrupts_disable();
    1223         spinlock_lock(&zones.lock);
    1224 
    1225         uint64_t busy = 0, free = 0;
    1226         size_t i;
    1227         for (i = 0; i < zones.count; i++) {
    1228                 bool available = zone_flags_available(zones.info[i].flags);
    1229                 /* Do not count reserved memory */
    1230                 if (available) {
    1231                         busy += (uint64_t) FRAMES2SIZE(zones.info[i].busy_count);
    1232                         free += (uint64_t) FRAMES2SIZE(zones.info[i].free_count);
    1233                 }
    1234         }
    1235 
    1236         spinlock_unlock(&zones.lock);
    1237         interrupts_restore(ipl);
    1238         *out_busy = busy;
    1239         *out_free = free;
    1240 }
    1241 
    12421220/** Prints list of zones. */
    12431221void zone_print_list(void)
  • kernel/generic/src/proc/scheduler.c

    r88dea9d r5ba201d  
    202202                 */
    203203
    204                  spinlock_lock(&CPU->lock);
    205                  CPU->idle = true;
    206                  spinlock_unlock(&CPU->lock);
    207204                 cpu_sleep();
    208205                 goto loop;
     
    316313                spinlock_lock(&THREAD->lock);
    317314               
    318                 /* Update thread kernel accounting */
    319                 THREAD->kcycles += get_cycle() - THREAD->last_cycle;
     315                /* Update thread accounting */
     316                THREAD->cycles += get_cycle() - THREAD->last_cycle;
    320317               
    321318#ifndef CONFIG_FPU_LAZY
  • kernel/generic/src/proc/task.c

    r88dea9d r5ba201d  
    186186        ta->context = CONTEXT;
    187187        ta->capabilities = 0;
    188         ta->ucycles = 0;
    189         ta->kcycles = 0;
    190 
    191         ta->ipc_info.call_sent = 0;
    192         ta->ipc_info.call_recieved = 0;
    193         ta->ipc_info.answer_sent = 0;
    194         ta->ipc_info.answer_recieved = 0;
    195         ta->ipc_info.irq_notif_recieved = 0;
    196         ta->ipc_info.forwarded = 0;
    197 
     188        ta->cycles = 0;
     189       
    198190#ifdef CONFIG_UDEBUG
    199191        /* Init debugging stuff */
     
    332324 * already disabled.
    333325 *
    334  * @param t       Pointer to thread.
    335  * @param ucycles Out pointer to sum of all user cycles.
    336  * @param kcycles Out pointer to sum of all kernel cycles.
    337  *
    338  */
    339 void task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles)
    340 {
    341         /* Accumulated values of task */
    342         uint64_t uret = t->ucycles;
    343         uint64_t kret = t->kcycles;
     326 * @param t Pointer to task.
     327 *
     328 * @return Number of cycles used by the task and all its threads
     329 *         so far.
     330 *
     331 */
     332uint64_t task_get_accounting(task_t *t)
     333{
     334        /* Accumulated value of task */
     335        uint64_t ret = t->cycles;
    344336       
    345337        /* Current values of threads */
     
    353345                        if (thr == THREAD) {
    354346                                /* Update accounting of current thread */
    355                                 thread_update_accounting(false);
     347                                thread_update_accounting();
    356348                        }
    357                         uret += thr->ucycles;
    358                         kret += thr->kcycles;
     349                        ret += thr->cycles;
    359350                }
    360351                spinlock_unlock(&thr->lock);
    361352        }
    362353       
    363         *ucycles = uret;
    364         *kcycles = kret;
     354        return ret;
    365355}
    366356
     
    429419        spinlock_lock(&t->lock);
    430420       
    431         uint64_t ucycles;
    432         uint64_t kcycles;
    433         char usuffix, ksuffix;
    434         task_get_accounting(t, &ucycles, &kcycles);
    435         order(ucycles, &ucycles, &usuffix);
    436         order(kcycles, &kcycles, &ksuffix);
    437        
    438 #ifdef __32_BITS__     
    439         printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9"
    440                 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as,
    441                 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount),
    442                 atomic_get(&t->active_calls));
     421        uint64_t cycles;
     422        char suffix;
     423        order(task_get_accounting(t), &cycles, &suffix);
     424       
     425#ifdef __32_BITS__
     426        printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64
     427            "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
     428            suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
    443429#endif
    444430       
    445431#ifdef __64_BITS__
    446         printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9"
    447                 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as,
    448                 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount),
    449                 atomic_get(&t->active_calls));
     432        printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64
     433            "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
     434            suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
    450435#endif
    451436       
     
    470455       
    471456#ifdef __32_BITS__
    472         printf("taskid name         ctx address    as        "
    473             " ucycles    kcycles    threads calls  callee\n");
    474         printf("------ ------------ --- ---------- ----------"
    475             " ---------- ---------- ------- ------ ------>\n");
     457        printf("taskid name         ctx address    as         "
     458            "cycles     threads calls  callee\n");
     459        printf("------ ------------ --- ---------- ---------- "
     460            "---------- ------- ------ ------>\n");
    476461#endif
    477462       
    478463#ifdef __64_BITS__
    479         printf("taskid name         ctx address            as                "
    480             " ucycles    kcycles    threads calls  callee\n");
    481         printf("------ ------------ --- ------------------ ------------------"
    482             " ---------- ---------- ---------- ------- ------ ------>\n");
     464        printf("taskid name         ctx address            as                 "
     465            "cycles     threads calls  callee\n");
     466        printf("------ ------------ --- ------------------ ------------------ "
     467            "---------- ------- ------ ------>\n");
    483468#endif
    484469       
  • kernel/generic/src/proc/thread.c

    r88dea9d r5ba201d  
    132132        spinlock_lock(&THREAD->lock);
    133133        if (!THREAD->uncounted) {
    134                 thread_update_accounting(true);
    135                 uint64_t ucycles = THREAD->ucycles;
    136                 THREAD->ucycles = 0;
    137                 uint64_t kcycles = THREAD->kcycles;
    138                 THREAD->kcycles = 0;
    139 
     134                thread_update_accounting();
     135                uint64_t cycles = THREAD->cycles;
     136                THREAD->cycles = 0;
    140137                spinlock_unlock(&THREAD->lock);
    141138               
    142139                spinlock_lock(&TASK->lock);
    143                 TASK->ucycles += ucycles;
    144                 TASK->kcycles += kcycles;
     140                TASK->cycles += cycles;
    145141                spinlock_unlock(&TASK->lock);
    146142        } else
     
    327323        t->thread_arg = arg;
    328324        t->ticks = -1;
    329         t->ucycles = 0;
    330         t->kcycles = 0;
     325        t->cycles = 0;
    331326        t->uncounted = uncounted;
    332327        t->priority = -1;               /* start in rq[0] */
     
    619614        thread_t *t = avltree_get_instance(node, thread_t, threads_tree_node);
    620615       
    621         uint64_t ucycles, kcycles;
    622         char usuffix, ksuffix;
    623         order(t->ucycles, &ucycles, &usuffix);
    624         order(t->kcycles, &kcycles, &ksuffix);
     616        uint64_t cycles;
     617        char suffix;
     618        order(t->cycles, &cycles, &suffix);
    625619
    626620#ifdef __32_BITS__
    627         printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9"
    628                 PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t,
    629                 thread_states[t->state], t->task, t->task->context, t->thread_code,
    630                 t->kstack, ucycles, usuffix, kcycles, ksuffix);
     621        printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9" PRIu64 "%c ",
     622            t->tid, t->name, t, thread_states[t->state], t->task,
     623        t->task->context, t->thread_code, t->kstack, cycles, suffix);
    631624#endif
    632625
    633626#ifdef __64_BITS__
    634         printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9"
    635                 PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t,
    636                 thread_states[t->state], t->task, t->task->context, t->thread_code,
    637                 t->kstack, ucycles, usuffix, kcycles, ksuffix);
     627        printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9" PRIu64 "%c ",
     628            t->tid, t->name, t, thread_states[t->state], t->task,
     629        t->task->context, t->thread_code, t->kstack, cycles, suffix);
    638630#endif
    639631                       
     
    669661#ifdef __32_BITS__     
    670662        printf("tid    name       address    state    task       "
    671                 "ctx code       stack      ucycles    kcycles    cpu  "
     663                "ctx code       stack      cycles     cpu  "
    672664                "waitqueue\n");
    673665        printf("------ ---------- ---------- -------- ---------- "
    674                 "--- ---------- ---------- ---------- ---------- ---- "
     666                "--- ---------- ---------- ---------- ---- "
    675667                "----------\n");
    676668#endif
     
    678670#ifdef __64_BITS__
    679671        printf("tid    name       address            state    task               "
    680                 "ctx code               stack              ucycles    kcycles    cpu  "
     672                "ctx code               stack              cycles     cpu  "
    681673                "waitqueue\n");
    682674        printf("------ ---------- ------------------ -------- ------------------ "
    683                 "--- ------------------ ------------------ ---------- ---------- ---- "
     675                "--- ------------------ ------------------ ---------- ---- "
    684676                "------------------\n");
    685677#endif
     
    714706 * interrupts must be already disabled.
    715707 *
    716  * @param user  True to update user accounting, false for kernel.
    717  */
    718 void thread_update_accounting(bool user)
     708 */
     709void thread_update_accounting(void)
    719710{
    720711        uint64_t time = get_cycle();
    721         if (user) {
    722                 THREAD->ucycles += time - THREAD->last_cycle;
    723         } else {
    724                 THREAD->kcycles += time - THREAD->last_cycle;
    725         }
     712        THREAD->cycles += time - THREAD->last_cycle;
    726713        THREAD->last_cycle = time;
    727714}
  • kernel/generic/src/synch/waitq.c

    r88dea9d r5ba201d  
    5454#include <context.h>
    5555#include <adt/list.h>
    56 #include <arch/cycle.h>
    5756
    5857static void waitq_sleep_timed_out(void *data);
     
    374373                if (!context_save(&THREAD->sleep_interruption_context)) {
    375374                        /* Short emulation of scheduler() return code. */
    376                         THREAD->last_cycle = get_cycle();
    377375                        spinlock_unlock(&THREAD->lock);
    378376                        return ESYNCH_INTERRUPTED;
     
    387385                if (!context_save(&THREAD->sleep_timeout_context)) {
    388386                        /* Short emulation of scheduler() return code. */
    389                         THREAD->last_cycle = get_cycle();
    390387                        spinlock_unlock(&THREAD->lock);
    391388                        return ESYNCH_TIMEOUT;
  • kernel/generic/src/syscall/syscall.c

    r88dea9d r5ba201d  
    5454#include <console/console.h>
    5555#include <udebug/udebug.h>
    56 #include <ps/ps.h>
    57 #include <ps/load.h>
    58 #include <ps/uptime.h>
    5956
    6057/** Dispatch system call */
     
    6360{
    6461        unative_t rc;
    65 
    66         /* Do userpace accounting */
    67         thread_update_accounting(true);
    6862
    6963#ifdef CONFIG_UDEBUG
     
    10195        }
    10296#endif
    103 
    104         /* Do kernel accounting */
    105         thread_update_accounting(false);
    10697       
    10798        return rc;
     
    170161        (syshandler_t) sys_debug_enable_console,
    171162        (syshandler_t) sys_debug_disable_console,
    172 
    173         /* Ps calls */
    174         (syshandler_t) sys_ps_get_cpu_info,
    175         (syshandler_t) sys_ps_get_mem_info,
    176         (syshandler_t) sys_ps_get_tasks,
    177         (syshandler_t) sys_ps_get_task_info,
    178         (syshandler_t) sys_ps_get_threads,
    179         (syshandler_t) sys_ps_get_uptime,
    180         (syshandler_t) sys_ps_get_load,
    181163       
    182164        (syshandler_t) sys_ipc_connect_kbox
  • kernel/generic/src/time/clock.c

    r88dea9d r5ba201d  
    137137        size_t missed_clock_ticks = CPU->missed_clock_ticks;
    138138        unsigned int i;
    139 
    140         /* Account lost ticks to CPU usage */
    141         if (CPU->idle) {
    142                 ASSERT(missed_clock_ticks == 0);
    143                 CPU->idle_ticks++;
    144         } else {
    145                 CPU->busy_ticks += missed_clock_ticks + 1;
    146         }
    147         CPU->idle = false;
    148139
    149140        /*
  • uspace/Makefile

    r88dea9d r5ba201d  
    4646        app/tetris \
    4747        app/trace \
    48         app/ps \
    49         app/top \
    50         app/uptime \
    51         app/dummy_load \
    5248        srv/clip \
    5349        srv/devmap \
  • uspace/lib/c/Makefile

    r88dea9d r5ba201d  
    9595        generic/vfs/canonify.c \
    9696        generic/stacktrace.c \
    97         generic/arg_parse.c \
    98         generic/ps.c \
    99         generic/cpuinfo.c \
    100         generic/meminfo.c \
    101         generic/load.c \
    102         generic/uptime.c
     97        generic/arg_parse.c
    10398
    10499SOURCES = \
Note: See TracChangeset for help on using the changeset viewer.