]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
netmem shared mem name for multiple EBs. Sergey.
authorhadaq <hadaq>
Wed, 29 Apr 2009 13:20:16 +0000 (13:20 +0000)
committerhadaq <hadaq>
Wed, 29 Apr 2009 13:20:16 +0000 (13:20 +0000)
ebctrl/ioc/ebctrlApp/src/netmem.c

index ea41052408b657033b3ee7502b0a2c9b0b821ea0..28717ebcf544cb9094700e1c14b66b1bce998df0 100644 (file)
@@ -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("<E> 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("<E> 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("<E> 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("<E> 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("<E> 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("<E> 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("<E> 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("<E> netmem.c: Worker_getStatistic failed for %s!\n", buf);
     }