Index: kernel/generic/src/proc/scheduler.c
===================================================================
--- kernel/generic/src/proc/scheduler.c	(revision 5ba201d1b59ac56658a3f14dd383a51abae28b5e)
+++ kernel/generic/src/proc/scheduler.c	(revision 70e2b2dbf43c2d66a4dc6c53e5bbcdfc53bd275a)
@@ -202,4 +202,7 @@
 		 */
 
+		 spinlock_lock(&CPU->lock);
+		 CPU->idle = true;
+		 spinlock_unlock(&CPU->lock);
 		 cpu_sleep();
 		 goto loop;
@@ -313,6 +316,6 @@
 		spinlock_lock(&THREAD->lock);
 		
-		/* Update thread accounting */
-		THREAD->cycles += get_cycle() - THREAD->last_cycle;
+		/* Update thread kernel accounting */
+		THREAD->kcycles += get_cycle() - THREAD->last_cycle;
 		
 #ifndef CONFIG_FPU_LAZY
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision 5ba201d1b59ac56658a3f14dd383a51abae28b5e)
+++ kernel/generic/src/proc/task.c	(revision 70e2b2dbf43c2d66a4dc6c53e5bbcdfc53bd275a)
@@ -186,6 +186,14 @@
 	ta->context = CONTEXT;
 	ta->capabilities = 0;
-	ta->cycles = 0;
-	
+	ta->ucycles = 0;
+	ta->kcycles = 0;
+
+	ta->ipc_info.call_sent = 0;
+	ta->ipc_info.call_recieved = 0;
+	ta->ipc_info.answer_sent = 0;
+	ta->ipc_info.answer_recieved = 0;
+	ta->ipc_info.irq_notif_recieved = 0;
+	ta->ipc_info.forwarded = 0;
+
 #ifdef CONFIG_UDEBUG
 	/* Init debugging stuff */
@@ -324,14 +332,14 @@
  * already disabled.
  *
- * @param t Pointer to task.
- *
- * @return Number of cycles used by the task and all its threads
- *         so far.
- *
- */
-uint64_t task_get_accounting(task_t *t)
-{
-	/* Accumulated value of task */
-	uint64_t ret = t->cycles;
+ * @param t       Pointer to thread.
+ * @param ucycles Out pointer to sum of all user cycles.
+ * @param kcycles Out pointer to sum of all kernel cycles.
+ *
+ */
+void task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles)
+{
+	/* Accumulated values of task */
+	uint64_t uret = t->ucycles;
+	uint64_t kret = t->kcycles;
 	
 	/* Current values of threads */
@@ -345,12 +353,14 @@
 			if (thr == THREAD) {
 				/* Update accounting of current thread */
-				thread_update_accounting();
+				thread_update_accounting(false);
 			} 
-			ret += thr->cycles;
+			uret += thr->ucycles;
+			kret += thr->kcycles;
 		}
 		spinlock_unlock(&thr->lock);
 	}
 	
-	return ret;
+	*ucycles = uret;
+	*kcycles = kret;
 }
 
@@ -419,18 +429,23 @@
 	spinlock_lock(&t->lock);
 	
-	uint64_t cycles;
-	char suffix;
-	order(task_get_accounting(t), &cycles, &suffix);
-	
-#ifdef __32_BITS__
-	printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64
-	    "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
-	    suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
+	uint64_t ucycles;
+	uint64_t kcycles;
+	char usuffix, ksuffix;
+	task_get_accounting(t, &ucycles, &kcycles);
+	order(ucycles, &ucycles, &usuffix);
+	order(kcycles, &kcycles, &ksuffix);
+	
+#ifdef __32_BITS__	
+	printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9"
+		PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as,
+		ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount),
+		atomic_get(&t->active_calls));
 #endif
 	
 #ifdef __64_BITS__
-	printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64
-	    "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
-	    suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
+	printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9"
+		PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as,
+		ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount),
+		atomic_get(&t->active_calls));
 #endif
 	
@@ -455,15 +470,15 @@
 	
 #ifdef __32_BITS__
-	printf("taskid name         ctx address    as         "
-	    "cycles     threads calls  callee\n");
-	printf("------ ------------ --- ---------- ---------- "
-	    "---------- ------- ------ ------>\n");
+	printf("taskid name         ctx address    as        "
+	    " ucycles    kcycles    threads calls  callee\n");
+	printf("------ ------------ --- ---------- ----------"
+	    " ---------- ---------- ------- ------ ------>\n");
 #endif
 	
 #ifdef __64_BITS__
