From f5da359df30950df42aa778bddf927683a936887 Mon Sep 17 00:00:00 2001 From: hadaq Date: Fri, 29 Jan 2010 18:24:02 +0000 Subject: [PATCH] EVT_MAXSIZE increased from 256KB to 1MB. Sergey. --- hadaq/evt.c | 3 +-- hadaq/evt.h | 2 +- hadaq/hldread.c | 16 +++++----------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hadaq/evt.c b/hadaq/evt.c index 615b595..23025f8 100644 --- a/hadaq/evt.c +++ b/hadaq/evt.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evt.c,v 6.17 2003-05-14 13:54:42 muench Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evt.c,v 6.18 2010-01-29 18:24:02 hadaq Exp $"; #define _ANSI_C_SOURCE @@ -178,7 +178,6 @@ void *newEvt(uint32_t decoding, uint32_t id) struct tm *gmTime; uint32_t dummy; - my = malloc(EVT_MAXSIZE); Evt_setSize(my, Evt_hdrSize()); diff --git a/hadaq/evt.h b/hadaq/evt.h index 237b026..5f0577e 100644 --- a/hadaq/evt.h +++ b/hadaq/evt.h @@ -10,7 +10,7 @@ #include "hadtu.h" #include "subevt.h" -#define EVT_MAXSIZE (256 * 1024) +#define EVT_MAXSIZE (1024 * 1024) static const int evtBlockSize = 8 * 1024; diff --git a/hadaq/hldread.c b/hadaq/hldread.c index 4260809..843100b 100644 --- a/hadaq/hldread.c +++ b/hadaq/hldread.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/hldread.c,v 6.9 2007-04-14 21:49:37 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/hldread.c,v 6.10 2010-01-29 18:24:05 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L @@ -106,23 +106,16 @@ int main(int argc, char *argv[]) analArgv[analArgc++] = optarg; break; case 'v': - for (i = 0; prioritynames[i].c_name != NULL - && 0 != strcmp(prioritynames[i].c_name, optarg); i++) { + for (i = 0; prioritynames[i].c_name != NULL && 0 != strcmp(prioritynames[i].c_name, optarg); i++) { } if (prioritynames[i].c_name != NULL) { setlogmask(LOG_UPTO(prioritynames[i].c_val)); break; } /* FALLTHROUGH to default */ default: - syslog( - LOG_ERR, - "Usage: %s -f firstEvent -n numEvents -e echoRate", - argv[0] - ); - syslog( - LOG_ERR, - "-t timeout -o analArgs -x (excludeAnal) [fileName]" + syslog(LOG_ERR, "Usage: %s -f firstEvent -n numEvents -e echoRate", argv[0] ); + syslog(LOG_ERR, "-t timeout -o analArgs -x (excludeAnal) [fileName]"); exit(EXIT_FAILURE); break; } /* switch (i ... */ @@ -150,6 +143,7 @@ int main(int argc, char *argv[]) signal(SIGALRM, alarmHandler); alarm(timeout); + while ((evt = Evt_fget(file)) != NULL && processedEvts < nEvts) { readEvts++; if (readEvts >= fEvts) { -- 2.43.0