From e9b0c6ecfeed7e9ad5a6b2005d7554bcc640820e Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 29 Apr 2009 13:20:16 +0000 Subject: [PATCH] netmem shared mem name for multiple EBs. Sergey. --- ebctrl/ioc/ebctrlApp/src/netmem.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ebctrl/ioc/ebctrlApp/src/netmem.c b/ebctrl/ioc/ebctrlApp/src/netmem.c index ea41052..28717eb 100644 --- a/ebctrl/ioc/ebctrlApp/src/netmem.c +++ b/ebctrl/ioc/ebctrlApp/src/netmem.c @@ -34,7 +34,10 @@ long netmem_proc( struct genSubRecord *pgsub ) for( i=0; i<8; i++ ) *out[1] = 0; - if( Worker_getStatistic( "daq_evtbuild", "nrOfMsgs", out[0] ) == -1) { + char bufmem[_POSIX_PATH_MAX]; + sprintf( bufmem, "%s%s", "daq_netmem", getenv("EBNUM") ); + + if( Worker_getStatistic( bufmem, "nrOfMsgs", out[0] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for nrOfMsgs!\n"); } @@ -49,7 +52,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "netmemBuff", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[1] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[1] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -65,7 +68,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "pktsReceived", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[2] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[2] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -81,7 +84,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "msgsReceived", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[3] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[3] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -97,7 +100,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "pktsDiscarded", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[4] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[4] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -113,7 +116,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "msgsDiscarded", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[5] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[5] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -129,7 +132,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "bytesReceived", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[6] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[6] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } @@ -146,7 +149,7 @@ long netmem_proc( struct genSubRecord *pgsub ) sprintf( buf, "%s%d", "bytesReceivedRate", i ); - if( Worker_getStatistic( "daq_netmem", buf, out[7] ) == -1) { + if( Worker_getStatistic( bufmem, buf, out[7] ) == -1) { if(netmemDebug) printf(" netmem.c: Worker_getStatistic failed for %s!\n", buf); } -- 2.43.0