-	printf("taskid name         ctx address            as                 "
-	    "cycles     threads calls  callee\n");
-	printf("------ ------------ --- ------------------ ------------------ "
-	    "---------- ------- ------ ------>\n");
+	printf("taskid name         ctx address            as                "
+	    " ucycles    kcycles    threads calls  callee\n");
+	printf("------ ------------ --- ------------------ ------------------"
+	    " ---------- ---------- ---------- ------- ------ ------>\n");
 #endif
 	
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 5ba201d1b59ac56658a3f14dd383a51abae28b5e)
+++ kernel/generic/src/proc/thread.c	(revision 70e2b2dbf43c2d66a4dc6c53e5bbcdfc53bd275a)
@@ -132,11 +132,15 @@
 	spinlock_lock(&THREAD->lock);
 	if (!THREAD->uncounted) {
-		thread_update_accounting();
-		uint64_t cycles = THREAD->cycles;
-		THREAD->cycles = 0;
+		thread_update_accounting(true);
+		uint64_t ucycles = THREAD->ucycles;
+		THREAD->ucycles = 0;
+		uint64_t kcycles = THREAD->kcycles;
+		THREAD->kcycles = 0;
+
 		spinlock_unlock(&THREAD->lock);
 		
 		spinlock_lock(&TASK->lock);
-		TASK->cycles += cycles;
+		TASK->ucycles += ucycles;
+		TASK->kcycles += kcycles;
 		spinlock_unlock(&TASK->lock);
 	} else
@@ -323,5 +327,6 @@
 	t->thread_arg = arg;
 	t->ticks = -1;
-	t->cycles = 0;
+	t->ucycles = 0;
+	t->kcycles = 0;
 	t->uncounted = uncounted;
 	t->priority = -1;		/* start in rq[0] */
@@ -614,18 +619,21 @@
 	thread_t *t = avltree_get_instance(node, thread_t, threads_tree_node);
 	
-	uint64_t cycles;
-	char suffix;
-	order(t->cycles, &cycles, &suffix);
+	uint64_t ucycles, kcycles;
+	char usuffix, ksuffix;
+	order(t->ucycles, &ucycles, &usuffix);
+	order(t->kcycles, &kcycles, &ksuffix);
 
 #ifdef __32_BITS__
-	printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9" PRIu64 "%c ",
-	    t->tid, t->name, t, thread_states[t->state], t->task,
-    	t->task->context, t->thread_code, t->kstack, cycles, suffix);
+	printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9"
+		PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t,
+		thread_states[t->state], t->task, t->task->context, t->thread_code,
+		t->kstack, ucycles, usuffix, kcycles, ksuffix);
 #endif
 
 #ifdef __64_BITS__
-	printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9" PRIu64 "%c ",
-	    t->tid, t->name, t, thread_states[t->state], t->task,
-    	t->task->context, t->thread_code, t->kstack, cycles, suffix);
+	printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9"
+		PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t,
+		thread_states[t->state], t->task, t->task->context, t->thread_code,
+		t->kstack, ucycles, usuffix, kcycles, ksuffix);
 #endif
 			
@@ -661,8 +669,8 @@
 #ifdef __32_BITS__	
 	printf("tid    name       address    state    task       "
-		"ctx code       stack      cycles     cpu  "
+		"ctx code       stack      ucycles    kcycles    cpu  "
 		"waitqueue\n");
 	printf("------ ---------- ---------- -------- ---------- "
-		"--- ---------- ---------- ---------- ---- "
+		"--- ---------- ---------- ---------- ---------- ---- "
 		"----------\n");
 #endif
@@ -670,8 +678,8 @@
 #ifdef __64_BITS__
 	printf("tid    name       address            state    task               "
-		"ctx code               stack              cycles     cpu  "
+		"ctx code               stack              ucycles    kcycles    cpu  "
 		"waitqueue\n");
 	printf("------ ---------- ------------------ -------- ------------------ "
-		"--- ------------------ ------------------ ---------- ---- "
+		"--- ------------------ ------------------ ---------- ---------- ---- "
 		"------------------\n");
 #endif
@@ -706,9 +714,14 @@
  * interrupts must be already disabled.
  *
- */
-void thread_update_accounting(void)
+ * @param user	True to update user accounting, false for kernel.
+ */
+void thread_update_accounting(bool user)
 {
 	uint64_t time = get_cycle();
-	THREAD->cycles += time - THREAD->last_cycle;
+	if (user) {
+		THREAD->ucycles += time - THREAD->last_cycle;
+	} else {
+		THREAD->kcycles += time - THREAD->last_cycle;
+	}
 	THREAD->last_cycle = time;
 }
