Added counting of different file types to vm integrity tests.

This commit is contained in:
Bahadir Balban
2008-10-25 12:50:31 +03:00
parent cb9b02a24e
commit 12c5389e85
2 changed files with 21 additions and 6 deletions

View File

@@ -22,6 +22,7 @@
#include <shm.h>
#include <utcb.h>
#include <mmap.h>
#include <test.h>
void handle_requests(void)
{
@@ -54,6 +55,7 @@ void handle_requests(void)
switch(tag) {
case L4_IPC_TAG_SYNC:
mm0_test_global_vm_integrity();
// printf("%s: Synced with waiting thread.\n", __TASKNAME__);
/* This has no receive phase */
return;

View File

@@ -12,13 +12,16 @@
#include <globals.h>
struct vm_statistics {
int tasks;
int vm_objects;
int tasks; /* All tasks counted on the system */
int vm_objects; /* All objects counted on the system */
int shadow_objects; /* Shadows counted by hand (well almost!) */
int shadows_referred; /* Shadows that objects say they have */
int file_objects;
int vm_files;
int tasks_total;
int file_objects; /* Objects that are found to be files */
int vm_files; /* All files counted on the system */
int shm_files; /* SHM files counted */
int boot_files; /* Boot files counted */
int vfs_files; /* VFS files counted */
int devzero; /* Devzero count, must be 1 */
};
/* Count links in objects link list, and compare with nlinks */
@@ -69,8 +72,18 @@ int mm0_test_global_vm_integrity(void)
}
/* Count all registered vmfiles */
list_for_each_entry(f, &global_vm_files.list, list)
list_for_each_entry(f, &global_vm_files.list, list) {
vmstat.vm_files++;
if (f->type == VM_FILE_SHM)
vmstat.shm_files++;
else if (f->type == VM_FILE_BOOTFILE)
vmstat.boot_files++;
else if (f->type == VM_FILE_VFS)
vmstat.vfs_files++;
else if (f->type == VM_FILE_DEVZERO)
vmstat.devzero++;
else BUG();
}
if (vmstat.vm_files != global_vm_files.total) {
printf("Total counted files don't match "