From: hadaq Date: Thu, 2 Sep 2010 17:33:57 +0000 (+0000) Subject: fixed. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a7991169028153bde7df9b69e914c65b1772758c;p=daqdata.git fixed. Sergey. --- diff --git a/ebctrl/ioc/ebctrlApp/src/evtbuild.c b/ebctrl/ioc/ebctrlApp/src/evtbuild.c index ed43a1e..78bcc6c 100644 --- a/ebctrl/ioc/ebctrlApp/src/evtbuild.c +++ b/ebctrl/ioc/ebctrlApp/src/evtbuild.c @@ -101,13 +101,13 @@ long evtbuild_proc( struct genSubRecord *pgsub ) for( i=0; i<17; i++ ) *out[i] = 0; + char buf[_POSIX_PATH_MAX]; + sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") ); + /* * *************** nrOfMsgs and status of EB *************** */ - char buf[_POSIX_PATH_MAX]; - sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") ); - if( Worker_getStatistic( buf, "nrOfMsgs", &tmp ) == -1) { *out[7] = 0; /* status: Event Builder is off */ if(evtbuildDebug) @@ -159,7 +159,7 @@ long evtbuild_proc( struct genSubRecord *pgsub ) *out[2] = (uint32_t)tmp; if( ((long)(*out[2]) - (long)temp[2]) >= 0 ) - *out[8] = *out[2] - temp[2]; /* calculate evtComp rate */ + *out[8] = (long)(*out[2]) - (long)temp[2]; /* calculate evtComp rate */ else *out[8] = *out[2]; @@ -179,7 +179,7 @@ long evtbuild_proc( struct genSubRecord *pgsub ) *out[3] = (uint32_t)tmp; if( ((long)(*out[3]) - (long)temp[3]) > 0 ) - *out[10] = *out[3] - temp[3]; /* calculate evtDisc rate */ + *out[10] = (long)(*out[3]) - (long)temp[3]; /* calculate evtDisc rate */ else *out[10] = *out[3]; @@ -191,6 +191,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) */ if( Worker_getStatistic( buf, "evtsDataError", &tmp ) == -1){ + *out[4] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for evtsDataError!\n"); } @@ -203,6 +205,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) */ if( Worker_getStatistic( buf, "evtsTagError", &tmp ) == -1){ + *out[5] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for evtsTagError!\n"); } @@ -215,6 +219,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) */ if( Worker_getStatistic( buf, "dataMover", &tmp ) == -1){ + *out[11] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for dataMover!\n"); } @@ -227,6 +233,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) */ if( Worker_getStatistic( buf, "diskNumEB", &tmp ) == -1){ + *out[12] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for diskNrEB!\n"); } @@ -244,6 +252,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) sprintf( ebbuf, "evtbuildBuff%d", i ); if( Worker_getStatistic( buf, ebbuf, &tmp ) == -1) { + *out[6] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for %s!\n", buf); } @@ -269,6 +279,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) c_ptr = strchr(hostname, '0'); if( c_ptr == (char*) NULL ){ + *out[13] = 0; + if(evtbuildDebug) printf(" evtbuild.c: failed to extract a number from the hostname: %s!\n", hostname); } @@ -282,6 +294,8 @@ long evtbuild_proc( struct genSubRecord *pgsub ) if( Worker_getStatistic( buf, "PID", &tmp ) == -1) { *out[14] = 0; + *out[15] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for PID!\n"); } @@ -297,6 +311,7 @@ long evtbuild_proc( struct genSubRecord *pgsub ) if( Worker_getStatistic( buf, "coreNr", &tmp ) == -1) { *out[16] = 0; + if(evtbuildDebug) printf(" evtbuild.c: Worker_getStatistic failed for coreNr!\n"); }