FS#11176 - Keep track of threads' CPU runtime

Attached to Project: Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Monday, 05 April 2010, 17:41 GMT
Task Type Patches
Category Operating System/Drivers
Status New
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This patch adds a per-thread runtime variable which indicates the ticks the particular thread has been running.

This can for example help identifying threads that occupy the CPU for a long period of time.
This task depends upon

Comment by Marcin Bukat (MarcinBukat) - Tuesday, 13 April 2010, 12:41 GMT
It shows thread total cpu time which is in my opinion rather usless. I think it would be better to setup some timeframe to present how cpu time is distributed (I mean thread tics count/tics per timeframe).
Comment by Maurus Cuelenaere (mcuelenaere) - Wednesday, 14 April 2010, 11:04 GMT
I know the current implementation is rather limited, but it's very simple and not really intrusive (it could easily be #ifdef'ed).

I've thought about being able to reset the thread running time in the debug menu or making a (background) plugin which logs and displays/graphs the running time in a more usable way, but haven't gotten to it yet.

This patch is more a proof of concept than actually usable for mainline.