-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.110 2010-06-16 16:11:18 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.111 2010-06-17 13:45:01 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#define SYSLOG_NAMES
int debug_trignr;
int debug_errbit;
int debug_word;
+ int debug_size;
unsigned long isStandalone;
unsigned long priority;
unsigned long *trigNr[MAXINPATH];
unsigned long *errBit[MAXINPATH];
unsigned long *debugWord[MAXINPATH];
+ unsigned long *debugSize[MAXINPATH];
unsigned long *evtsRes;
unsigned long *evtbuildBuff[MAXINPATH];
unsigned long *nrOfMsgs;
unsigned long *debugWords[MAXINPATH];
unsigned long debugWordsS[MAXINPATH][MAXDEBUGEVTS];
unsigned long debugWordsCnt[MAXINPATH];
+ unsigned long *debugSizes[MAXINPATH];
+ unsigned long debugSizesS[MAXINPATH][MAXDEBUGEVTS];
+ unsigned long debugSizesCnt[MAXINPATH];
unsigned long evtsLastBuilt[MAXINPATH];
} TheDebug;
theDebug->evtsBroken[i] = theDebug->evtsBrokenS[i];
theDebug->errBits[i] = theDebug->errBitsS[i];
theDebug->debugWords[i] = theDebug->debugWordsS[i];
+ theDebug->debugSizes[i] = theDebug->debugSizesS[i];
theDebug->evtsBrokenCnt[i] = 0;
theDebug->errBitsCnt[i] = 0;
theDebug->debugWordsCnt[i] = 0;
+ theDebug->debugSizesCnt[i] = 0;
theDebug->evtsLastBuilt[i] = 0;
}
}
my->debug_trignr = 0;
my->debug_errbit = 0;
my->debug_word = 0;
+ my->debug_size = 0;
for (i = 0; i < PARAM_MAX_ARRAY_LEN; i++) {
my->debugOpts[i] = my->debugOptsS[i];
my->debug_errbit = 1;
} else if (strcmp(my->debugOpts[i], "word") == 0) {
my->debug_word = 1;
+ } else if (strcmp(my->debugOpts[i], "size") == 0) {
+ my->debug_size = 1;
} else {
printf("Error: wrong argument is given in the option -D|--debug.\n");
return 1;
int j;
if (strcmp(evtStatus, "pop") == 0) {
- if (theDebug->evtsBrokenCnt[i] == MAXDEBUGEVTS ||
- theDebug->errBitsCnt[i] == MAXDEBUGEVTS || theDebug->debugWordsCnt[i] == MAXDEBUGEVTS)
+ if (theDebug->evtsBrokenCnt[i] == MAXDEBUGEVTS || theDebug->errBitsCnt[i] == MAXDEBUGEVTS ||
+ theDebug->debugWordsCnt[i] == MAXDEBUGEVTS || theDebug->debugSizesCnt[i] == MAXDEBUGEVTS)
return MAXDEBUGEVTS;
j = theDebug->evtsBrokenCnt[i];
theDebug->evtsBroken[i][j] = (*theStats->trigNr[i]);
theDebug->errBits[i][j] = (*theStats->errBit[i]);
theDebug->debugWords[i][j] = (*theStats->debugWord[i]);
+ theDebug->debugSizes[i][j] = (*theStats->debugSize[i]);
theDebug->evtsBrokenCnt[i]++;
theDebug->errBitsCnt[i]++;
theDebug->debugWordsCnt[i]++;
+ theDebug->debugSizesCnt[i]++;
} else if (strcmp(evtStatus, "broken") == 0) {
int k;
for (k = 0; k < i; k++) {
- if (theDebug->evtsBrokenCnt[k] == MAXDEBUGEVTS ||
+ if (theDebug->evtsBrokenCnt[k] == MAXDEBUGEVTS || theDebug->debugSizesCnt[i] == MAXDEBUGEVTS ||
theDebug->errBitsCnt[k] == MAXDEBUGEVTS || theDebug->debugWordsCnt[k] == MAXDEBUGEVTS)
return MAXDEBUGEVTS;
theDebug->evtsBroken[k][j] = (*theStats->trigNr[k]);
theDebug->errBits[k][j] = (*theStats->errBit[k]);
theDebug->debugWords[k][j] = (*theStats->debugWord[k]);
+ theDebug->debugSizes[k][j] = (*theStats->debugSize[k]);
theDebug->evtsBrokenCnt[k]++;
theDebug->errBitsCnt[k]++;
theDebug->debugWordsCnt[k]++;
+ theDebug->debugSizesCnt[k]++;
}
} else {
printf("fillDebug: Event has unknown status!\n");
printf("\n");
}
+ /* Print sizes */
+ if (theArgs->debug_size) {
+ printf("%7s", "size");
+ for (i = 0; i < theArgs->nrOfMsgs; i++) {
+ if (j < theDebug->debugSizesCnt[i]) {
+ printf(" %08x", theDebug->debugSizes[i][j]);
+ } else {
+ printf("%9s", "-");
+ }
+ }
+ printf("\n");
+ }
+
/* Print error bits */
if (theArgs->debug_errbit) {
printf("%7s", "errBit");
sprintf(buf, "debugWord%d", i);
theStats->debugWord[i] = Worker_addStatistic(worker, buf);
}
+ for (i = 0; i < theArgs->nrOfMsgs; i++) {
+ char buf[WORKER_MAX_NAME_LEN];
+
+ sprintf(buf, "debugSize%d", i);
+ theStats->debugSize[i] = Worker_addStatistic(worker, buf);
+ }
}
/* Add statistic for fill levels of buffers. */
(*theStats->trigNr[i]) = SubEvt_trigNr(subEvt);
(*theStats->errBit[i]) = SubEvt_errBit(subEvt);
- if (theArgs->debugOptsCnt)
+ if (theArgs->debugOptsCnt) {
(*theStats->debugWord[i]) = SubEvt_debugWord(subEvt);
+ (*theStats->debugSize[i]) = SubEvt_size(subEvt);
+ }
if (i == 0) {
currTrigNr = SubEvt_trigNr(subEvt) >> 8;