Changeset 377
- Timestamp:
- 01/20/07 11:03:10 (17 years ago)
- Files:
-
- trunk/libfreebob/src/debugmodule/debugmodule.cpp (modified) (8 diffs)
- trunk/libfreebob/src/libfreebobavc/avc_generic.cpp (modified) (5 diffs)
- trunk/libfreebob/src/libfreebobavc/ieee1394service.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libfreebob/src/debugmodule/debugmodule.cpp
r360 r377 54 54 DebugModule::~DebugModule() 55 55 { 56 cerr << "Unregistering " 57 << this->getName() 58 << " at DebugModuleManager" 59 << endl; 56 if ( m_level >= eDL_VeryVerbose ) { 57 cout << "Unregistering " 58 << this->getName() 59 << " at DebugModuleManager" 60 << endl; 61 } 60 62 if ( !DebugModuleManager::instance()->unregisterModule( *this ) ) { 61 63 cerr << "Could not unregister DebugModule at DebugModuleManager" 62 64 << endl; 63 65 } 64 66 65 67 } 66 68 … … 79 81 80 82 DebugModuleManager::instance()->va_print( format, arg ); 81 83 82 84 va_end( arg ); 83 85 } … … 175 177 if (mb_initialized) 176 178 return true; 177 178 fprintf(stderr, "DebugModuleManager init...\n"); 179 180 // if ( m_level >= eDL_VeryVerbose ) 181 // cout << "DebugModuleManager init..." << endl; 179 182 180 183 pthread_mutex_init(&mb_write_lock, NULL); … … 255 258 /* called WITHOUT the mb_write_lock */ 256 259 while (mb_outbuffer != mb_inbuffer) { 257 fputs(mb_buffers[mb_outbuffer], std err);260 fputs(mb_buffers[mb_outbuffer], stdout); 258 261 mb_outbuffer = MB_NEXT(mb_outbuffer); 259 262 } … … 265 268 266 269 DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 267 270 268 271 /* The mutex is only to eliminate collisions between multiple 269 272 * writer threads and protect the condition variable. */ … … 272 275 while (m->mb_initialized) { 273 276 pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 274 277 275 278 /* releasing the mutex reduces contention */ 276 279 pthread_mutex_unlock(&m->mb_write_lock); … … 284 287 } 285 288 286 void 289 void 287 290 DebugModuleManager::print(const char *fmt, ...) 288 291 { … … 315 318 316 319 317 void 320 void 318 321 DebugModuleManager::va_print (const char *fmt, va_list ap) 319 322 { 320 323 char msg[MB_BUFFERSIZE]; 321 324 322 325 /* format the message first, to reduce lock contention */ 323 326 vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); trunk/libfreebob/src/libfreebobavc/avc_generic.cpp
r375 r377 174 174 175 175 if (getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { 176 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "%s:\n", getCmdName() );177 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, " Request:");176 debugOutputShort( DEBUG_LEVEL_VERY_VERBOSE, "%s:\n", getCmdName() ); 177 debugOutputShort( DEBUG_LEVEL_VERY_VERBOSE, " Request:\n"); 178 178 showFcpFrame( m_fcpFrame, fcpFrameSize ); 179 179 … … 181 181 serialize( se_dbg ); 182 182 183 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s ",183 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s\n", 184 184 se_dbg.getString().c_str()); 185 185 } … … 206 206 result = deserialize( de ); 207 207 208 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE," Response:");208 debugOutputShort( DEBUG_LEVEL_VERY_VERBOSE," Response:\n"); 209 209 showFcpFrame( buf, de.getNrOfConsumedBytes() ); 210 210 … … 212 212 serialize( se_dbg ); 213 213 214 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s ",214 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s\n", 215 215 se_dbg.getString().c_str()); 216 216 } … … 218 218 default: 219 219 debugWarning( "unexpected response received (0x%x)\n", m_eResponse ); 220 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE," Response:");220 debugOutputShort( DEBUG_LEVEL_VERY_VERBOSE," Response:\n"); 221 221 222 222 BufferDeserialize de( buf, resp_len ); trunk/libfreebob/src/libfreebobavc/ieee1394service.cpp
r374 r377 1 /* tempate.cpp2 * Copyright (C) 2005 by Daniel Wagner1 /* ieee1394service.cpp 2 * Copyright (C) 2005,07 by Daniel Wagner 3 3 * 4 4 * This file is part of FreeBoB. … … 111 111 "read: node 0x%X, addr = 0x%016X, length = %d\n", 112 112 nodeId, addr, length); 113 printBuffer( length, buffer ); 113 printBuffer( length, buffer ); 114 114 #endif 115 115 … … 190 190 191 191 #ifdef DEBUG 192 debugOutput (DEBUG_LEVEL_VERY_VERBOSE, "pre avc1394_transaction_block2\n" );192 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, " pre avc1394_transaction_block2\n" ); 193 193 printBuffer( len, buf ); 194 194 #endif … … 203 203 204 204 #ifdef DEBUG 205 debugOutput (DEBUG_LEVEL_VERY_VERBOSE, "post avc1394_transaction_block2\n" );205 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, " post avc1394_transaction_block2\n" ); 206 206 printBuffer( *resp_len, result ); 207 207 #endif … … 244 244 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE,"\n"); 245 245 } 246 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE," %4d: ",i*4);246 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE," %4d: ",i*4); 247 247 } 248 248 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE,"%08X ",buffer[i]);