Changeset: bee1ed87fd07 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bee1ed87fd07 Modified Files: gdk/gdk_tracer.h monetdb5/mal/Tests/tracer00.malC monetdb5/modules/mal/tracer.c monetdb5/modules/mal/tracer.h monetdb5/modules/mal/tracer.mal Branch: gdk_tracer Log Message:
Fixes for MTest and tracer00.mal - removed TRACERlog diffs (173 lines): diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h --- a/gdk/gdk_tracer.h +++ b/gdk/gdk_tracer.h @@ -102,6 +102,13 @@ typedef enum { + +/* + * + * NOTE: Adding/Removing components will affect the test tracer00.mal + * See the test file for more details. + * + */ // COMPONENTS #define FOREACH_COMP(COMP) \ COMP( ALLOC ) \ diff --git a/monetdb5/mal/Tests/tracer00.malC b/monetdb5/mal/Tests/tracer00.malC --- a/monetdb5/mal/Tests/tracer00.malC +++ b/monetdb5/mal/Tests/tracer00.malC @@ -8,7 +8,7 @@ # In some test cases (marked with #WARNING) the argument used is supposed to be # an enum entry used to count the number of elements (e.g: COMPONENTS_COUNT in # gdk_tracer.h). Thus, in those cases an error should be raised. However, adding -# new entries to the enum will affect the marked test cases and they won't fail. +# or removing entries will affect the marked test cases and they won't fail. # logging.setcomplevel(...) @@ -27,11 +27,11 @@ logging.setcomplevel(1, 5); # Should # The last level is used for enum count # WARNING -logging.setcomplevel(98, 3); # Should raise an error +logging.setcomplevel(89, 3); # Should raise an error # The last component is used for enum count # WARNING -logging.setcomplevel(98, 5); # Should raise an error +logging.setcomplevel(89, 5); # Should raise an error # The last component is used for enum count # The last level is used for enum count @@ -44,7 +44,7 @@ logging.resetcomplevel(-1); # Should # Component -1 does not exist # WARNING -logging.resetcomplevel(98); # Should raise an error +logging.resetcomplevel(89); # Should raise an error # The last component is used for enum count logging.resetcomplevel(1); # OK diff --git a/monetdb5/modules/mal/tracer.c b/monetdb5/modules/mal/tracer.c --- a/monetdb5/modules/mal/tracer.c +++ b/monetdb5/modules/mal/tracer.c @@ -6,13 +6,9 @@ * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. * * - * GDKtracer exposes routines where an occuring failure should not reach the client but - * should be made known only to the DBA. On the other hand, there are exposed routines - * where the failure must also reach the client. - * - * For both cases the failures are being logged to the active adapter, or to the fallback - * mechanism (mserver5). To cover the needs of the second category, an exception is thrown. - * Exceptions apart from being logged by GDKtracer are also percolating up to the client. + * GDKtracer exposes routines where an occuring failure should reach the + * client immediately. For that reason, GDKtracer reports those errors + * directly to the stream. * */ @@ -23,8 +19,9 @@ int GDK_result = 0; str -TRACERflush_buffer(void) +TRACERflush_buffer(void *ret) { + (void) ret; GDKtracer_flush_buffer(); return MAL_SUCCEED; } @@ -91,8 +88,9 @@ TRACERset_flush_level(void *ret, int *lv str -TRACERreset_flush_level(void) +TRACERreset_flush_level(void *ret) { + (void) ret; GDK_result = GDKtracer_reset_flush_level(); if(GDK_result == GDK_FAIL) GDK_TRACER_REPORT_EXCEPTION("[%s] " _OPERATION_FAILED"\n", __FUNCTION__); @@ -114,8 +112,9 @@ TRACERset_adapter(void *ret, int *adapte str -TRACERreset_adapter(void) +TRACERreset_adapter(void *ret) { + (void) ret; GDK_result = GDKtracer_reset_adapter(); if(GDK_result == GDK_FAIL) GDK_TRACER_REPORT_EXCEPTION("[%s] " _OPERATION_FAILED"\n", __FUNCTION__); @@ -125,19 +124,9 @@ TRACERreset_adapter(void) str -TRACERshow_info(void) +TRACERshow_info(void *ret) { + (void) ret; GDKtracer_show_info(); return MAL_SUCCEED; } - - -// Exposed only in MAL layer - for testing -str -TRACERlog(void) -{ - TRC_CRITICAL(SQL_BAT, "A CRITICAL message\n"); - TRC_INFO(MAL_DATAFLOW, "An INFO message\n"); - - return MAL_SUCCEED; -} diff --git a/monetdb5/modules/mal/tracer.h b/monetdb5/modules/mal/tracer.h --- a/monetdb5/modules/mal/tracer.h +++ b/monetdb5/modules/mal/tracer.h @@ -6,7 +6,6 @@ * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. * * All the functions correspond one by one to the API calls in gdk_tracer.h - * Except TRACERlog which is exposed only in the MAL layer for testing. * */ @@ -17,18 +16,16 @@ #include "mal_interpreter.h" -mal_export str TRACERflush_buffer(void); +mal_export str TRACERflush_buffer(void *ret); mal_export str TRACERset_component_level(void *ret, int *comp_id, int *lvl_id); mal_export str TRACERreset_component_level(void *ret, int *comp_id); mal_export str TRACERset_layer_level(void *ret, int *layer_id, int *lvl_id); mal_export str TRACERreset_layer_level(void *ret, int *layer_id); mal_export str TRACERset_flush_level(void *ret, int *lvl_id); -mal_export str TRACERreset_flush_level(void); +mal_export str TRACERreset_flush_level(void *ret); mal_export str TRACERset_adapter(void *ret, int *adapter_id); -mal_export str TRACERreset_adapter(void); -mal_export str TRACERshow_info(void); +mal_export str TRACERreset_adapter(void *ret); +mal_export str TRACERshow_info(void *ret); -// Exposed only in MAL layer - for testing -mal_export str TRACERlog(void); #endif /* _TRACER_H */ diff --git a/monetdb5/modules/mal/tracer.mal b/monetdb5/modules/mal/tracer.mal --- a/monetdb5/modules/mal/tracer.mal +++ b/monetdb5/modules/mal/tracer.mal @@ -46,8 +46,3 @@ command showinfo() address TRACERshow_info comment "Dumps to the console all the available logging levels, layers and the components along with their current logging level being set"; - -# Exposed only in MAL layer - for testing -command log() -address TRACERlog -comment "Create a log message"; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list