17 Commits

Author SHA1 Message Date
vraatikka
56c73086aa Disabled buffering of log file stream by call of setvbuf. 2013-07-30 19:30:23 +03:00
vraatikka
7a6129861e Added timestamp to log file headers and to the beginning of each line. Removed additional line feeds.
Example:

SkySQL MaxScale Sat Jul 27 12:13:10 2013
------------------------------------------
2013 07/27 12:13:10  Loaded module testroute: V1.0.0
2013 07/27 12:13:10  Initialise debug CLI router module V1.0.1.
2013 07/27 12:13:10  Loaded module debugcli: V1.0.1
2013-07-27 12:14:30 +03:00
vraatikka
1c3e44d446 Removed debug fprint about failed mutex destroy. 2013-07-25 17:22:19 +03:00
vraatikka
52564314d4 Documented concurrency control between filewriter thread and log clients.
Changed log header text, replaced SkySQL GAteway with SkySQL MaxScale.
Fixed bug in log flushing. skygw_log_write_flush didn't cause call of fsync, which suspended file writing.
2013-07-25 16:21:13 +03:00
vraatikka
baed0e846f Changed log_manager to use block-siuze buffers instead of small write buffers. Added new test cases and added iterations. Added possibility to test with dummy disk write which sleeps constantly for 5ms instead of performing disk write. 2013-07-23 08:34:43 +03:00
vraatikka
d11741130d Changed log manager API to support variable length formatted log strings. New API is as follows:
/** 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.
2013-07-02 14:46:39 +03:00
vraatikka
33632968a8 Fixed typo which failed DEBUG=Y compilation 2013-06-27 17:41:06 +03:00
vraatikka
b26315cf24 Can't compile product version. 2013-06-27 16:54:54 +03:00
vraatikka
5c271e1925 Fixed clean-up processes in cases where initialization fails arbitrarily in the middle of startup. Added four descriptive states : UNINIT, INIT, RUN, DONE for flat stucts inside logmanager. Flat structs always have the state which tells what needs to be fred, if any. 2013-06-27 16:43:01 +03:00
vraatikka
9630ae588e Fixed bugs and cleaned code 2013-06-27 12:18:25 +03:00
vraatikka
70b19a0481 Fixed printing issues. 2013-06-26 23:43:57 +03:00
vraatikka
2b8c62a7da Added a few more testcases to increase IO and added debug printing for file handling. 2013-06-26 23:40:07 +03:00
vraatikka
ef1d198654 Changed log manager API so that pointer reference to logmanager is not used anymore. Every call initializes logmanager now except skygw_logmanager_done and skygw_log_flush.
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.
2013-06-26 23:13:40 +03:00
vraatikka
2ea8e2a05a Added licences and changed the use of zero-length arrays due to compiler problems. 2013-06-26 09:39:38 +03:00
vraatikka
8178e4e239 New, yet primitive version of log writing functionality. Fixed some things in utils. 2013-06-25 21:14:03 +03:00
vraatikka
a7229a6c24 Separated libmysqld from list of libs which is used in every link command line. 2013-06-18 21:28:06 +03:00
vraatikka
81bb5bdde8 Adding this too under skygateway 2013-06-17 18:32:01 +03:00