This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Question about Instrumentation? Thanks


Thanks a lot. Now I tried to instrument the clock tick as well but I got
some problem. I configured the ecos with instrument support and used the
following program, but the output didn't contains the clock tick. shown in
below thanks a lot.



PROGRAM
void cyg_start(void)
{
 int i;

  diag_printf("Starting User Program!\n");

 cyg_instrument_enable(CYG_INSTRUMENT_CLASS_CLOCK, 0);
 cyg_instrument_enable(CYG_INSTRUMENT_CLASS_THREAD, 0);

 diag_printf("Program to play with instrumentation buffer\n");

 cyg_thread_delay(15);

 cyg_instrument_disable(CYG_INSTRUMENT_CLASS_CLOCK, 0);
 cyg_instrument_disable(CYG_INSTRUMENT_CLASS_THREAD, 0);

 for (i = 0; i < instrument_buffer_size; ++i) {
 diag_printf("Record %02d: type 0x%04x, thread %d, ",
	i, instrument_buffer[i].type, instrument_buffer[i].thread);
 diag_printf("time %5d, arg1 0x%08x, arg2 0x%08x\n",
	instrument_buffer[i].timestamp, instrument_buffer[i].arg1,
	instrument_buffer[i].arg2);
 }
}


OUTPUT:

Program to play with instrumentation buffer
Record 00: type 0x0207, thread 1, time 43698, arg1 0x00084844, arg2
0x0000000f
Record 01: type 0x0202, thread 1, time 43730, arg1 0x00084844, arg2
0x00000000
Record 02: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 03: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 04: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 05: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 06: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 07: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 08: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 09: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 10: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 11: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 12: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 13: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 14: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 15: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 16: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 17: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 18: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Record 19: type 0x0000, thread 0, time     0, arg1 0x00000000, arg2
0x00000000
Program End!!

The Clock related instrument is 0x800

-----Original Message-----
From: ecos-discuss-owner at sources dot redhat dot com
[mailto:ecos-discuss-owner at sources dot redhat dot com]On Behalf Of Andrew Lunn
Sent: 26 March 2003 10:50
To: Qiang Huang
Cc: Ecos-Discuss
Subject: Re: [ECOS] Question about Instrumentation? Thanks


On Wed, Mar 26, 2003 at 10:42:36AM -0000, Qiang Huang wrote:
> Hi all:
>    I just tried to use kernel instrumentation in ecos. I have a question:
> Seen from the source code in "instrmnt/meminst.cxx", In function
> "cyg_instrument( )" it just record the time stamp by reading the clock as
> "HAL_CLOCK_READ( &p->timestamp );", but the system clock is running
forever
> and roll over when it reach the limits, so through the whole program the
> clock may have already been roll over some times so how can I interept the
> time stamp recorded by the kernel instrumentation? probably a later
> instrumentation will have the time stamp less than the earlier one? so
how?
> Am I wrong somewhere?

You need to combine the timestamp with the instrumentation for
ticks. Normally the HAL_CLOCK_READ returns the number of hardware
ticks since the last eCos clock tick. When the HW signals an interrupt
an eCos tick will happen and an instrumentation log will be made. So
add the two together to get a unique time.

        Andrew

--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]