[En-Nut-Discussion] how to use the NutTrace ?

Ernst Stippl ernst at stippl.org
Fri Jan 19 23:57:02 CET 2007


Hi Mike!

A while ago I used tracing:

I re-built Nut/OS with the "OS Tracer" flag set under the "RTOS Kernel"
section in Nutconf and added some lines to my prog:



// set the _TRACING_ define to enable the calls to TRACE_add #define
_TRACING_ #define stats

..program continues ...

#ifdef stats
if ( NutTraceInit  ( 4000, TRACE_MODE_CIRCULAR ) == 0) 
   {
   printf ("Error in NutTraceInit\r\n");
   }
NutTraceRegisterUserTag(1, "Befor FGETS\0"); 
NutTraceRegisterUserTag(2, "After FGETS\0"); 
NutTraceRegisterUserTag(3, "Befor IOCTL\0"); 
NutTraceRegisterUserTag(4, "After FREAD\0"); 
#endif


..program continues ...


#ifdef stats	
      TRACE_ADD_ITEM(TRACE_TAG_USER,1) 
#endif

    ..program continues ...
#ifdef stats	
      TRACE_ADD_ITEM(TRACE_TAG_USER,2) 
#endif

#ifdef stats
    NutTraceStop  () ; 
    NutTracePrint  (uart_FILE, 0);
#endif 
..program ends



The NutTracePrint produced something like: 

TRACE contains 4000 items,  printing 4000 items.        
TAG                 PC/Info     Time [s:ms:us] 
-----------------------------------------------        
Trace Start         0x0                  0:000:002     
Thread    Sleep     main                 0:006:168               
Thread    Yield     main                 0:006:172            
Thread    Wait      httpd1               0:006:188  
Thread    Yield     httpd1               0:006:192                   
Thread    Wait      httpd2               0:006:202         
Thread    Yield     httpd2               0:006:207      
Thread    Wait      FWD                  0:006:219                
Thread    Yield     FWD                  0:006:223             
Thread    Wait      tcpsm                0:006:646   
Thread    Yield     tcpsm                0:006:651
Thread    Yield     idle                 0:181:309          
Thread    Sleep     rxi1                 0:182:007       
Thread    Yield     rxi1                 0:182:012    
Thread    Yield     idle                 0:206:301              
Thread    Wait      tcpsm                0:206:722           
Thread    Yield     tcpsm                0:206:727 
Thread    Yield     idle                 0:381:248                  
Thread    Sleep     rxi1                 0:381:867        
Thread    Yield     rxi1                 0:381:871     
Thread    Yield     idle                 0:406:241               
Thread    Wait      tcpsm                0:406:662            
Thread    Yield     tcpsm                0:406:666  
Thread    Yield     idle                 0:581:187                   
Thread    Sleep     rxi1                 0:581:807         
Thread    Yield     rxi1                 0:581:811      
Thread    Yield     idle                 0:606:180   
Thread    Wait      tcpsm                0:606:601       


hope this helps

regards

Ernst



-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Michael Gong
Gesendet: Freitag, 19. Jänner 2007 22:09
An: Ethernut User Chat (English)
Betreff: Re: [En-Nut-Discussion] how to use the NutTrace ?

Any advices on how to use nuttrace are welcomed !

Thanks.

Mike

----- Original Message -----
From: "Michael Gong" <mwgong at cs.toronto.edu>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Thursday, January 18, 2007 10:45 AM
Subject: [En-Nut-Discussion] how to use the NutTrace ?


> Hi,
>
> The "NUTTRACER" macro is supposed to , I think, enable the trace
> capability of Nut/OS. So how to use it ? If I build a Nut/OS with that
> macro defined,  will it print message to the console when an 
> application
> is running ?
>
> Thanks.
>
> Mike
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion



-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.410 / Virus Database: 268.17.0/639 - Release Date: 18.01.2007




More information about the En-Nut-Discussion mailing list