Changeset: f661ef7b96f9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f661ef7b96f9 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 gdk/gdk_aggr.c gdk/gdk_batop.c gdk/gdk_hash.c gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_join.c gdk/gdk_orderidx.c gdk/gdk_project.c gdk/gdk_select.c gdk/gdk_storage.c monetdb5/mal/mal_resolve.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/oltp.c monetdb5/optimizer/opt_commonTerms.c monetdb5/optimizer/opt_dataflow.c monetdb5/scheduler/run_pipeline.c Branch: gdk_tracer Log Message:
merged diffs (truncated from 752 to 300 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 @@ -12193,6 +12193,7 @@ stdout of test 'MAL-signatures` in direc [ "wlr", "drop_user", "pattern wlr.drop_user(sname:str, action:int):void ", "WLRgeneric;", "Catalog operation drop_user" ] [ "wlr", "drop_user", "pattern wlr.drop_user(sname:str, auth:str, action:int):void ", "WLRgeneric;", "Catalog operation drop_user" ] [ "wlr", "drop_view", "pattern wlr.drop_view(sname:str, name:str, action:int, ifexists:int):void ", "WLRgeneric;", "Catalog operation drop_view" ] +[ "wlr", "getMaster", "pattern wlr.getMaster():str ", "WLRgetmaster;", "What is the current master database" ] [ "wlr", "getclock", "pattern wlr.getclock():str ", "WLRgetclock;", "Timestamp of last replicated transaction." ] [ "wlr", "gettick", "pattern wlr.gettick():lng ", "WLRgettick;", "Transaction identifier of the last replicated transaction." ] [ "wlr", "grant", "pattern wlr.grant(sname:str, tbl:str, grantee:str, privs:int, cname:str, gr:int, grantor:int):void ", "WLRgeneric;", "Catalog operation grant" ] 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 @@ -16613,6 +16613,7 @@ stdout of test 'MAL-signatures` in direc [ "wlr", "drop_user", "pattern wlr.drop_user(sname:str, action:int):void ", "WLRgeneric;", "Catalog operation drop_user" ] [ "wlr", "drop_user", "pattern wlr.drop_user(sname:str, auth:str, action:int):void ", "WLRgeneric;", "Catalog operation drop_user" ] [ "wlr", "drop_view", "pattern wlr.drop_view(sname:str, name:str, action:int, ifexists:int):void ", "WLRgeneric;", "Catalog operation drop_view" ] +[ "wlr", "getMaster", "pattern wlr.getMaster():str ", "WLRgetmaster;", "What is the current master database" ] [ "wlr", "getclock", "pattern wlr.getclock():str ", "WLRgetclock;", "Timestamp of last replicated transaction." ] [ "wlr", "gettick", "pattern wlr.gettick():lng ", "WLRgettick;", "Transaction identifier of the last replicated transaction." ] [ "wlr", "grant", "pattern wlr.grant(sname:str, tbl:str, grantee:str, privs:int, cname:str, gr:int, grantor:int):void ", "WLRgeneric;", "Catalog operation grant" ] diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c --- a/gdk/gdk_aggr.c +++ b/gdk/gdk_aggr.c @@ -893,11 +893,10 @@ BATgroupsum(BAT *b, BAT *g, BAT *e, BAT BUN ncand; const char *err; const char *algo = NULL; - lng t0 = 0; + lng t0 = GDKusec(); /* CHECK */ // This is in ALGODEBUG - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &ci, &ncand)) != NULL) { GDKerror("BATgroupsum: %s\n", err); @@ -968,11 +967,10 @@ BATsum(void *res, int tp, BAT *b, BAT *s BUN ncand; const char *err; const char *algo = NULL; - lng t0 = 0; + lng t0 = GDKusec(); /* CHECK */ // This is in ALGODEBUG - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); if ((err = BATgroupaggrinit(b, NULL, NULL, s, &min, &max, &ngrp, &ci, &ncand)) != NULL) { GDKerror("BATsum: %s\n", err); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -506,16 +506,11 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f return GDK_FAIL; } - /* CHECK */ - // The whole if statement is in DEBUG CHECK_ - TRC_DEBUG_IF(CHECK_) - { - if (BATttype(b) != BATttype(n) && + if (BATttype(b) != BATttype(n) && ATOMtype(b->ttype) != ATOMtype(n->ttype)) { - TRC_DEBUG_ENDIF(CHECK_, "Interpreting %s as %s.\n", + TRC_DEBUG(CHECK_, "Interpreting %s as %s.\n", ATOMname(BATttype(n)), ATOMname(BATttype(b))); } - } cnt = canditer_init(&ci, n, s); if (cnt == 0) { @@ -1447,11 +1442,10 @@ BATkeyed(BAT *b) bool BATordered(BAT *b) { - lng t0 = 0; + lng t0 = GDKusec(); /* CHECK */ // This is in DEBUGALGO - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); if (b->ttype == TYPE_void) return true; @@ -1537,11 +1531,7 @@ BATordered(BAT *b) bool BATordered_rev(BAT *b) { - lng t0 = 0; - - /* CHECK */ - // This is in DEBUGALGO - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); + lng t0 = GDKusec(); if (b == NULL) return false; @@ -1635,13 +1625,9 @@ BATsort(BAT **sorted, BAT **order, BAT * BAT *bn = NULL, *on = NULL, *gn = NULL, *pb = NULL; oid *restrict grps, *restrict ords, prev; BUN p, q, r; - lng t0 = 0; + lng t0 = GDKusec(); bool mkorderidx, orderidxlock = false; - /* CHECK */ - // This is in DEBUGALGO - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); - /* we haven't implemented NILs as largest value for stable * sort, so NILs come first for ascending and last for * descending */ @@ -2096,11 +2082,10 @@ BATconstant(oid hseq, int tailtype, cons BAT *bn; void *restrict p; BUN i; - lng t0 = 0; + lng t0 = GDKusec(); /* CHECK */ // This is in DEBUGALGO - TRC_DEBUG_IF(ALGO) t0 = GDKusec(); if (v == NULL) return NULL; diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c --- a/gdk/gdk_hash.c +++ b/gdk/gdk_hash.c @@ -167,14 +167,13 @@ bool BATcheckhash(BAT *b) { bool ret; - lng t = 0; + lng t = GDKusec(); /* we don't need the lock just to read the value b->thash */ if (b->thash == (Hash *) 1) { /* but when we want to change it, we need the lock */ - TRC_DEBUG_IF(ACCELERATOR) t = GDKusec(); MT_lock_set(&b->batIdxLock); - TRC_DEBUG_IF(ACCELERATOR) t = GDKusec() - t; + t = GDKusec() - t; /* if still 1 now that we have the lock, we can update */ if (b->thash == (Hash *) 1) { Hash *h; @@ -249,7 +248,8 @@ BATcheckhash(BAT *b) MT_lock_unset(&b->batIdxLock); } ret = b->thash != NULL; - TRC_DEBUG_IF(ACCELERATOR) if (ret) TRC_DEBUG_ENDIF(ACCELERATOR, "Already has hash %s, waited " LLFMT " usec\n", BATgetId(b), t); + if( ret) + TRC_DEBUG(ACCELERATOR, "Already has hash %s, waited " LLFMT " usec\n", BATgetId(b), t); return ret; } @@ -259,10 +259,9 @@ BAThashsync(void *arg) { BAT *b = arg; int fd; - lng t0 = 0; + lng t0 = GDKusec(); const char *failed = " failed"; - TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec(); /* we could check whether b->thash == NULL before getting the * lock, and only lock if it isn't; however, it's very @@ -351,7 +350,7 @@ BAThashsync(void *arg) Hash * BAThash_impl(BAT *b, BAT *s, const char *ext) { - lng t0 = 0; + lng t0 = GDKusec(); unsigned int tpe = ATOMbasetype(b->ttype); BUN cnt, cnt1; struct canditer ci; @@ -365,8 +364,7 @@ BAThash_impl(BAT *b, BAT *s, const char BATiter bi = bat_iterator(b); PROPrec *prop; - TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec(); - TRC_DEBUG_IF(ACCELERATOR) TRC_DEBUG_ENDIF(ACCELERATOR, "Create hash(" ALGOBATFMT ");\n", ALGOBATPAR(b)); + TRC_DEBUG(ACCELERATOR, "Create hash(" ALGOBATFMT ");\n", ALGOBATPAR(b)); if (b->ttype == TYPE_void) { if (is_oid_nil(b->tseqbase)) { diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c --- a/gdk/gdk_heap.c +++ b/gdk/gdk_heap.c @@ -857,7 +857,7 @@ HEAP_printstatus(Heap *heap) size_t block, cur_free = hheader->head; CHUNK *blockp; - TRC_DEBUG_ENDIF(TRACE, "HEAP has head %zu and alignment %d and size %zu\n", + TRC_DEBUG(TRACE, "HEAP has head %zu and alignment %d and size %zu\n", hheader->head, hheader->alignment, heap->free); /* Walk the blocklist */ @@ -867,7 +867,7 @@ HEAP_printstatus(Heap *heap) blockp = HEAP_index(heap, block, CHUNK); if (block == cur_free) { - TRC_DEBUG_ENDIF(TRACE, "Free block at %p has size %zu and next %zu\n", + TRC_DEBUG(TRACE, "Free block at %p has size %zu and next %zu\n", (void *)block, blockp->size, blockp->next); @@ -876,7 +876,7 @@ HEAP_printstatus(Heap *heap) } else { size_t size = blocksize(hheader, blockp); - TRC_DEBUG_ENDIF(TRACE, "Block at %zu with size %zu\n", + TRC_DEBUG(TRACE, "Block at %zu with size %zu\n", block, size); block += size; } @@ -906,11 +906,9 @@ HEAP_empty(Heap *heap, size_t nprivate, assert(heap->size - head <= VAR_MAX); headp->size = (size_t) (heap->size - head); headp->next = 0; - /* CHECK */ - // HEAP_printstatus is also in if DEBUG-TRACE TRC_DEBUG_IF(TRACE) { - TRC_DEBUG_ENDIF(TRACE, "We created the following heap\n"); + TRC_DEBUG(TRACE, "We created the following heap\n"); HEAP_printstatus(heap); } } diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c --- a/gdk/gdk_imprints.c +++ b/gdk/gdk_imprints.c @@ -267,7 +267,8 @@ BATcheckimprints(BAT *b) MT_lock_unset(&b->batIdxLock); } ret = b->timprints != NULL; - TRC_DEBUG_IF(ACCELERATOR) if (ret) TRC_DEBUG_ENDIF(ACCELERATOR, "BATcheckimprints(" ALGOBATFMT "): already has imprints\n", ALGOBATPAR(b)); + if( ret) + TRC_DEBUG(ACCELERATOR, "BATcheckimprints(" ALGOBATFMT "): already has imprints\n", ALGOBATPAR(b)); return ret; } @@ -277,11 +278,9 @@ BATimpsync(void *arg) BAT *b = arg; Imprints *imprints; int fd; - lng t0 = 0; + lng t0 = GDKusec(); const char *failed = " failed"; - TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec(); - MT_lock_set(&b->batIdxLock); if ((imprints = b->timprints) != NULL) { Heap *hp = &imprints->imprints; @@ -339,7 +338,7 @@ BATimprints(BAT *b) { BAT *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL; Imprints *imprints; - lng t0 = 0; + lng t0 = GDKusec(); /* we only create imprints for types that look like types we know */ switch (ATOMbasetype(b->ttype)) { @@ -375,9 +374,6 @@ BATimprints(BAT *b) } MT_lock_set(&b->batIdxLock); - /* CHECK */ - // This is defined in ACCELDEBUG - TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec(); if (b->timprints == NULL) { BUN cnt; @@ -386,17 +382,15 @@ BATimprints(BAT *b) MT_lock_unset(&b->batIdxLock); - TRC_DEBUG_IF(ACCELERATOR) { - if (s2) - TRC_DEBUG_ENDIF(ACCELERATOR, "BATimprints(b=" ALGOBATFMT - "): creating imprints on parent " - ALGOBATFMT "\n", - ALGOBATPAR(s2), ALGOBATPAR(b)); - else - TRC_DEBUG_ENDIF(ACCELERATOR, "BATimprints(b=" ALGOBATFMT - "): creating imprints\n", - ALGOBATPAR(b)); - } + if (s2) + TRC_DEBUG(ACCELERATOR, "BATimprints(b=" ALGOBATFMT + "): creating imprints on parent " + ALGOBATFMT "\n", + ALGOBATPAR(s2), ALGOBATPAR(b)); + else + TRC_DEBUG(ACCELERATOR, "BATimprints(b=" ALGOBATFMT + "): creating imprints\n", + ALGOBATPAR(b)); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list