Downloads
release
dev builds
extras
themes
Documentation
manual
wiki
device status
Support
forums
mailing lists
IRC
Development
bugs
patches
dev guide
translations
Search
Donate
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Welcome to the Rockbox Technical Forums!
Rockbox Technical Forums
Rockbox General
Rockbox General Discussion
Profiling progressing, but need help
« previous
next »
Print
Pages: [
1
]
2
Author
Topic: Profiling progressing, but need help (Read 10167 times)
lostlogic
Developer
Member
Posts: 125
Profiling progressing, but need help
«
on:
December 03, 2005, 06:24:33 PM »
Latest profiling patch, including the parser code is here:
http://lostlogicx.com/transfer/rockbox_profile.patch
Take output from the parser and compare two profiling runs with this perl script:
http://lostlogicx.com/transfer/profile_comparator.pl
Double link is deprecated, but available here:
http://lostlogicx.com/transfer/profile-double-link.tar.gz
Design:
Use -finstrument-functions option from GCC to automatically call profiling functions at entry and exit of each function to profile
Implement the actual profiling functions under other names to avoid symbol duplication
Implement small wrapper functions (indirection hurts) to export profiling symbols to APIs or wherever they to be used
Add calls to switch_thread to shutdown and restart profiling
Use a wrapper call in thread.c to initiate profiling so that the profiling code knows what thread it belongs to, in theory this could be extended so that we can have per-thread profiling states, but that is not the current situation
Use statically allocated arrays in memory to store profiling data. I guessed at the sizes for these, there's gotta be a better way to size them to accomodate what is to be profiled
Pulled from gmon.c in gcc (with credit given) a linked list like structure for profiling data wihch gives flexibility and reasonable speed to finding what counters to increment when
Use #ifdef RB_PROFILE to keep dis code out when nothing's supposed to be profiled
Time in functions is recorded in 100us increments.
Profiling only runs on the thread it's started on so it doesn't have synchronization issues
Profiling output format is functional, but PC based not symbol name based.
Things that need help:
Currently I use the 'normal' user timer interface for timer creation, this means that when CPU frequency changes, the timer tries to stay the same length in time. For profiling, you want to measure length in clocks, not in time. We need a different timer initialization that does this. This is a low priority, because profiling is so slow that it's always boosted.
«
Last Edit: December 10, 2005, 12:25:05 AM by lostlogic
»
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #1 on:
December 03, 2005, 06:54:42 PM »
EEK, don't use the patch until I post a new version, it freezes.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #2 on:
December 03, 2005, 07:04:54 PM »
Ok, so now it doesn't freeze, but the caller data is for the call _site_ not the top of the function... working on it. (same links, just updated)
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #3 on:
December 03, 2005, 07:24:02 PM »
Link updated again, now it has the right caller address, but it takes some more instructions to get it. This is somewhat less than stellar, but it works for now.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
LinusN
Member
Posts: 1903
Re: Profiling progressing, but need help
«
Reply #4 on:
December 04, 2005, 04:32:02 AM »
I like this. Keep up the good work and visit the IRC channel often. :-)
Logged
Archos Jukebox 6000, Recorder, FM Recorder/iAudio X5/iriver H1x0, H3x0/Toshiba Gigabeat F20/iPod G5, G5.5
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #5 on:
December 04, 2005, 03:39:54 PM »
Wahoo, somewhat real results, will post a new patch shortly, I found the bug in my logic that was breaking with context switches.
[edit]New patch uploaded. This version works a lot better, and I pulled somestuff that was not relevent from the patch.[/edit]
«
Last Edit: December 04, 2005, 04:03:09 PM by lostlogic
»
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #6 on:
December 05, 2005, 04:26:36 PM »
http://lostlogicx.com/transfer/profile.debug.out
Here is some sample output from a long (about 1.5 songs) profiling run, and with the debug section of the output activated (that part inside #if(0) in the patch).
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
BiNiaRiS
Member
Posts: 11
Re: Profiling progressing, but need help
«
Reply #7 on:
December 05, 2005, 08:07:02 PM »
maybe i'm not reading it right...but what exactly does this do?
Logged
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #8 on:
December 05, 2005, 10:47:43 PM »
Google software profiling or gmon (GCC's profiling program) -- records call counts and time in functions for all functions executed within the profiled area of code.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #9 on:
December 07, 2005, 02:38:08 PM »
More updates.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #10 on:
December 07, 2005, 07:00:44 PM »
Now in two flavors!
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #11 on:
December 07, 2005, 11:40:27 PM »
Single link updated with much better parsing code that account for local symbols and exported symbols.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #12 on:
December 09, 2005, 03:42:16 PM »
Submitted to patch tracker:
http://sourceforge.net/tracker/index.php?func=detail&atid=439120&group_id=44306&aid=1376651
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
ego
Member
Posts: 129
Re: Profiling progressing, but need help
«
Reply #13 on:
December 10, 2005, 11:53:54 AM »
can you dumb it down a little more? i don't understand your explanation, sorry
(the closest they have to a drooling emote)
Logged
lostlogic
Developer
Member
Posts: 125
Re: Profiling progressing, but need help
«
Reply #14 on:
December 12, 2005, 08:56:35 PM »
Software profiling is creating an execution profile of the software. Counting the time spent in every function (or those selected for profiling) and how many times it is called. This is very helpful for optimizing software, obviously, especially when the software's bottleneck is in CPU cycles as it is for decoding music on rockbox.
Logged
I've killed 2 iRiver H340s and I have 1 iPod 5th Generation (Black), and if playback is broken, it's probably my fault.
Print
Pages: [
1
]
2
« previous
next »
Rockbox Technical Forums
Rockbox General
Rockbox General Discussion
Profiling progressing, but need help
SMF 2.0.19
|
SMF © 2021
,
Simple Machines
Rockbox Privacy Policy
XHTML
RSS
WAP2
Page created in 0.141 seconds with 22 queries.