<br><br><div><span class="gmail_quote">On 3/24/06, <b class="gmail_sendername">Luigi Rizzo</b> <<a href="mailto:rizzo@icir.org">rizzo@icir.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
followup, a patch implementing the profiling code is on Mantis,<br><br> <a href="http://bugs.digium.com/view.php?id=6795">http://bugs.digium.com/view.php?id=6795</a><br><br>I would be grateful if some good soul could tell me what's
<br>the header file that defines rdtsc() for i586+ platforms<br>(it is in <machine/cpufunc.h> for FreeBSD) and whether<br>there is an equivalent high performance counter available<br>on other systems with different CPUs (
e.g. i486...)</blockquote><div><br>
You can get indepth working code for various cpus' performance counters
by perusing oprofile - <a href="http://oprofile.sourceforge.net/news/">http://oprofile.sourceforge.net/news/</a><br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">cheers<br>luigi<br><br>On Fri, Mar 24, 2006 at 01:19:43AM -0800, Luigi Rizzo wrote:
<br>> i have decided to do a bit of profiling of the locking in asterisk,<br>> and with a little bit of code (maybe 100 lines total)<br>> implemented a simple 'show profile' command that lets you track<br>> the time spent in various sections of code using the TSC timer.
<br>> I will post the code once polished.<br>><br>> Below, you see the output generated by putting (automatically)<br>> wrappers around the various mutex_lock functions, slightly modified<br>> so that we first do (and time) a trylock, and if it fails we then do
<br>> the blocking operation (not timed to avoid counting time<br>> where the CPU is doing other things).<br>><br>> Note something interesting: i have no IAX devices connected, yet<br>> iax2 does approx 200 mutex_lock per second.
<br>> Each mutex lock in my case costs between 1000 and 2000 ticks<br>> (it is a 2 GHz CPU).<br>><br>> more data later...<br>> if you have any ideas on places to profile, let me know.<br>> the mechanism is good for counting time as well as events
<br>> or other user-defined values.<br>><br>> cheers<br>> luigi<br>><br>> *CLI> show uptime<br>> System uptime: 2 minutes, 54 seconds<br>> *CLI> show profile chan<br>> profile values (183, allocated 190)
<br>> -------------------<br>>
item
scale events
total_ticks avg_ticks event_name<br>>
15: [
0] 0 0 0
mtx_lock_chanvars.c<br>> 36:
[
0]
43 47148
1096 mtx_lock_channel.c<br>> 60:
[
0] 2
3480 1740
mtx_lock_chan_agent.c<br>> 61:
[
0] 0 0 0
mtx_lock_chan_features.c<br>> 64:
[
0] 40773
40135552 984
mtx_lock_chan_iax2.c<br>> 65:
[
0] 0 0 0
mtx_lock_chan_local.c<br>> 66:
[
0] 714 1013180
1419 mtx_lock_chan_mgcp.c<br>> 67:
[
0] 0 0 0
mtx_lock_chan_oss.c<br>> 68:
[
0]
2729 3406424
1248 mtx_lock_chan_sip.c<br>> 69:
[
0] 178
509808 2864
mtx_lock_chan_skinny.c<br>> 70:
[
0] 357
513900 1439
mtx_lock_chan_zap.c<br>> 76:
[
0] 0 0 0
mtx_lock_app_chanisavail.c<br>> 77:
[
0] 0 0 0
mtx_lock_app_chanspy.c<br>> 85:
[
0] 0 0 0
mtx_lock_app_dumpchan.c<br>> 167:
[
0] 0 0 0
mtx_lock_func_channel.c<br>><br>> _______________________________________________<br>> --Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br>><br>> asterisk-dev mailing list
<br>> To UNSUBSCRIBE or update options visit:<br>> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>_______________________________________________
<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">
http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Mike Taht<br>PostCards From the Bleeding Edge<br><a href="http://the-edge.blogspot.com">http://the-edge.blogspot.com
</a>