* Added a debugger command "info" that dumps some basic system usage info.

* Renamed OBOS_ARCH macro to HAIKU_ARCH.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16608 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-03-06 13:40:36 +00:00
parent d98d96e9e5
commit d3fbce573c
2 changed files with 37 additions and 5 deletions

View File

@ -1,9 +1,8 @@
SubDir HAIKU_TOP src system kernel ;
{
# TODO: Rename the macro OBOS_ARCH to TARGET_ARCH, or something like that.
local defines =
OBOS_ARCH=\\\"$(TARGET_ARCH)\\\"
HAIKU_ARCH=\\\"$(TARGET_ARCH)\\\"
;
defines = [ FDefines $(defines) ] ;

View File

@ -1,6 +1,10 @@
/*
* Copyright 2004, Stefano Ceccherini. All rights reserved.
* Distributed under the terms of the MIT License.
* Copyright (c) 2004-2006, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
* Stefano Ceccherini
* Axel Dörfler, axeld@pinc-software.de
*/
@ -25,7 +29,34 @@
const static int64 kKernelVersion = 0x1;
const static char kKernelName[] = "kernel_" OBOS_ARCH;
const static char *kKernelName = "kernel_" HAIKU_ARCH;
static int
dump_info(int argc, char **argv)
{
int32 i;
kprintf("kernel build: %s %s\n\n", __DATE__, __TIME__);
kprintf("cpu count: %ld, active times:\n", smp_get_num_cpus());
for (i = 0; i < smp_get_num_cpus(); i++)
kprintf(" [%ld] %Ld\n", i + 1, cpu_get_active_time(i));
// ToDo: Add page_faults
kprintf("pages:\t\t%ld (%ld max)\n", vm_page_num_pages() - vm_page_num_free_pages(),
vm_page_num_pages());
kprintf("sems:\t\t%ld (%ld max)\n", sem_used_sems(), sem_max_sems());
kprintf("ports:\t\t%ld (%ld max)\n", port_used_ports(), port_max_ports());
kprintf("threads:\t%ld (%ld max)\n", thread_used_threads(), thread_max_threads());
kprintf("teams:\t\t%ld (%ld max)\n", team_used_teams(), team_max_teams());
return 0;
}
// #pragma mark -
status_t
@ -70,6 +101,8 @@ _get_system_info(system_info *info, size_t size)
status_t
system_info_init(struct kernel_args *args)
{
add_debugger_command("info", &dump_info, "System info");
return arch_system_info_init(args);
}