Changeset: 9bb337807558 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9bb337807558
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
monetdb5/modules/kernel/status.c
monetdb5/modules/kernel/status.mal
Branch: Aug2018
Log Message:
Store getrusage and times calls as lng instead of int to avoid truncation of
values.
diffs (120 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -11036,9 +11036,9 @@ Ready.
[ "sqlcatalog", "revoke_function", "pattern
sqlcatalog.revoke_function(sname:str, fcnid:int, grantee:str, privs:int,
grant:int, grantor:int):void ", "SQLrevoke_function;", "Catalog
operation revoke_function" ]
[ "sqlcatalog", "revoke_roles", "pattern
sqlcatalog.revoke_roles(sname:str, auth:str, grantor:int, admin:int):void ",
"SQLrevoke_roles;", "Catalog operation revoke_roles" ]
[ "status", "batStatistics", "command status.batStatistics()
(X_0:bat[:str], X_1:bat[:str]) ", "SYSgdkEnv;", "Show distribution of
bats by kind" ]
-[ "status", "cpuStatistics", "command status.cpuStatistics()
(X_0:bat[:str], X_1:bat[:int]) ", "SYScpuStatistics;", "Global cpu
usage information" ]
+[ "status", "cpuStatistics", "command status.cpuStatistics()
(X_0:bat[:str], X_1:bat[:lng]) ", "SYScpuStatistics;", "Global cpu
usage information" ]
[ "status", "getThreads", "command status.getThreads() (X_0:bat[:int],
X_1:bat[:str]) ", "SYSgdkThread;", "Produce overview of active threads"
]
-[ "status", "ioStatistics", "command status.ioStatistics() (X_0:bat[:str],
X_1:bat[:int]) ", "SYSioStatistics;", "Global IO activity
information" ]
+[ "status", "ioStatistics", "command status.ioStatistics() (X_0:bat[:str],
X_1:bat[:lng]) ", "SYSioStatistics;", "Global IO activity
information" ]
[ "status", "memStatistics", "command status.memStatistics()
(X_0:bat[:str], X_1:bat[:lng]) ", "SYSmemStatistics;", "Global memory
usage information" ]
[ "status", "memUsage", "command status.memUsage(minsize:lng)
(X_0:bat[:str], X_1:bat[:lng]) ", "SYSmem_usage;", "Get a split-up of
how much memory blocks are in use" ]
[ "status", "mem_cursize", "command status.mem_cursize():lng ",
"SYSgetmem_cursize;", "The amount of physical swapspace in KB that is
currently in use" ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -15249,9 +15249,9 @@ Ready.
[ "sqlcatalog", "revoke_function", "pattern
sqlcatalog.revoke_function(sname:str, fcnid:int, grantee:str, privs:int,
grant:int, grantor:int):void ", "SQLrevoke_function;", "Catalog
operation revoke_function" ]
[ "sqlcatalog", "revoke_roles", "pattern
sqlcatalog.revoke_roles(sname:str, auth:str, grantor:int, admin:int):void ",
"SQLrevoke_roles;", "Catalog operation revoke_roles" ]
[ "status", "batStatistics", "command status.batStatistics()
(X_0:bat[:str], X_1:bat[:str]) ", "SYSgdkEnv;", "Show distribution of
bats by kind" ]
-[ "status", "cpuStatistics", "command status.cpuStatistics()
(X_0:bat[:str], X_1:bat[:int]) ", "SYScpuStatistics;", "Global cpu
usage information" ]
+[ "status", "cpuStatistics", "command status.cpuStatistics()
(X_0:bat[:str], X_1:bat[:lng]) ", "SYScpuStatistics;", "Global cpu
usage information" ]
[ "status", "getThreads", "command status.getThreads() (X_0:bat[:int],
X_1:bat[:str]) ", "SYSgdkThread;", "Produce overview of active threads"
]
-[ "status", "ioStatistics", "command status.ioStatistics() (X_0:bat[:str],
X_1:bat[:int]) ", "SYSioStatistics;", "Global IO activity
information" ]
+[ "status", "ioStatistics", "command status.ioStatistics() (X_0:bat[:str],
X_1:bat[:lng]) ", "SYSioStatistics;", "Global IO activity
information" ]
[ "status", "memStatistics", "command status.memStatistics()
(X_0:bat[:str], X_1:bat[:lng]) ", "SYSmemStatistics;", "Global memory
usage information" ]
[ "status", "memUsage", "command status.memUsage(minsize:lng)
(X_0:bat[:str], X_1:bat[:lng]) ", "SYSmem_usage;", "Get a split-up of
how much memory blocks are in use" ]
[ "status", "mem_cursize", "command status.mem_cursize():lng ",
"SYSgetmem_cursize;", "The amount of physical swapspace in KB that is
currently in use" ]
diff --git a/monetdb5/modules/kernel/status.c b/monetdb5/modules/kernel/status.c
--- a/monetdb5/modules/kernel/status.c
+++ b/monetdb5/modules/kernel/status.c
@@ -121,12 +121,12 @@ static struct tms state;
str
SYScpuStatistics(bat *ret, bat *ret2)
{
- int i;
+ lng i;
BAT *b, *bn;
#ifdef HAVE_TIMES
struct tms newst;
# ifndef HZ
- static int HZ;
+ static int HZ = 0;
if (HZ == 0) {
# if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
@@ -139,7 +139,7 @@ SYScpuStatistics(bat *ret, bat *ret2)
#endif
bn = COLnew(0, TYPE_str, 32, TRANSIENT);
- b = COLnew(0, TYPE_int, 32, TRANSIENT);
+ b = COLnew(0, TYPE_lng, 32, TRANSIENT);
if (b == 0 || bn == 0){
if ( b) BBPunfix(b->batCacheid);
if ( bn) BBPunfix(bn->batCacheid);
@@ -152,7 +152,7 @@ SYScpuStatistics(bat *ret, bat *ret2)
}
times(&newst);
/* store counters, ignore errors */
- i = (int) (time(0) - clk);
+ i = (lng) (time(0) - clk);
if (BUNappend(bn, "elapsed", false) != GDK_SUCCEED ||
BUNappend(b, &i, false) != GDK_SUCCEED)
goto bailout;
@@ -175,7 +175,7 @@ SYScpuStatistics(bat *ret, bat *ret2)
state = newst;
#else
- i = int_nil;
+ i = lng_nil;
if (BUNappend(bn, "elapsed", false) != GDK_SUCCEED ||
BUNappend(b, &i, false) != GDK_SUCCEED ||
BUNappend(bn, "user", false) != GDK_SUCCEED ||
@@ -487,14 +487,14 @@ SYSioStatistics(bat *ret, bat *ret2)
#ifndef NATIVE_WIN32
struct rusage ru;
#endif
- int i;
+ lng i;
BAT *b, *bn;
#ifndef NATIVE_WIN32
getrusage(RUSAGE_SELF, &ru);
#endif
bn = COLnew(0, TYPE_str, 32, TRANSIENT);
- b = COLnew(0, TYPE_int, 32, TRANSIENT);
+ b = COLnew(0, TYPE_lng, 32, TRANSIENT);
if (b == 0 || bn == 0) {
if ( b) BBPunfix(b->batCacheid);
if ( bn) BBPunfix(bn->batCacheid);
@@ -536,7 +536,7 @@ SYSioStatistics(bat *ret, bat *ret2)
BUNappend(b, &i, false) != GDK_SUCCEED)
goto bailout;
#else
- i = int_nil;
+ i = lng_nil;
if (BUNappend(bn, "maxrss", false) != GDK_SUCCEED ||
BUNappend(b, &i, false) != GDK_SUCCEED ||
BUNappend(bn, "minflt", false) != GDK_SUCCEED ||
diff --git a/monetdb5/modules/kernel/status.mal
b/monetdb5/modules/kernel/status.mal
--- a/monetdb5/modules/kernel/status.mal
+++ b/monetdb5/modules/kernel/status.mal
@@ -6,13 +6,13 @@
module status;
-command cpuStatistics()(:bat[:str],:bat[:int] )
+command cpuStatistics()(:bat[:str],:bat[:lng] )
address SYScpuStatistics
comment "Global cpu usage information";
command memStatistics() (:bat[:str],:bat[:lng] )
address SYSmemStatistics
comment "Global memory usage information";
-command ioStatistics()(:bat[:str],:bat[:int] )
+command ioStatistics()(:bat[:str],:bat[:lng] )
address SYSioStatistics
comment "Global IO activity information";
command vmStatistics(minsize:lng)(:bat[:str],:bat[:lng] )
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list