From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Garnett To: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] instrumentation buffers Date: Thu, 24 May 2001 05:45:00 -0000 Message-id: References: <004001c0e43e$f5b18110$1400a8c0@rts.com.pl> X-SW-Source: 2001-05/msg00416.html "=?iso-8859-2?B?TWFyZWsgo7Fja2k=?=" writes: > Hi > I have a gquestion. Does threads events are wrote in order of time??????. > Is counter reset during of working ??? > I have unexpected values in time positions. I tested a timeslicing. I have > three threads( ID =3,4,5) with the same priority= 10. I received results > switching between thread ID-3 ,4 ,5 is sometime in the same time - and > settings of timeslicing are 5 ticks): > How can I solve this problem ???? > > Record 00: type 0x0205, thread 1, time 778, > Record 01: type 0x0205, thread 1, time 806, > Record 02: type 0x0205, thread 1, time 835, > Record 03: type 0x0209, thread 2, time -27810, > Record 04: type 0x0201, thread 2, time -27612, > Record 05: type 0x0209, thread 3, time -27587, > Record 06: type 0x0201, thread 3, time 113, > Record 07: type 0x0209, thread 4, time 139, > Record 08: type 0x0201, thread 4, time 113, > Record 09: type 0x0209, thread 5, time 139, > Record 10: type 0x0201, thread 5, time 112, > Record 11: type 0x0201, thread 3, time 113, > Record 12: type 0x0201, thread 4, time 112, > Record 13: type 0x0201, thread 5, time 113, > Record 14: type 0x0201, thread 3, time 113, > Record 15: type 0x0201, thread 4, time 112, > Record 16: type 0x0201, thread 5, time 112, > Record 17: type 0x0201, thread 3, time 112, > Record 18: type 0x0201, thread 4, time 112, > Record 19: type 0x0201, thread 5, time 114, > Record 20: type 0x0201, thread 3, time 113, > Record 21: type 0x0201, thread 4, time 112, > Record 22: type 0x0201, thread 5, time 113, > Record 23: type 0x0201, thread 3, time 112, > Record 24: type 0x0201, thread 4, time 113, > Record 25: type 0x0201, thread 5, time 113, > Record 26: type 0x0201, thread 3, time 113, > Record 27: type 0x0201, thread 4, time 112, > Record 28: type 0x0201, thread 5, time 113, > Record 29: type 0x0201, thread 3, time 113, > Record 30: type 0x0201, thread 4, time 5061, > Record 31: type 0x0000, thread 0, time 0, > The times recorded in the instrumentation buffer are read out of the hardware timer device with HAL_CLOCK_READ(). These values are not RTC ticks, they are much higher resolution than that. Since you are only instrumenting thread events, you are not seeing the clock interrupts, where the hardware timer resets to zero. In the main part of the program, each thread switch is driven by the clock interrupt and occurs about 113 ticks later. If you want to see what is really going on, enable the CLOCK and maybe the INTR events too. -- Nick Garnett, eCos Kernel Architect Red Hat, Cambridge, UK