diff --git a/src/ca/caEventRate.cpp b/src/ca/caEventRate.cpp index b6924bcaa..3f0df9298 100644 --- a/src/ca/caEventRate.cpp +++ b/src/ca/caEventRate.cpp @@ -5,6 +5,7 @@ #include "cadef.h" #include "dbDefs.h" #include "epicsTime.h" +#include "errlog.h" /* * event_handler() @@ -17,12 +18,12 @@ extern "C" void eventCallBack ( struct event_handler_args args ) /* - * cam () + * caEventRate () */ void caEventRate ( const char *pName ) { static const double initialSamplePeriod = 1.0; - static const double maxSamplePeriod = 60.0; + static const double maxSamplePeriod = 60.0 * 60.0; chid chan; int status = ca_search ( pName, &chan ); @@ -34,7 +35,7 @@ void caEventRate ( const char *pName ) status = ca_pend_io ( 10.0 ); if ( status != ECA_NORMAL ) { - printf ( "%s not found\n", pName ); + errlogPrintf ( "caEventRate: %s not found\n", pName ); return; } @@ -64,7 +65,7 @@ void caEventRate ( const char *pName ) nEvents = ( UINT_MAX - lastEventCount ) + curEventCount +1u; } - printf ( "CA Channel \"%s\" is producing %g subscription update events per second.\n", + errlogPrintf ( "CA Channel \"%s\" is producing %g subscription update events per second.\n", pName, nEvents / samplePeriod ); if ( samplePeriod < maxSamplePeriod ) { diff --git a/src/ca/casw.cpp b/src/ca/casw.cpp index a8f9dab40..d411ec8c0 100644 --- a/src/ca/casw.cpp +++ b/src/ca/casw.cpp @@ -15,6 +15,7 @@ #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" #include "envDefs.h" +#include "errlog.h" #include "bhe.h" #include "udpiiu.h" @@ -43,7 +44,7 @@ int main ( int, char ** ) sock = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); if ( sock == INVALID_SOCKET ) { - printf ("casw: unable to create datagram socket because = \"%s\"\n", + errlogPrintf ("casw: unable to create datagram socket because = \"%s\"\n", SOCKERRSTR (SOCKERRNO)); return -1; } @@ -55,7 +56,7 @@ int main ( int, char ** ) status = bind ( sock, &addr.sa, sizeof (addr) ); if ( status < 0 ) { socket_close ( sock ); - printf ("casw: unable to bind to an unconstrained address because = \"%s\"\n", + errlogPrintf ("casw: unable to bind to an unconstrained address because = \"%s\"\n", SOCKERRSTR (SOCKERRNO)); return -1; } @@ -64,7 +65,7 @@ int main ( int, char ** ) status = socket_ioctl ( sock, FIONBIO, &yes ); if ( status < 0 ) { socket_close ( sock ); - printf ("casw: unable to set socket to nonblocking state because \"%s\"\n", + errlogPrintf ("casw: unable to set socket to nonblocking state because \"%s\"\n", SOCKERRSTR (SOCKERRNO)); return -1; } @@ -86,7 +87,7 @@ int main ( int, char ** ) attemptNumber++; if ( attemptNumber > 100 ) { socket_close ( sock ); - printf ( "casw: unable to register with the CA repeater\n" ); + errlogPrintf ( "casw: unable to register with the CA repeater\n" ); return -1; } } @@ -95,7 +96,7 @@ int main ( int, char ** ) status = socket_ioctl ( sock, FIONBIO, &no ); if ( status < 0 ) { socket_close ( sock ); - printf ("casw: unable to set socket to blocking state because \"%s\"\n", + errlogPrintf ("casw: unable to set socket to blocking state because \"%s\"\n", SOCKERRSTR (SOCKERRNO)); return -1; } @@ -108,7 +109,7 @@ int main ( int, char ** ) &addr.sa, &addrSize ); if ( status <= 0 ) { socket_close ( sock ); - printf ("casw: error from recv was = \"%s\"\n", + errlogPrintf ("casw: error from recv was = \"%s\"\n", SOCKERRSTR (SOCKERRNO)); return -1; } @@ -182,7 +183,7 @@ int main ( int, char ** ) currentTime.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S"); char host[64]; ipAddrToA ( &ina, host, sizeof ( host ) ); - printf ("CA server beacon anomaly: %s %s\n", date, host ); + errlogPrintf ("CA server beacon anomaly: %s %s\n", date, host ); } } pCurBuf += sizeof ( *pCurMsg ) + ntohl ( pCurMsg->m_postsize );