Changeset: 7ccfbff467dc for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ccfbff467dc Modified Files: gdk/gdk_bat.c gdk/gdk_posix.c gdk/gdk_system.c gdk/gdk_tm.c gdk/gdk_tracer.h gdk/gdk_utils.c monetdb5/mal/mal.c monetdb5/mal/mal_exception.c monetdb5/mal/mal_function.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_session.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/wlc.c monetdb5/optimizer/opt_garbageCollector.c monetdb5/optimizer/opt_mergetable.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_result.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_upgrades.c sql/backends/monet5/vaults/bam/bam_loader.c sql/backends/monet5/wlr.c sql/storage/bat/bat_table.c sql/storage/store.c Branch: gdk_tracer Log Message:
Renamed macro ERROR to TRC_ERROR diffs (truncated from 1046 to 300 lines): diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -2114,7 +2114,7 @@ BATmode(BAT *b, bool transient) #ifdef NDEBUG /* assertions are disabled, turn failing tests into a message */ #undef assert -#define assert(test) ((void) ((test) || ERROR(BAT_, "Assertion `%s' failed\n", #test))) +#define assert(test) ((void) ((test) || TRC_ERROR(BAT_, "Assertion `%s' failed\n", #test))) #endif /* Assert that properties are set correctly. @@ -2387,13 +2387,13 @@ BATassertProps(BAT *b) int len; if ((hs = GDKzalloc(sizeof(Hash))) == NULL) { - ERROR(BAT_, "Cannot allocate hash table\n"); + TRC_ERROR(BAT_, "Cannot allocate hash table\n"); goto abort_check; } len = snprintf(hs->heap.filename, sizeof(hs->heap.filename), "%s.hash%d", nme, THRgettid()); if (len == -1 || len > (int) sizeof(hs->heap.filename)) { GDKfree(hs); - ERROR(BAT_, "Heap filename is too large\n"); + TRC_ERROR(BAT_, "Heap filename is too large\n"); goto abort_check; } if (ATOMsize(b->ttype) == 1) @@ -2407,7 +2407,7 @@ BATassertProps(BAT *b) HASHnew(hs, b->ttype, BUNlast(b), mask, BUN_NONE) != GDK_SUCCEED) { GDKfree(hs); - ERROR(BAT_, "Cannot allocate hash table\n"); + TRC_ERROR(BAT_, "Cannot allocate hash table\n"); goto abort_check; } BATloop(b, p, q) { diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c --- a/gdk/gdk_posix.c +++ b/gdk/gdk_posix.c @@ -414,7 +414,7 @@ MT_mremap(const char *path, int mode, vo GDKsyserror("MT_mremap: munmap(%p,%zu) failed\n", ((char *) old_address + *new_size), old_size - *new_size); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): munmap() failed\n", path?path:"NULL", old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): munmap() failed\n", path?path:"NULL", old_address, old_size, *new_size); /* even though the system call failed, we * don't need to propagate the error up: the * address should still work in the same way @@ -422,7 +422,7 @@ MT_mremap(const char *path, int mode, vo return old_address; } if (path && truncate(path, *new_size) < 0) - ERROR(GDK_POSIX, "MT_mremap(%s): truncate failed\n", path); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s): truncate failed\n", path); TRC_DEBUG(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu) -> shrinking\n", path?path:"NULL", old_address, old_size, *new_size); #endif /* !STATIC_CODE_ANALYSIS */ return old_address; @@ -438,12 +438,12 @@ MT_mremap(const char *path, int mode, vo if ((fd = open(path, O_RDWR | O_CLOEXEC)) < 0) { GDKsyserror("MT_mremap: open(%s) failed\n", path); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): open() failed\n", path, old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): open() failed\n", path, old_address, old_size, *new_size); return NULL; } if (GDKextendf(fd, *new_size, path) != GDK_SUCCEED) { close(fd); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): GDKextendf() failed\n", path, old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): GDKextendf() failed\n", path, old_address, old_size, *new_size); return NULL; } #ifdef HAVE_MREMAP @@ -502,7 +502,7 @@ MT_mremap(const char *path, int mode, vo #else if ((fd = open("/dev/zero", O_RDWR | O_CLOEXEC)) < 0) { GDKsyserror("MT_mremap: open(/dev/zero) failed\n"); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): open('/dev/zero') failed\n", path?path:"NULL", old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): open('/dev/zero') failed\n", path?path:"NULL", old_address, old_size, *new_size); return NULL; } #endif @@ -578,7 +578,7 @@ MT_mremap(const char *path, int mode, vo p = malloc(strlen(path) + 5); if (p == NULL){ GDKsyserror("MT_mremap: malloc() failed\n"); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): fd < 0\n", path, old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): fd < 0\n", path, old_address, old_size, *new_size); return NULL; } @@ -588,7 +588,7 @@ MT_mremap(const char *path, int mode, vo if (fd < 0) { GDKsyserror("MT_mremap: open(%s) failed\n", (char *) p); free(p); - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): fd < 0\n", path, old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): fd < 0\n", path, old_address, old_size, *new_size); return NULL; } free(p); @@ -633,7 +633,7 @@ MT_mremap(const char *path, int mode, vo errno = err; /* restore for error message */ GDKsyserror("MT_mremap: growing file failed\n"); close(fd); - ERROR(GDK_POSIX, + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): write() or " #ifdef HAVE_FALLOCATE "fallocate()" @@ -665,7 +665,7 @@ MT_mremap(const char *path, int mode, vo } TRC_DEBUG(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu) -> %p%s\n", path?path:"NULL", old_address, old_size, *new_size, p, path && mode & MMAP_COPY ? " private" : ""); if (p == MAP_FAILED) - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): p == MAP_FAILED\n", path?path:"NULL", old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): p == MAP_FAILED\n", path?path:"NULL", old_address, old_size, *new_size); return p == MAP_FAILED ? NULL : p; } @@ -842,7 +842,7 @@ MT_mremap(const char *path, int mode, vo return old_address; /* don't bother shrinking */ } if (GDKextend(path, *new_size) != GDK_SUCCEED) { - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): GDKextend() failed\n", path?path:"NULL", old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): GDKextend() failed\n", path?path:"NULL", old_address, old_size, *new_size); return NULL; } if (path && !(mode & MMAP_COPY)) @@ -856,7 +856,7 @@ MT_mremap(const char *path, int mode, vo TRC_DEBUG(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu) -> %p\n", path?path:"NULL", old_address, old_size, *new_size, p); if (p == NULL) - ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): p == NULL\n", path?path:"NULL", old_address, old_size, *new_size); + TRC_ERROR(GDK_POSIX, "MT_mremap(%s,%p,%zu,%zu): p == NULL\n", path?path:"NULL", old_address, old_size, *new_size); return p; } diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -521,12 +521,12 @@ MT_thread_init(void) int ret; if ((ret = pthread_key_create(&threadkey, NULL)) != 0) { - ERROR(GDK_SYSTEM, "Creating specific key for thread failed: %s\n", strerror(ret)); + TRC_ERROR(GDK_SYSTEM, "Creating specific key for thread failed: %s\n", strerror(ret)); return false; } mainthread.tid = pthread_self(); if ((ret = pthread_setspecific(threadkey, &mainthread)) != 0) { - ERROR(GDK_SYSTEM, "Σetting specific value failed: %s\n", strerror(ret)); + TRC_ERROR(GDK_SYSTEM, "Σetting specific value failed: %s\n", strerror(ret)); } return true; } @@ -706,26 +706,26 @@ MT_create_thread(MT_Id *t, void (*f) (vo join_threads(); if (threadname == NULL) { - ERROR(GDK_SYSTEM, "Thread must have a name\n"); + TRC_ERROR(GDK_SYSTEM, "Thread must have a name\n"); return -1; } tlen = strlen(threadname); if (tlen >= sizeof(p->threadname)) { - ERROR(GDK_SYSTEM, "Thread's name is too large\n"); + TRC_ERROR(GDK_SYSTEM, "Thread's name is too large\n"); return -1; } if ((ret = pthread_attr_init(&attr)) != 0) { - ERROR(GDK_SYSTEM, "Cannot init pthread attr: %s\n", strerror(ret)); + TRC_ERROR(GDK_SYSTEM, "Cannot init pthread attr: %s\n", strerror(ret)); return -1; } if ((ret = pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE)) != 0) { - ERROR(GDK_SYSTEM, "Cannot set stack size: %s\n", strerror(ret)); + TRC_ERROR(GDK_SYSTEM, "Cannot set stack size: %s\n", strerror(ret)); pthread_attr_destroy(&attr); return -1; } p = malloc(sizeof(struct posthread)); if (p == NULL) { - ERROR(GDK_SYSTEM, "Cannot allocate memory: %s\n", strerror(errno)); + TRC_ERROR(GDK_SYSTEM, "Cannot allocate memory: %s\n", strerror(errno)); pthread_attr_destroy(&attr); return -1; } @@ -750,7 +750,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo *t = p->mtid = ++MT_thread_id; ret = pthread_create(&p->tid, &attr, thread_starter, p); if (ret != 0) { - ERROR(GDK_SYSTEM, "Cannot start thread: %s\n", strerror(ret)); + TRC_ERROR(GDK_SYSTEM, "Cannot start thread: %s\n", strerror(ret)); ret = -1; } else { /* must not fail after this: the thread has been started */ diff --git a/gdk/gdk_tm.c b/gdk/gdk_tm.c --- a/gdk/gdk_tm.c +++ b/gdk/gdk_tm.c @@ -103,7 +103,7 @@ epilogue(int cnt, bat *subcommit) if (b) { /* check mmap modes */ if (BATcheckmodes(b, true) != GDK_SUCCEED) - ERROR(GDK_TM, "BATcheckmodes failed\n"); + TRC_ERROR(GDK_TM, "BATcheckmodes failed\n"); } } if ((BBP_status(bid) & BBPDELETED) && BBP_refs(bid) <= 0 && BBP_lrefs(bid) <= 0) { diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h --- a/gdk/gdk_tracer.h +++ b/gdk/gdk_tracer.h @@ -222,7 +222,7 @@ extern LOG_LEVEL LVL_PER_COMPONENT[COMPO #define CRITICAL(COMP, MSG, ...) \ GDK_TRACER_LOG(M_CRITICAL, COMP, MSG, ## __VA_ARGS__) \ -#define ERROR(COMP, MSG, ...) \ +#define TRC_ERROR(COMP, MSG, ...) \ GDK_TRACER_LOG(M_ERROR, COMP, MSG, ## __VA_ARGS__) \ #define TRC_WARNING(COMP, MSG, ...) \ diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -81,15 +81,15 @@ static bool GDKenvironment(const char *dbpath) { if (dbpath == NULL) { - ERROR(GDK_UTILS, "Database name missing.\n"); + TRC_ERROR(GDK_UTILS, "Database name missing.\n"); return false; } if (strlen(dbpath) >= FILENAME_MAX) { - ERROR(GDK_UTILS, "Database name too long.\n") + TRC_ERROR(GDK_UTILS, "Database name too long.\n") return false; } if (!MT_path_absolute(dbpath)) { - ERROR(GDK_UTILS, "Directory not an absolute path: %s.\n", dbpath); + TRC_ERROR(GDK_UTILS, "Directory not an absolute path: %s.\n", dbpath); return false; } return true; @@ -1224,7 +1224,7 @@ GDKerror(const char *format, ...) } va_start(ap, format); if (vsnprintf(message + len, sizeof(message) - (len + 2), format, ap) < 0){ - ERROR(GDK_UTILS, GDKERROR "an error occurred within GDKerror.\n"); + TRC_ERROR(GDK_UTILS, GDKERROR "an error occurred within GDKerror.\n"); strcpy(message, GDKERROR "an error occurred within GDKerror.\n"); } va_end(ap); @@ -1747,7 +1747,7 @@ GDKmemfail(const char *s, size_t len) } */ - ERROR(GDK_UTILS, "%s(%zu) fails, try to free up space [memory in use=%zu,virtual memory in use=%zu]\n", s, len, GDKmem_cursize(), GDKvm_cursize()); + TRC_ERROR(GDK_UTILS, "%s(%zu) fails, try to free up space [memory in use=%zu,virtual memory in use=%zu]\n", s, len, GDKmem_cursize(), GDKvm_cursize()); } /* Memory allocation diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c --- a/monetdb5/mal/mal.c +++ b/monetdb5/mal/mal.c @@ -76,7 +76,7 @@ int mal_init(void){ #ifndef NDEBUG mdbExit(); #endif - ERROR(MAL_MAL, "%s\n", err); + TRC_ERROR(MAL_MAL, "%s\n", err); freeException(err); return -1; } @@ -106,11 +106,11 @@ void mserver_reset(void) AUTHreset(); if (!GDKinmemory()) { if ((err = msab_wildRetreat()) != NULL) { - ERROR(MAL_MAL, "%s\n", err); + TRC_ERROR(MAL_MAL, "%s\n", err); free(err); } if ((err = msab_registerStop()) != NULL) { - ERROR(MAL_MAL, "%s\n", err); + TRC_ERROR(MAL_MAL, "%s\n", err); free(err); } } diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c --- a/monetdb5/mal/mal_exception.c +++ b/monetdb5/mal/mal_exception.c @@ -87,9 +87,9 @@ createExceptionInternal(enum malexceptio } char *q = message; for (char *p = strchr(q, '\n'); p; q = p + 1, p = strchr(q, '\n')) - ERROR(MAL_EXCEPTION, "%.*s\n", (int) (p - q), q); + TRC_ERROR(MAL_EXCEPTION, "%.*s\n", (int) (p - q), q); if (*q) - ERROR(MAL_EXCEPTION, "%s\n", q); + TRC_ERROR(MAL_EXCEPTION, "%s\n", q); return message; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list