* ignore typical backup files created by common editors
* move general ignore rules like "*.o" or "depend.mk" to top level gitignore
* ignore executables and test directories in target dir gitignore
as these are local and there's no general catch-all pattern for them
All tests are run by executing 'make testall' in root directory. As a result all directories which contain tests will be entered and tests executed.
After tests, each directory have a test log including the last run's logs only.
Created a global test log, which is specified in test.inc. Test logs from subdirectories are concatenated to this file.
Every test/makefile have the following targets:
cleantests - clean local and subdirectories' tests
buildtests - build all local and subdirectories' tests
runtests - run all local tests
testall - clean, build and run local and subdirectories' tests
Tests for directory random_dir are always in its subdirectory, in this case in random_dir/test . If random_dir has subdirectories with tests, random_dir/child_dir, for example, tests of child_dir can be started from random_dir/test/makefile where make -C child_dir/test <test target> is called.
See MAXSCALE_HOME/test/README for further information.
blockbuf_get_writepos, when all existing buffers in blockbuf list are full, a new block buffer is created and added to the list. Adding to the list is done with mutex on hold. Mutex shouldn't be freed before the next iteration in while loop, which expects that bblist mutex is on hold. At the end of the function, removed an unnecessary debug assertion.
testlog.c
Enabled more intensive write test. Replaced TRUE and FALSE with true, false, respectively.
skygw_utils.cc
simple_mutex_unlock, added debug assertion to ensure that pthread mutex's user counter is always at least 0 (it goes negative in double free).
LOGFILE_ERROR = 1
LOGFILE_MESSAGE = 2
LOGFILE_TRACE = 4
What is written to file n, will be written to all files m, m>n. Applies to user log writes. Some internal messages are such that they apply to one specific file, such as enable/disable notifications.
/** No change in these */
bool skygw_logmanager_init(void** buf, int argc, char* argv[]);
void skygw_logmanager_done(void** buf);
void skygw_logmanager_exit(void);
int skygw_log_flush(logfile_id_t id);
/** writebuf remains unused, but formatted string is now possible and in case
* of formatted string, arbitrary long argument list is supported too. Max
* length for a log string is defined to BUFSIZ, whose value depends on the
* system but typically is 4/8KB.
*/
int skygw_log_write(void* writebuf, logfile_id_t id, char* format, ...);
int skygw_log_write_flush(void* writebuf, logfile_id_t id, char* format, ...);
makefile.inc includes new CFLAG : SS_PROF, which is set if PROF=Y on make command line or in build_gateway.inc .
ss_debug.h includes corresponding ss_prof(exp) macro which equals to exp if SS_PROF is defined and to empty if in other case.
mlist_t now includes datadel function which is a callback and it is executed for mlnode_data on node exit.
skygw_logmanager_init is still useful because it allows for providing memory address for log manager where it can store a list of preallocated write buffers. TBD.
Logmanager access is now protected with spinlock familiar from epoll/core/spinlock.c . It is modified to avoid trashing; misses are counted and every tenth subsequent lock acquiring attempt triggers short random sleep.