Changeset: ab14b9d39793 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ab14b9d39793
Modified Files:
        gdk/gdk_group.c
        gdk/gdk_sample.c
Branch: gdk_tracer
Log Message:

Added GDKtracer to gdk_group and gdk_sample


diffs (98 lines):

diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -10,6 +10,7 @@
 #include "gdk.h"
 #include "gdk_private.h"
 #include "gdk_cand.h"
+#include "gdk_tracer.h"
 
 /* how much to extend the extent and histo bats when we run out of space */
 #define GROUPBATINCR   8192
@@ -603,7 +604,7 @@ BATgroup_internal(BAT **groups, BAT **ex
        }
        if (b->tkey || cnt <= 1 || (g && (g->tkey || BATtdense(g)))) {
                /* grouping is trivial: 1 element per group */
-               ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT "[%s],"
+               DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -655,7 +656,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                /* all values are equal */
                if (g == NULL || (BATordered(g) && BATordered_rev(g))) {
                        /* there's only a single group: 0 */
-                       ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT 
"[%s],"
+                       DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -693,7 +694,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                         * e/h available in order to copy them,
                         * otherwise we will need to calculate them
                         * which we will do using the "normal" case */
-                       ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT 
"[%s],"
+                       DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -796,7 +797,7 @@ BATgroup_internal(BAT **groups, BAT **ex
            ((BATordered(b) || BATordered_rev(b)) &&
             (g == NULL || BATordered(g) || BATordered_rev(g)))) {
                /* we only need to compare each entry with the previous */
-               ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT "[%s],"
+               DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -854,7 +855,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                 * last time we saw that group, so if the last time we
                 * saw the old group of the current value is within
                 * this range, we can reuse the new group */
-               ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT "[%s],"
+               DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -991,7 +992,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                 * since we may have to go through long lists of
                 * duplicates in the hash table to find an old
                 * group */
-               ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT "[%s],"
+               DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
@@ -1057,7 +1058,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                 * build an incomplete hash table on the fly--also see
                 * BATassertProps for similar code; we also exploit if
                 * g is clustered */
-               ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT "[%s],"
+               DEBUG(ALGO, "BATgroup(b=%s#" BUNFMT "[%s],"
                                  "s=%s#" BUNFMT ","
                                  "g=%s#" BUNFMT ","
                                  "e=%s#" BUNFMT ","
diff --git a/gdk/gdk_sample.c b/gdk/gdk_sample.c
--- a/gdk/gdk_sample.c
+++ b/gdk/gdk_sample.c
@@ -27,6 +27,7 @@
 #include "gdk.h"
 #include "gdk_private.h"
 #include "xoshiro256starstar.h"
+#include "gdk_tracer.h"
 
 /* this is a straightforward implementation of a binary tree */
 struct oidtreenode {
@@ -155,9 +156,9 @@ do_batsample(BAT *b, BUN n, random_state
                bn->tkey = true;
                bn->tseqbase = bn->batCount == 0 ? 0 : bn->batCount == 1 ? 
*(oid *) Tloc(bn, 0) : oid_nil;
        }
-       ALGODEBUG fprintf(stderr, "#BATsample(" ALGOBATFMT "," BUNFMT ")="
-                         ALGOOPTBATFMT "\n",
-                         ALGOBATPAR(b), n, ALGOOPTBATPAR(bn));
+       DEBUG(ALGO, "BATsample(" ALGOBATFMT "," BUNFMT ")="
+                               ALGOOPTBATFMT "\n",
+                               ALGOBATPAR(b), n, ALGOOPTBATPAR(bn));
        return bn;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to