summaryrefslogtreecommitdiff
path: root/vm/vm_fault.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 /vm/vm_fault.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 'vm/vm_fault.c')
-rw-r--r--vm/vm_fault.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm/vm_fault.c b/vm/vm_fault.c
index 178f307..fe5b488 100644
--- a/vm/vm_fault.c
+++ b/vm/vm_fault.c
@@ -254,6 +254,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_stat_sample(SAMPLED_PC_VM_FAULTS_ANY);
vm_stat.faults++; /* needs lock XXX */
+ current_task()->faults++;
/*
* Recovery actions
@@ -471,6 +472,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_stat_sample(SAMPLED_PC_VM_ZFILL_FAULTS);
vm_stat.zero_fill_count++;
+ current_task()->zero_fills;
vm_object_lock(object);
pmap_clear_modify(m->phys_addr);
break;
@@ -552,6 +554,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
if (m->inactive) {
vm_stat_sample(SAMPLED_PC_VM_REACTIVATION_FAULTS);
vm_stat.reactivations++;
+ current_task()->reactivations++;
}
VM_PAGE_QUEUES_REMOVE(m);
@@ -651,6 +654,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_stat.pageins++;
vm_stat_sample(SAMPLED_PC_VM_PAGEIN_FAULTS);
+ current_task()->pageins++;
if ((rc = memory_object_data_request(object->pager,
object->pager_request,
@@ -740,6 +744,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_page_zero_fill(m);
vm_stat_sample(SAMPLED_PC_VM_ZFILL_FAULTS);
vm_stat.zero_fill_count++;
+ current_task()->zero_fills;
vm_object_lock(object);
pmap_clear_modify(m->phys_addr);
break;
@@ -855,6 +860,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_stat.cow_faults++;
vm_stat_sample(SAMPLED_PC_VM_COW_FAULTS);
+ current_task()->cow_faults;
object = first_object;
offset = first_offset;
@@ -1638,6 +1644,7 @@ kern_return_t vm_fault_wire_fast(map, va, entry)
vm_prot_t prot;
vm_stat.faults++; /* needs lock XXX */
+ current_task()->faults++;
/*
* Recovery actions
*/