-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.70 2004-08-16 11:25:53 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.71 2004-08-18 09:58:28 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
unsigned long queueSize;
char verbosity[PARAM_MAX_VALUE_LEN];
unsigned long evtId;
+ off_t maxFileSz;
} TheArgs;
typedef struct TheStatsS {
syslog(LOG_ERR, "Usage: %s [-x expId]", progName);
syslog(LOG_ERR, "Usage: [-m nrOfMsgs] [-f slowCtrlFile ...]");
syslog(LOG_ERR, "Usage: [-o outPath] [-d null|tape|file|stdout]");
+ syslog(LOG_ERR, "Usage: [-q queueSize] [-r runNumber]");
syslog(LOG_ERR, "Usage: [-a (agent)] [-p priority] [-I evtId]");
+ syslog(LOG_ERR, "Usage: [-v debug|info|notice|warning|err|alert|crit|emerg]");
}
static void argsDump(TheArgs *my)
syslog(LOG_DEBUG, "isStandalone: %d", my->isStandalone);
syslog(LOG_DEBUG, "queueSize: %d", my->queueSize);
syslog(LOG_DEBUG, "verbosity: %s", my->verbosity);
- syslog(LOG_DEBUG, "evtId: %s", my->evtId);
+ syslog(LOG_DEBUG, "evtId: %ld", my->evtId);
+ syslog(LOG_DEBUG, "maxFileSz: %ld", my->maxFileSz);
}
static void argsDefault(TheArgs *my)
my->queueSize = 1 * 1024 * 1024;
strcpy(my->verbosity, "info");
my->evtId = 0;
+ my->maxFileSz = (2 * 1024 * 1024 * 1024UL);
}
static int argsFromCL(TheArgs *my, int argc, char *argv[])
extern char *optarg;
int i;
- while ((i = getopt(argc, argv, "am:f:s:r:o:d:q:p:v:x:I:")) != -1) {
+ while ((i = getopt(argc, argv, "am:f:s:r:o:d:q:p:v:x:I:S:")) != -1) {
switch (i) {
case 'm':
my->nrOfMsgs = strtoul(optarg, NULL, 0);
case 'I':
my->evtId = strtoul(optarg, NULL, 0);
break;
+ case 'S':
+ my->maxFileSz = strtoul(optarg, NULL, 0);
+ break;
default:
return -1;
break;
Param_getInt(param, name, "qsize", ¶mWasFound, &my->queueSize);
Param_getString(param, name, "verb", ¶mWasFound, my->verbosity);
Param_getInt(param, name, "evtid", ¶mWasFound, &my->evtId);
+ Param_getInt(param, name, "maxfilesz", ¶mWasFound, &my->maxFileSz);
desParam(param);
}
ShmTrans **shmTrans;
HadTuQueue **hadTuQueue;
Worker *worker;
- off_t maxFileSize;
int scanWasSuccessful;
uint32_t currTrigNr;
Worker_initEnd(worker);
currId = 0;
- maxFileSize = (2 * 1024 * 1024 * 1024UL) - theArgs->queueSize;
while (setjmp(terminateJmp) == 0) {
void *evt;
void *subEvt;
(*theStats->evtsDiscarded)++;
}
deleteEvt(evt);
- if (*theStats->bytesWritten >= maxFileSize) {
+ if (*theStats->bytesWritten >= theArgs->maxFileSz - theArgs->queueSize) {
evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStop);
for (i = 0; i < theArgs->slowCtrlFileCnt; i++) {
evt = appendFile(evt, theArgs->slowCtrlFiles[i]);