trivial changes to aid debugging

This commit is contained in:
katianderic 2020-03-12 23:38:58 +01:00
parent 5d6c2514fd
commit 781021d6ca
3 changed files with 9 additions and 7 deletions

View file

@ -310,7 +310,7 @@ typedef struct _PlayerDicts {
#endif
#define LOG_FUNC() XP_LOGFF( "%s", "IN" )
#define LOG_RETURNF(fmt, ...) XP_LOGF( "%s => " fmt, __func__, __VA_ARGS__ )
#define LOG_RETURNF(fmt, ...) XP_LOGFF( "OUT: => " fmt, __VA_ARGS__ )
#define LOG_RETURN_VOID() LOG_RETURNF("%s","void")
#define XP_LOGLOC() XP_LOGF( "%s(), line %d", __func__, __LINE__ )
#define LOG_POS(strm) XP_LOGF( "%s(); line %d; read_pos: %X", __func__, __LINE__, \

View file

@ -516,7 +516,7 @@ def build_cmds(args):
COUNTER += 1
return devs
def summarizeTileCounts(devs, endTime, state):
def summarizeTileCounts(devs, endTime, state, changeSecs):
global gDeadLaunches
shouldGoOn = True
data = [dev.getTilesCount() for dev in devs]
@ -591,7 +591,7 @@ def summarizeTileCounts(devs, endTime, state):
state['lastChange'] = now
state['tilesStr'] = tilesStr
return now - state['lastChange'] < datetime.timedelta(seconds = 30)
return now - state['lastChange'] < datetime.timedelta(seconds = changeSecs)
def countCores(args):
count = 0
@ -619,7 +619,7 @@ def run_cmds(args, devs):
# print stats every 5 seconds
if now - lastPrint > datetime.timedelta(seconds = 5):
lastPrint = now
if not summarizeTileCounts(devs, endTime, printState):
if not summarizeTileCounts(devs, endTime, printState, args.NO_CHANGE_SECS):
print('no change in too long; exiting')
break
@ -711,6 +711,8 @@ def mkParser():
help = 'number of roooms (default to --num-games)')
parser.add_argument('--timeout-mins', dest = 'TIMEOUT_MINS', default = 10000, type = int,
help = 'minutes after which to timeout')
parser.add_argument('--nochange-secs', dest = 'NO_CHANGE_SECS', default = 30, type = int,
help = 'seconds without change after which to timeout')
parser.add_argument('--log-root', dest='LOGROOT', default = '.', help = 'where logfiles go')
parser.add_argument('--dup-packets', dest = 'DUP_PACKETS', default = False, help = 'send all packet twice')
parser.add_argument('--use-gtk', dest = 'USE_GTK', default = False, action = 'store_true',
@ -755,8 +757,8 @@ def mkParser():
parser.add_argument('--http-pct', dest = 'HTTP_PCT', default = 0, type = int,
help = 'pct of games to be using web api')
parser.add_argument('--undo-pct', dest = 'UNDO_PCT', default = 0, type = int)
parser.add_argument('--trade-pct', dest = 'TRADE_PCT', default = 0, type = int)
parser.add_argument('--undo-pct', dest = 'UNDO_PCT', default = 5, type = int)
parser.add_argument('--trade-pct', dest = 'TRADE_PCT', default = 10, type = int)
parser.add_argument('--add-sms', dest = 'ADD_SMS', default = False, action = 'store_true')
parser.add_argument('--sms-fail-pct', dest = 'SMS_FAIL_PCT', default = 0, type = int)

View file

@ -125,7 +125,7 @@ void linux_lowerstr( XP_UCHAR* str );
#define XP_ABS(a) ((a)>=0?(a):-(a))
#ifdef DEBUG
# define XP_ASSERT(b) assert(b)
# define XP_ASSERT(B) do { if (!(B)) { XP_LOGFF( "%s", "firing assert"); } assert(B); } while (0)
void linux_backtrace( void );
# define XP_BACKTRACE linux_backtrace
#else