This is the mail archive of the ecos-discuss@sourceware.org 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: Performance timing


C B wrote:
> Thanks Mike.  That was very helpful.
>
> I guess my hope that I'd be able to make a simple call to get the time before and after my timed event was a little naive... :)
>
>
>   

This is certainly still possible.  It's pretty easy to extract the
pertinent code/functions
from tm_basic.  You just have to remember what you are actually
measuring - if
just knowing how long it takes to run a certain function is what you're
after, then
this will do fine.

One caveat: tm_basic's timing method falls apart if the function
requires more than
one system clock tick to accomplish.  If you suspect this to be the
case, you'll have
to capture the value of cyg_current_time() as well as HAL_CLOCK_READ().
>   
>> Date: Fri, 16 Nov 2007 13:55:28 -0600
>> From: arth2219@gmail.com
>> To: csb_80@hotmail.com
>> Subject: Re: [ECOS] Performance timing
>> CC: gary@mlbassoc.com; ecos-discuss@ecos.sourceware.org
>>
>> On Nov 16, 2007 1:47 PM, C B  wrote:
>>     
>>> System profiling is probably what I need.
>>>
>>> Unfortunately there isn't an implementation of the profiling timer for my target. Any information or guidance available that you're aware of for implementing this?
>>>       
>> The eCos Reference Manual has this functionality documented:
>> http://ecos.sourceware.org/docs-latest/ref/gprof.html
>>
>> It's pretty straight forward to implement with in your HAL. You'll
>> need a spare hardware timer to use for your instrumentation. Try
>> looking in other HALs that use the profile timer as an example.
>>
>> You need to setup two functions to implement the profile instrumentation:
>> 1.) int hal_enable_profile_timer(int resolution)
>> * Initializes hardware timer and ISR.
>> 2.) unsigned int profile_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data,
>> HAL_SavedRegisters *regs)
>> * Saves current program counter
>> * Handles timer hardware
>>
>>     
-- 
Gary Thomas
Capt, CAP CO-021
home/office: (970) 352-4947,  cell: (970) 481-5112


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


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