* Reenabled used page reporting based on vm_available_memory().
* Prettyfied memory info in the sysinfo app. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24746 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6b53669383
commit
4f5bc0cfe9
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright (c) 2002, Carlos Hasan, for Haiku.
|
||||
*
|
||||
* Distributed under the terms of the MIT license.
|
||||
|
@ -307,7 +307,7 @@ print_features(uint32 features)
|
|||
"PAT", "PSE36", "PSN", "CFLUSH",
|
||||
NULL, "DS", "ACPI", "MMX",
|
||||
"FXSTR", "SSE", "SSE2", "SS",
|
||||
"HTT", "TM", NULL, "PBE",
|
||||
"HTT", "TM", NULL, "PBE",
|
||||
};
|
||||
int32 found = 0;
|
||||
int32 i;
|
||||
|
@ -517,11 +517,12 @@ dump_cpus(system_info *info)
|
|||
static void
|
||||
dump_mem(system_info *info)
|
||||
{
|
||||
printf("%10lu bytes free (used/cached/max %10lu / %10lu / %10lu)\n",
|
||||
printf("%10lu bytes free (used/max %10lu / %10lu)\n",
|
||||
B_PAGE_SIZE * (uint32)(info->max_pages - info->used_pages),
|
||||
B_PAGE_SIZE * (uint32)info->used_pages,
|
||||
B_PAGE_SIZE * (uint32)info->cached_pages,
|
||||
B_PAGE_SIZE * (uint32)info->max_pages);
|
||||
printf(" (cached %10lu)\n",
|
||||
B_PAGE_SIZE * (uint32)info->cached_pages);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,15 +77,12 @@ _get_system_info(system_info *info, size_t size)
|
|||
for (int32 i = 0; i < info->cpu_count; i++)
|
||||
info->cpu_infos[i].active_time = cpu_get_active_time(i);
|
||||
|
||||
// ToDo: Add page_faults
|
||||
// TODO: Add page_faults
|
||||
info->max_pages = vm_page_num_pages();
|
||||
info->used_pages = info->max_pages - vm_page_num_free_pages();
|
||||
|
||||
/* TODO: return to using these once sAvailableMemory yields correct values.
|
||||
info->used_pages = vm_page_num_pages() - vm_page_num_available_pages();
|
||||
info->cached_pages = vm_page_num_pages() - vm_page_num_free_pages()
|
||||
info->used_pages = info->max_pages - vm_page_num_available_pages();
|
||||
info->cached_pages = info->max_pages - vm_page_num_free_pages()
|
||||
- info->used_pages;
|
||||
*/
|
||||
|
||||
info->used_threads = thread_used_threads();
|
||||
info->max_threads = thread_max_threads();
|
||||
info->used_teams = team_used_teams();
|
||||
|
@ -105,7 +102,7 @@ _get_system_info(system_info *info, size_t size)
|
|||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
system_info_init(struct kernel_args *args)
|
||||
{
|
||||
add_debugger_command("info", &dump_info, "System info");
|
||||
|
|
Loading…
Reference in New Issue