From: Florian G. <re...@us...> - 2007-12-15 23:30:54
|
Update of /cvsroot/perfparse/_perfparse/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9112/modules Modified Files: storage_mysql.c Log Message: advanced logging macros - is it a problem to use C99 Style macros? Index: storage_mysql.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** storage_mysql.c 13 Dec 2007 22:25:18 -0000 1.18 --- storage_mysql.c 15 Dec 2007 23:30:56 -0000 1.19 *************** *** 97,101 **** storage_module_t* storage_module_init(void) { ! storage_module_t *sm; --- 97,101 ---- storage_module_t* storage_module_init(void) { ! pp_log_func; storage_module_t *sm; *************** *** 116,119 **** --- 116,120 ---- int storage_mysql_connect(struct storage_module_t *this) { + pp_log_func; if(NULL == this->params) {pp_log(__FILE__,__LINE__,LOG_ERROR,_("Malloc failed")); exit(EXIT_FAILURE); } MYSQL_USER_PARAMS(this->params)->statistics = malloc(sizeof(mysql_statistics_t)); *************** *** 173,176 **** --- 174,178 ---- int storage_mysql_store_line(storage_module_t *this, const log_line_t *log_data) { + pp_log_func; int iHostID, iServiceID; *************** *** 218,221 **** --- 220,224 ---- int storage_mysql_store_perf_values(storage_module_t *this, const log_line_t *log_data, const perf_fields_t *perf_fields, const perf_value_t *perf_value) { + pp_log_func; int iHostID, iServiceID, iMetricID; *************** *** 278,281 **** --- 281,285 ---- int storage_mysql_set_registry(storage_module_t *this, const char*hostname, const char*key, const char*value, time_t tm) { + pp_log_func; pp_log(__FILE__,__LINE__,LOG_DEBUG,"setRegistry: %ld '%s/%s' = '%s'\n", tm,hostname,key,value); *************** *** 288,291 **** --- 292,296 ---- void storage_mysql_atexit(storage_module_t* this) { + pp_log_func; mysql_close(&db_mysql); *************** *** 294,297 **** --- 299,303 ---- void storage_mysql_print_statistics(storage_module_t *this, FILE*fd) { + pp_log_func; MYSQL_USER_PARAMS(this->params)->statistics->iSQLCount = iSQLCount; *************** *** 332,335 **** --- 338,342 ---- void storage_mysql_print_usage(storage_module_t *this, FILE*fd, const char*id) { + pp_log_func; int options[] = { CONFIG_ITEM_ID_DB_USER, *************** *** 357,361 **** void storage_mysql_periodic_cleanup(storage_module_t*this) { ! pp_log(__FILE__,__LINE__,LOG_DEBUG_FUNCTION,"storage_mysql_periodic_cleanup called.\n"); /* delete all data of objects that are marked as deleted */ GSList *tmplist2,*tmplist=NULL; --- 364,368 ---- void storage_mysql_periodic_cleanup(storage_module_t*this) { ! pp_log_func; /* delete all data of objects that are marked as deleted */ GSList *tmplist2,*tmplist=NULL; *************** *** 501,504 **** --- 508,512 ---- void purge_all_metricid_data(int iMid) { + pp_log_func; pp_log(__FILE__,__LINE__,LOG_INFO,"Deleting all data from metric id %d\n",iMid); g_string_printf(s_SQL,"DELETE from perfdata_service_bin WHERE metric_id=%d",iMid); *************** *** 507,510 **** --- 515,519 ---- void purge_all_serviceid_data(int iSid) { + pp_log_func; pp_log(__FILE__,__LINE__,LOG_INFO,"Deleting all data from service id %d\n",iSid); g_string_printf(s_SQL,"DELETE from perfdata_service_raw WHERE service_id=%d",iSid); *************** *** 521,524 **** --- 530,534 ---- static int validate_host(storage_module_t*this, const char *sHost) { + pp_log_func; /* Validate the host exists. If not, create */ *************** *** 564,567 **** --- 574,578 ---- static int validate_service(storage_module_t*this, const char *sHost, const char *sService) { + pp_log_func; /* Validate the service exists. If not, create */ *************** *** 632,635 **** --- 643,647 ---- static int validate_metric(storage_module_t*this, const char *sHost, const char *sService, const char *sMetric, const char *sUnit) { + pp_log_func; /* Validate the metric exists. If not, create */ *************** *** 689,692 **** --- 701,705 ---- static int isSaveBinAllowed(char *sHost, char *sService, char *sMetric) { + pp_log_func; /* Check policy to find out if we are allowed to save this metric */ static int bResult; *************** *** 723,726 **** --- 736,740 ---- static int save_raw_data(storage_module_t*this, const log_line_t *data) { + pp_log_func; static int iAuto; int iServiceID; *************** *** 753,756 **** --- 767,771 ---- static int save_summary_raw_data(storage_module_t*this, const log_line_t *data, int iServiceID) { + pp_log_func; /* first update any existing records only do this if the last update time is smaller than ctime *************** *** 805,808 **** --- 820,824 ---- void save_bin_data(storage_module_t*this, const log_line_t *data, const perf_value_t *perf, const perf_fields_t *perf_fields, int iHostID, int iServiceID, int iMetricID) { + pp_log_func; int iAuto = 0; *************** *** 853,856 **** --- 869,873 ---- static const char *getSafeD(double d) { + pp_log_func; static char sOut[25]; *************** *** 884,887 **** --- 901,905 ---- void populateSummaryList() { + pp_log_func; TSummaryList *summary, *tail = NULL; *************** *** 914,917 **** --- 932,936 ---- static int save_summary_data(storage_module_t *this, const log_line_t *data, const perf_value_t *perf, const perf_fields_t *perf_fields, int iMetricID) { + pp_log_func; TSummaryList *summary; *************** *** 935,938 **** --- 954,958 ---- static int save_summary_data_nested(storage_module_t *this, const log_line_t *data, const perf_value_t *perf, const perf_fields_t *perf_fields, int iMetricID, int iFrequency) { + pp_log_func; time_t tSample; *************** *** 1004,1007 **** --- 1024,1028 ---- static int validate_summary(storage_module_t *this, int iMetricID, int iFrequency, int iDefaultDelete) { + pp_log_func; /* Validate the summary data is correct. */ |