Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411482 Posts in 69370 Topics- by 58426 Members - Latest Member: shelton786

April 23, 2024, 11:12:31 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Made a tool (real-time frame-based profiler)... - ideas?
Pages: [1]
Print
Author Topic: Made a tool (real-time frame-based profiler)... - ideas?  (Read 816 times)
Kiith-Sa
Level 0
*



View Profile
« on: October 10, 2014, 03:49:16 PM »

Hi,

I got a bit carried away procrastinating from my thesis on a side-project (originally was: profiler as a library so I could measure overhead as the game runs to balance stuff between threads). Ended up with a somewhat usable tool (does what I need at the moment). Something like a (very) poor man's RAD Telemetry ...I think.

Very unstable. Also in D and (at least for now) only usable with D code. Aaand the only builds are for 64-bit Linux (... at least for now, it should compile and run on anything with SDL and GL3.3).

Screenshot:



Video

Source/downloads/(D)tutorial/etc: https://github.com/kiith-sa/despiker


Anyway, while I need to work on my thesis now, I think this is pretty interesting and plan to return to this eventually, so I'd like some ideas:

What (functionality) would you like in a tool like this?

Few ideas I've gathered so far:

https://github.com/kiith-sa/despiker/labels/enhancement
Logged

nox
Level 0
***



View Profile WWW
« Reply #1 on: October 11, 2014, 03:57:13 AM »

I read in an old Game Programming Gems that Command and Conquer Renegade had a system like this, but I can't find any pics right now. I suppose it was cutting edge at the time; that might be a good place to look for ideas other than RAD telemetry. Also Apple's Instruments is pretty nice, and Adobe Scout is OK.

Anyway, I'm very grateful that someone is working on things like this...because otherwise I'm stuck with cachegrind + kcachegrind on Linux, and it's not super pleasant.

How about a line graph that shows CPU usage over time so that you can jump to hotspots?
Logged

Kiith-Sa
Level 0
*



View Profile
« Reply #2 on: October 11, 2014, 06:47:41 AM »

Thanks for the GPG tip; I'll look at it when I get the chance. While I can't use either Scout or Instruments, from seeing screenshots I already have some ideas (e.g. showing UI events in Instruments - can be generalized to show any event the user wants, e.g. keypress, entity spawn, resource load, etc.).

I originally didn't think about a CPU usage graph since all of my games (PC obviously) just used all CPU time they could, but it makes sense. I think instead of thinking of 'minimap' and 'plots' as separate ideas, I'll just have a big minimap showing plots with whatever variables the user wants, not just frame lengths; so the user can jump to the frame depending on whatever variable (frame length, CPU usage, time spent in a zone of interest, etc.) they might be interested in.


As for profiling on Linux, I suggest looking at 'perf'; it's rather badly documented, but typing 'perf' into the console on Ubuntu/Debian/Mint will tell you what package to install (probably 'linux-tools-common').

'perf' is a set of tools, originally made for profiling the kernel but very useful for profiling anything. The most interesting tool IMO is 'perf top', which is like 'top' but for functions (and can drill down to assembly) - so you can see e.g. which functions spent most time during the last 10 seconds.

It can also see many things other than CPU time (data accesses, cache accesses/misses for all caches, branches taken/mispredicted, etc, and if you look at CPU-specific documentation, a lot more).

Links for 'perf':

https://perf.wiki.kernel.org/index.php/Tutorial
http://linux.die.net/man/1/perf-top

Callgrind is excellent but not so much for game profiling, unless the game has no graphics.
Logged

JoshuaSmyth
Level 0
***


View Profile WWW
« Reply #3 on: October 23, 2014, 01:11:57 AM »

Awesome!

I've found a custom frame-by-frame profiler to be super useful. Other features I have implemented are a short history (records the last 500 or so frames) and it also works over a network - So I can attach to another PC or device. One last feature is that I provide a call tree view as well as a list of the top 10 hotspots.

Here is what it looks like:
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic