[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] PERF macros
From: |
Adam Dunkels |
Subject: |
[lwip-users] Re: [lwip] PERF macros |
Date: |
Thu, 09 Jan 2003 02:07:59 -0000 |
Hi Kieran!
On Tuesday 05 February 2002 16.01, you wrote:
> I'm interested in doing some profiling on lwIP to identify current
> bottlenecks. I notice the PERF_START and PERF_STOP macros, which look
> like they provide some measurement of performance of some key routines.
> Can anyone explain (briefly) what it is they do, as defined for the unix
> architecture?
They actually only work on Pentium class CPUs since they use the (slightly
undocumented) RTDSC function that returns a 64 bit cycle count. The
perf_print() prints out the difference in cycles into a file. They should
work equally well on other PC systems including Windows and DOS.
Since this is the actual processor cycle count, it will be affected by things
such as IRQs, context switches, other processes and such. By running the lwIP
process at the highest priority, the effects can be minimized and by taking
the average of many samples, it gives pretty good values.
(There is also a more generic implementation of the PERF macros that uses the
times function, but that is not as good for timing smaller functions.)
/adam
--
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] Re: [lwip] PERF macros,
Adam Dunkels <=