summaryrefslogtreecommitdiff
path: root/kern/task.c
diff options
context:
space:
mode:
authorDavid Höppner <0xffea@gmail.com>2013-01-04 22:43:53 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-01-13 20:13:32 +0100
commitbeda83efaa45fb04f142034f61eb1ae9fe872c59 (patch)
treeb5e4a7a4b18e42feb24d46167028f8cf3130b557 /kern/task.c
parent392239d8c9979ac95c122b77d5d1e012f216d2ec (diff)
Add statistics for task_events_info
* ipc/ipc_mqueue.c (ipc_mqueue_send, ipc_mqueue_receive): Increment counters for message sent and received. * kern/ipc_kobject.c (ipc_kobject_server): Increment sent and received counters for the kernel task. * kern/task.c (task_create): Zero statistics. * kern/task.c (task_info): Add task_events_info call. * kern/task.h: Add statistics. * vm/vm_fault.c (vm_fault_page): Increment zero_fills, pageins, reactivations and cow_faults counters. * vm/vm_fault.c (vm_fault_wire_fast): Increment faults counters. * vm/vm_pageout.c (vm_pageout_scan): Increment reactivations counter.
Diffstat (limited to 'kern/task.c')
-rw-r--r--kern/task.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/kern/task.c b/kern/task.c
index 2624dd9..114dd31 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -108,6 +108,13 @@ kern_return_t task_create(
new_task->active = TRUE;
new_task->user_stop_count = 0;
new_task->thread_count = 0;
+ new_task->faults = 0;
+ new_task->zero_fills = 0;
+ new_task->reactivations = 0;
+ new_task->pageins = 0;
+ new_task->cow_faults = 0;
+ new_task->messages_sent = 0;
+ new_task->messages_received = 0;
eml_task_reference(new_task, parent_task);
@@ -747,6 +754,30 @@ kern_return_t task_info(
break;
}
+ case TASK_EVENTS_INFO:
+ {
+ register task_events_info_t event_info;
+
+ if (*task_info_count < TASK_EVENTS_INFO_COUNT) {
+ return KERN_INVALID_ARGUMENT;
+ }
+
+ event_info = (task_events_info_t) task_info_out;
+
+ task_lock(&task);
+ event_info->faults = task->faults;
+ event_info->zero_fills = task->zero_fills;
+ event_info->reactivations = task->reactivations;
+ event_info->pageins = task->pageins;
+ event_info->cow_faults = task->cow_faults;
+ event_info->messages_sent = task->messages_sent;
+ event_info->messages_received = task->messages_received;
+ task_unlock(&task);
+
+ *task_info_count = TASK_EVENTS_INFO_COUNT;
+ break;
+ }
+
case TASK_THREAD_TIMES_INFO:
{
register task_thread_times_info_t times_info;