added diagnostics

This commit is contained in:
Jeff Hill
2000-09-06 00:35:00 +00:00
parent 87a8230100
commit 2fa3e3d139
10 changed files with 127 additions and 18 deletions
+5 -2
View File
@@ -55,6 +55,7 @@ public:
dbSubscriptionIO ( dbChannelIO &chanIO, cacNotify &, unsigned type, unsigned long count );
int begin ( struct dbAddr &addr, unsigned mask );
void destroy ();
void show ( unsigned level ) const;
static void * operator new ( size_t size );
static void operator delete ( void *pCadaver, size_t size );
private:
@@ -77,6 +78,7 @@ public:
int initiatePutNotify (cacNotify &notify, struct dbAddr &addr,
unsigned type, unsigned long count, const void *pValue);
void putNotifyDestroyNotify ();
void show ( unsigned level ) const;
static void * operator new ( size_t size );
static void operator delete ( void *pCadaver, size_t size );
private:
@@ -98,7 +100,7 @@ public:
void subscriptionUpdate ( unsigned type, unsigned long count,
const struct db_field_log *pfl, cacNotifyIO &notify );
dbEventSubscription subscribe ( dbSubscriptionIO &subscr, unsigned mask );
void show ( unsigned level ) const;
static void * operator new ( size_t size);
static void operator delete ( void *pCadaver, size_t size );
@@ -107,7 +109,7 @@ private:
char *pGetCallbackCache;
dbPutNotifyBlocker *pBlocker;
unsigned long getCallbackCacheSize;
tsDLList <dbSubscriptionIO> eventq;
tsDLList < dbSubscriptionIO > eventq;
dbAddr addr;
static tsFreeList < dbChannelIO > freeList;
@@ -143,6 +145,7 @@ public:
void subscriptionUpdate ( struct dbAddr &addr, unsigned type, unsigned long count,
const struct db_field_log *pfl, cacNotifyIO &notify );
dbEventSubscription subscribe ( struct dbAddr &addr, dbSubscriptionIO &subscr, unsigned mask );
void show ( unsigned level ) const;
private:
dbEventCtx ctx;
char *pEventCallbackCache;
+26
View File
@@ -186,3 +186,29 @@ void dbChannelIO::unlockOutstandingIO () const
{
}
void dbChannelIO::show ( unsigned level ) const
{
this->lock ();
printf ("channel at %p attached to local database record %s\n",
this, this->addr.precord->name );
if ( level > 0u ) {
printf ( "\ttype %s, element count %li, field at %p\n",
dbf_type_to_text ( this->addr.dbr_field_type ), this->addr.no_elements,
this->addr.pfield );
}
if ( level > 1u ) {
this->serviceIO.show ( level - 2u );
printf ( "\tget callback cache at %p, with size %lu\n",
this->pGetCallbackCache, this->getCallbackCacheSize );
tsDLIterConstBD < dbSubscriptionIO > pItem = this->eventq.first ();
while ( pItem.valid () ) {
pItem->show ( level - 2u );
pItem++;
}
if ( this->pBlocker ) {
this->pBlocker->show ( level - 2u );
}
}
this->unlock ();
}
+12
View File
@@ -104,5 +104,17 @@ extern "C" void putNotifyCompletion ( putNotify *ppn )
pBlocker->block.signal ();
}
void dbPutNotifyBlocker::show ( unsigned level ) const
{
printf ( "put notify blocker at %p\n", this );
if ( level > 0u ) {
printf ( "\tdbPutNotifyIO at %p\n", this->pPN );
printf ( "\tdbChannelIO at %p\n", &this->chan );
}
if ( level > 1u ) {
this->block.show ( level - 2u );
}
}
+15
View File
@@ -156,3 +156,18 @@ dbEventSubscription dbServiceIO::subscribe ( struct dbAddr &addr, dbSubscription
return es;
}
void dbServiceIO::show ( unsigned level ) const
{
this->mutex.lock ();
printf ( "dbServiceIO at %p\n", this );
if (level > 0u ) {
printf ( "\tevent call back cache location %p, and its size %lu\n",
this->pEventCallbackCache, this->eventCallbackCacheSize );
}
if ( level > 1u ) {
this->mutex.show ( level - 2u );
}
this->mutex.unlock ();
}
+16
View File
@@ -89,3 +89,19 @@ int dbSubscriptionIO::begin ( struct dbAddr &addr, unsigned mask )
}
}
void dbSubscriptionIO::show ( unsigned level ) const
{
printf ( "Data base subscription IO at %p\n", this );
if ( level > 0u ) {
short tmpType;
if ( this->type < SHRT_MAX ) {
tmpType = static_cast < short > ( this->type );
printf ( "\ttype %s, count %lu, channel at %p\n",
dbf_type_to_text ( tmpType ), this->count, &this->chan );
}
else {
printf ("strange type !, count %lu, channel at %p\n",
this->count, &this->chan );
}
}
}