* Implemented a (private for now) get_system_info_etc() call, that can retrieve

various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
  accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-09-17 16:27:17 +00:00
parent b0a63e7a2a
commit ca7cb625b9
16 changed files with 282 additions and 48 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_SYSTEM_INFO_H
@@ -16,12 +16,14 @@ extern "C" {
#endif
extern status_t system_info_init(struct kernel_args *args);
extern uint32 get_haiku_revision(void);
extern uint32 get_haiku_revision(void);
extern status_t _user_get_system_info(system_info *userInfo, size_t size);
extern status_t _user_get_system_info_etc(int32 id, void *buffer,
size_t bufferSize);
#ifdef __cplusplus
}
#endif
#endif /* _KRENEL_SYSTEM_INFO_H */
#endif /* _KERNEL_SYSTEM_INFO_H */
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2002-2008, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -16,6 +16,7 @@
struct kernel_args;
struct team;
struct system_memory_info;
struct vm_page;
struct VMCache;
struct vm_area;
@@ -93,6 +94,8 @@ status_t vm_map_page(struct vm_area *area, struct vm_page *page, addr_t address,
status_t vm_get_physical_page(addr_t paddr, addr_t *vaddr, uint32 flags);
status_t vm_put_physical_page(addr_t vaddr);
void vm_get_info(struct system_memory_info *info);
uint32 vm_num_page_faults(void);
off_t vm_available_memory(void);
off_t vm_available_not_needed_memory(void);
+2
View File
@@ -406,6 +406,8 @@ extern int64 _kern_atomic_get64(vint64 *value);
/* System informations */
extern status_t _kern_get_system_info(system_info *info, size_t size);
extern status_t _kern_get_system_info_etc(int32 id, void *buffer,
size_t bufferSize);
extern status_t _kern_analyze_scheduling(bigtime_t from, bigtime_t until,
void* buffer, size_t size,
struct scheduling_analysis* analysis);
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright 2008 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYSTEM_INFO_H
#define _SYSTEM_INFO_H
#include <OS.h>
#define B_MEMORY_INFO 'memo'
struct system_memory_info {
uint64 max_memory;
uint64 free_memory;
uint64 needed_memory;
uint64 max_swap_space;
uint64 free_swap_space;
uint64 block_cache_memory;
uint32 page_faults;
// TODO: add active/inactive page counts, swap in/out, ...
};
#ifdef __cplusplus
extern "C" {
#endif
extern status_t get_system_info_etc(int32 id, void *buffer, size_t bufferSize);
#ifdef __cplusplus
}
#endif
#endif /* _SYSTEM_INFO_H */