[ECOS] Kernel instrumentation question

Andrew Lunn andrew.lunn@ascom.ch
Wed Oct 10 23:57:00 GMT 2001


On Wed, Oct 10, 2001 at 05:49:51PM -0500, Grant Edwards wrote:
> On Wed, Oct 10, 2001 at 03:10:34PM -0500, Grant Edwards wrote:
> 
> > I configured my kernel to instrument clock, thread, alarm class
> > events.  Should the timestamps in the buffer be in
> > non-decreasing order?
> 
> Apparently not.  Further source code perusal reveals The
> timestamps to be the number of hardware timer ticks since the
> last 10ms system interrupt. 
> 
> However, if you are instrumenting clock events, you see each of
> the tick events, so you can construct a "real" timestamp for
> the other events if you want. I've got a Python program that
> post-processes the instrument buffer, so it can do that.  It
> sure would be nice to be able to "print" a variable to a file
> from the gdb prompt...

I wrote and contributed a C program to do the same. Its in the
kernel/current/host directory. Attached is a newer version is adds the
'real' time stuff. It needs modified CDL code....

cdl_component CYGDBG_KERNEL_INSTRUMENT_HOST_DUMP {
    display       "Build the host tool to print out a dump"
    requires 1 == CYGDBG_KERNEL_INSTRUMENT_MSGS
    default_value 1
    description   "
        Generate a host program which can dump the instrumentation
        data in a human readable format. You have to somehow get the
        instrumemtation buffer into a file on the host"

    make -priority 51 {
        <PREFIX>/bin/dump_instr: <PREFIX>/include/cyg/kernel/instrument_desc.h 
        @sh -c "mkdir -p $(dir $@)"   
        cc -g -I $(PREFIX)/include/cyg/kernel -idirafter $(PREFIX)/include $(REPOSITORY)/$(PACKAGE)/support/dump_instr.c -o $(PREFIX)/bin/dump_instr
    }
}  

This program assumes you can get the raw instrumentation buffer off
the target. I use the TFTP server code which works well.

    Andrew

PS 

-idirafter is really nice when you want to use both host and eCos
 include files. I have stdlib.h from the host and pkgconf/kernel.h
 from eCos. 


More information about the Ecos-discuss mailing list