Changeset: 4ac14d7665af for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ac14d7665af
Modified Files:
        monetdb5/modules/kernel/status.c
        monetdb5/modules/kernel/status.h
        monetdb5/modules/kernel/status.mal
Branch: headless
Log Message:

Moving status to COL world


diffs (truncated from 997 to 300 lines):

diff --git a/monetdb5/modules/kernel/status.mx 
b/monetdb5/modules/kernel/status.c
copy from monetdb5/modules/kernel/status.mx
copy to monetdb5/modules/kernel/status.c
--- a/monetdb5/modules/kernel/status.mx
+++ b/monetdb5/modules/kernel/status.c
@@ -1,144 +1,34 @@
-@/
-The contents of this file are subject to the MonetDB Public License
-Version 1.1 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+ * 
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * The Original Code is the MonetDB Database System.
+ * 
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2011 MonetDB B.V.
+ * All Rights Reserved.
+*/
 
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations
-under the License.
+/* Author(s) M.L. Kersten, P. Boncz, N.Nes
+ * System state information 
+ * This document introduces a series of bats  and operations that provide 
access
+ * to information stored within the Monet Version 5 internal data structures.
+ * In all cases, pseudo BAT operation returns a transient BAT that
+ * should be garbage collected after being used.
+ * 
+ * The main performance drain would be to use a pseudo BAT directly to
+ * successively access it components. This can be avoided by first assigning
+ * the pseudo BAT to a variable.
+*/
 
