13.07.2015 Views

IBM Flex System x240 w

IBM Flex System x240 w

IBM Flex System x240 w

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

*--------------------------------------------------------------*//* stk_debug *//*--------------------------------------------------------------*/void stk_debug (struct out_stocklev_struct *stocklev,struct in_stocklev_struct *in_stocklev,char *msg){char debug_fn[DEBUG_PATH_SIZE + DEBUG_FILENAME_SZ];}InitializeDebug();strncpy(debug_fn, debugPath, DEBUG_PATH_SIZE);strcat(debug_fn, "stk.debug.out");stk_print(stocklev, in_stocklev, debug_fn, msg);/*--------------------------------------------------------------*//* stk_print *//*--------------------------------------------------------------*/void stk_print (struct out_stocklev_struct *stocklev,struct in_stocklev_struct *in_stocklev,char *filename,char *msg){FILE *debug_fp;char timeStamp[27];current_tmstmp(&timeStamp[0]);timeStamp[19] = (char)NULL;if ((debug_fp = fopen(filename, "a+")) == NULL){return;}fprintf(debug_fp,"Stock level debug information follows %s (%s)\n", timeStamp, msg);fprintf(debug_fp,"\n=================================================\n");fprintf(debug_fp,"in_stocklev_struct {\n");fprintf(debug_fp,"\ts_W_ID = %d (%X)\n",in_stocklev->s_W_ID, in_stocklev->s_W_ID);fprintf(debug_fp,"\ts_D_ID = %d (%X)\n",in_stocklev->s_D_ID, in_stocklev->s_D_ID);fprintf(debug_fp,"\ts_threshold = %d (%X)\n",in_stocklev->s_threshold, in_stocklev->s_threshold);fprintf(debug_fp,"}\n\n");fprintf(debug_fp,"out_stocklev_struct {\n");fprintf(debug_fp,"\ts_transtatus = %d (%X)\n",stocklev->s_transtatus, stocklev->s_transtatus);fprintf(debug_fp,"\tdeadlocks = %d (%X)\n",stocklev->deadlocks, stocklev->deadlocks);fprintf(debug_fp,"\ts_low_stock = %d (%X)\n",stocklev->s_low_stock, stocklev->s_low_stock);fprintf(debug_fp,"}\n\n");fclose(debug_fp);}void current_tmstmp(char *buf){time_t t = time(NULL);strncpy(buf,ctime(&t),19);}Src.Common/tpccmisc.c/******************************************************************************* Licensed Materials - Property of <strong>IBM</strong>**** (C) COPYRIGHT International Business Machines Corp. 1996, 2010** All Rights Reserved.**** US Government Users Restricted Rights - Use, duplication or** disclosure restricted by GSA ADP Schedule Contract with <strong>IBM</strong> Corp.*****************************************************************************//** tpccmisc.c - Miscellaneous routines*/#include#define RAND_A 16807#define RAND_M 2147483647#define RAND_M1 2147483646#define RAND_MD 2147483647.0#define RAND_Q 127773#define RAND_R 2836static int seed = 1;static int seedflag = 0;void srandom(int);int random(void);double current_time_ms(void);double current_time(void);void srandom (int initial_seed){seed = initial_seed;if ((seed < 1) || (seed > RAND_M1)) seed = 1;}int random (void){int lo;int hi;int test;hi = seed / RAND_Q;lo = seed % RAND_Q;test = RAND_A * lo - RAND_R * hi;if (test > 0) seed = test;else seed = test + RAND_M;return (seed);}/* Current time in SECONDS, precision SECONDS */double current_time(void){/* truncate fractional seconds -> seconds */return (double)((int)(current_time_ms()));}/* Current time in SECONDS, precision MILLISECONDS */double current_time_ms(void){/* GetCurrentTime() returns ms *//* convert to fractional seconds */return (GetCurrentTime() / 1000);}Src.Srv/Makefile################################################################################ Licensed Materials - Property of <strong>IBM</strong>#### (C) COPYRIGHT International Business Machines Corp. 1996, 2010## All Rights Reserved.#### US Government Users Restricted Rights - Use, duplication or## disclosure restricted by GSA ADP Schedule Contract with <strong>IBM</strong> Corp.################################################################################ Makefile - Makefile for Src.Srv#!include $(TPCC_ROOT)/Makefile.config# ######################################################################### Preprocessor, Compiler and Linker Flags# ########################################################################PRP_OPTS = PACKAGE \INCLUDES =ISOLATION RR \QUERYOPT 7 \EXPLAIN ALL \MESSAGES $*.prep.msg-I$(TPCC_SQLLIB)$(SLASH)include -I$(TPCC_ROOT)$(SLASH)includeCFLAGS = $(CFLAGS_OS) $(INCLUDES) $(CFLAGS_DEBUG) \-D$(DB2EDITION) \-DSQLA_NOLINES -DLINT_ARGSLDFLAGS =$(LDFLAGS_STORP) $(LDFLAGS_LIB)# ######################################################################### File Collections# ########################################################################STORED_PROCS = new ord delUTIL_OBJ = $(TPCC_ROOT)/Src.Common/tpccmisc$(OBJEXT) \$(TPCC_ROOT)/Src.Common/tpccdbg$(OBJEXT)DLL =rpctpcc$(SHLIBEXT)# ######################################################################### User Targets# ########################################################################

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!