-The Original Code is the MonetDB Database System.
-
-The Initial Developer of the Original Code is CWI.
-Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-Copyright August 2008-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f status
-@a M.L. Kersten, P. Boncz, N.Nes
-@v 2.0
-@+ System state information 
-This document introduces a series of bats  and operations that provide access
-to information stored within the Monet Version 5 internal data structures.
-In all cases, pseudo BAT operation returns a transient BAT that
-should be garbage collected after being used.
-
-The main performance drain would be to use a pseudo BAT directly to
-successively access it components. This can be avoided by first assigning
-the pseudo BAT to a variable.
-@{
-@mal
-module status;
-
-command cpuStatistics() (lo:col[:str],ro:col[:int] )
-address SYScpuStatistics
-comment "Global cpu usage information";
-command memStatistics() (lo:col[:str], ro:col[:wrd] )
-address SYSmemStatistics
-comment "Global memory usage information";
-command ioStatistics() (lo:col[:str],ro:col[:int] )
-address SYSioStatistics
-comment "Global IO activity information";
-command vmStatistics(minsize:lng) (lo:col[:str],ro:col[:lng] )
-address SYSvm_usage
-comment "Get a split-up of how much virtual memory blocks are in use";
-command memUsage(minsize:lng)(lo:col[:str],ro:col[:lng] )
-address SYSmem_usage
-comment "Get a split-up of how much memory blocks are in use";
-@-
-Some explanation of what mem_usage() and vm_usage() display:
-@verbatim
-> m:= status.memUsage(1024:lng); io.print(m);
-#------------------------------#
-# BAT:                 tmp_42  #
-# (str)                (lng)   #
-#------------------------------#
-[ "buns/car_category",  400012 ] 100.000 string offsets
-[ "buns/car_town",      400012 ] idem
-[ "buns/car_class",     400012 ] idem
-[ "tail/car_category",  266244 ] string tail heap
-[ "tail/car_town",      266244 ] idem
-[ "tail/car_class",     266244 ] idem
-[ "_tot/buns",         1322996 ] the three bun heaps
-[ "_tot/tail",          967762 ] the three tail heaps
-[ "_tot/head",           70984 ] negligable
-[ "_tot/cbp",            98866 ] CBP metadata structure
-[ "_tot/mil",           102400 ] MIL interpreter stack space
-[ "_tot/found",        2590144 ] buns+head+tail+bbp+mil
-[ "_tot/malloc_heap",  2956048 ] in malloc heap
-[ "_tot/malloc",       2956048 ] total consumed via malloc
-[ "_tot/valloc",        201266 ] total consumed via virtualalloc
-[ "_tot/mem",          3157314 ] total RAM+swap-file consumption
-
->
-> v:= status.vmStatistics(1024:lng); io.print(v);
-#------------------------------#
-# BAT:               tmp_42    #
-# (str)              (lng)     #
-#------------------------------#
-[ "_tot/bbp",        50331648  ] 50MB reserved (100KB claimed)
-[ "_tot/mil",        16777216  ] 16MB reserved (100KB claimed)
-[ "_tot/found",      67108864  ] bbp+mil
-[ "_tot/vm",         71244560  ] total address space consumption
->
-@end verbatim
-@+ MAL runtime status 
-@mal
-command batStatistics()(lo:col[:str],ro:col[:str] )
-address SYSgdkEnv
-comment "Show distribution of bats by kind";
-command getThreads()(lo:col[:int],ro:col[:str])
-address SYSgdkThread
-comment "Produce overview of active threads";
-
-command mem_cursize():lng 
-address SYSgetmem_cursize
-comment "The amount of physical swapspace in KB that is currently in use";
-
-command mem_maxsize():lng 
-address SYSgetmem_maxsize
-comment "The maximum usable amount of physical swapspace in KB (target only)";
-
-command mem_maxsize(v:lng):void 
-address SYSsetmem_maxsize
-comment "Set the maximum usable amount of physical swapspace in KB";
-
-command vm_cursize():lng 
-address SYSgetvm_cursize
-comment "The amount of logical VM space in KB that is currently in use";
-
-command vm_maxsize():lng 
-address SYSgetvm_maxsize
-comment "The maximum usable amount of logical VM space in KB (target only)";
-
-command vm_maxsize(v:lng):void 
-address SYSsetvm_maxsize
-comment "Set the maximum usable amount of physical swapspace in KB";
-
-@+ Implementation Code
-@h
-#ifndef _SYS_H_
-#define _SYS_H_
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
-#define status_export extern __declspec(dllimport)
-#else
-#define status_export extern __declspec(dllexport)
-#endif
-#else
-#define status_export extern
-#endif
-
-
-#endif
-@-
-
-@include kprelude.mx
-@c
 #include "monetdb_config.h"
 #include "gdk.h"
 #include <stdarg.h>
@@ -157,9 +47,6 @@
 # include <sys/resource.h>
 #endif
 
-@h
-status_export str SYSgetmem_cursize(lng *num);
-@c
 str
 SYSgetmem_cursize(lng *num)
 {
@@ -167,9 +54,6 @@
        return MAL_SUCCEED;
 }
 
-@h
-status_export str SYSgetmem_maxsize(lng *num);
-@c
 str
 SYSgetmem_maxsize(lng *num)
 {
@@ -177,9 +61,6 @@
        return MAL_SUCCEED;
 }
 
-@h
-status_export str SYSsetmem_maxsize(int *ret, lng *num);
-@c
 str
 SYSsetmem_maxsize(int *ret, lng *num)
 {
@@ -200,9 +81,6 @@
        return MAL_SUCCEED;
 }
 
-@h
-status_export str SYSgetvm_cursize(lng *num);
-@c
 str
 SYSgetvm_cursize(lng *num)
 {
@@ -210,9 +88,6 @@
        return MAL_SUCCEED;
 }
 
-@h
-status_export str SYSgetvm_maxsize(lng *num);
-@c
 str
 SYSgetvm_maxsize(lng *num)
 {
@@ -220,9 +95,6 @@
        return MAL_SUCCEED;
 }
 
-@h
-status_export str SYSsetvm_maxsize(lng *num);
-@c
 str
 SYSsetvm_maxsize(lng *num)
 {
@@ -230,32 +102,30 @@
        return MAL_SUCCEED;
 }
 
-@- Performance
-To obtain a good impression of the Monet performance we need timing 
information.
-The most detailed information is best obtained with the system profiler.
+/* Performance
+ * To obtain a good impression of the Monet performance we need timing 
information.
+ * The most detailed information is best obtained with the system profiler.
+ * 
+ * However, the direct approach is to enable the user to read the timers 
maintained
+ * internally. This is done with the CPU, IO, MEMORY, and CBP command which
+ * displays the elapsed time in seconds, user- and system-cpu time in 
milliseconds
+ * since its last invocation and the amount of space in use.  The process
+ * identifier is used to differentiate among the possible processes.
+ * 
+ * Note that in multi threaded mode the routine prints the elapsed
+ * time since the beginning of each process.
+*/
 
-However, the direct approach is to enable the user to read the timers 
maintained
-internally. This is done with the CPU, IO, MEMORY, and CBP command which
-displays the elapsed time in seconds, user- and system-cpu time in milliseconds
-since its last invocation and the amount of space in use.  The process
-identifier is used to differentiate among the possible processes.
-
-Note that in multi threaded mode the routine prints the elapsed
-time since the beginning of each process.
-@c
 #ifdef HAVE_TIMES
 static time_t clk = 0;
 static struct tms state;
 #endif
 
-@h
-status_export str SYScpuStatistics(int *ret);
-@c
 str
-SYScpuStatistics(int *ret)
+SYScpuStatistics(int *ret, int *ret2)
 {
        int i;
-       BAT *b;
+       COL *b, *bs;
 #ifdef HAVE_TIMES
        struct tms newst;
 # ifndef HZ
@@ -271,8 +141,9 @@
 # endif
 #endif
 
-       b = BATnew(TYPE_str, TYPE_int, 32);
-       if (b == 0)
+       b  = BATnew(TYPE_str, 32);
+       bs = BATnew(TYPE_int, 32);
+       if (b == 0 || bs == 0)
                throw(MAL, "status.cpuStatistics", MAL_MALLOC_FAIL);
 #ifdef HAVE_TIMES
        if (clk == 0) {
@@ -282,45 +153,54 @@
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to