Author Topic: Got an oprofile...  (Read 2180 times)

nigel

  • Guest
Got an oprofile...
« on: November 23, 2010, 01:01:04 am »
Code: [Select]
[email protected]:~$ telnet 10.1.0.2
Trying 10.1.0.2...
Connected to 10.1.0.2.
Escape character is '^]'.
/ # cd /boot/local/bin/oprofile/
/boot/local/oprofile # source setup.sh
Setting paths (this is why you need to do 'source setup.sh')...
Initializing 64 MB of SWAP space (opreport is quite RAM hungry, keep your profile sessions short or eat SWAPlag)...
Setting up swapspace version 1, size = 67104768 bytes
UUID=0fea24ef-aaee-4df4-a3e6-30de8f99c1c5
Initializing oprofile...
Done. 'opcontrol --start' to start profiling. 'htop' for resource monitoring, process management and verifying SWAP is working.
/boot/local/oprofile # opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /usr/local/oprofile/captureddata/samples/oprofiled.log
Daemon started.
Profiler running.
/boot/local/oprofile # ls /tmp/
opd_pipe  utmp      wtmp
/boot/local/oprofile # opcontrol --stop
Stopping profiling.
/boot/local/oprofile # opcontrol --start
Profiler running.
/boot/local/oprofile # opcontrol --stop
Stopping profiling.
/boot/local/oprofile # opcontrol --dump
/boot/local/oprofile # opreport --session-dir=/boot/local/oprofile/captureddata
--symbols --debug-info /boot/local/ports/alephone/alephone --threshold=5.0
Overflow stats not available
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        linenr info                 symbol name
2958     29.9939  (no location information)   void Mixer::Mix<short, true, true>(short*, int)
1542     15.6358  low_level_textures.h:194    void texture_vertical_polygon_lines<unsigned short, 0, false>(bitmap_definition*, view_data*, _vertical_polygon_data*, short*, short*, unsigned char*)
1134     11.4987  images.cpp:759              dingoo_hud_downscale(SDL_Surface*)
894       9.0651  (no location information)   Rasterizer_SW_Class::texture_horizontal_polygon(polygon_definition&)
/boot/local/oprofile #

It's a code profiling tool, similar to gprof (which isn't available on mipsel-linux-uclibc/dingux). You can use it to see how much CPU time parts of your code take, amongst other things. More info here. Needed two small source tweaks, libs (BFD) and a kernel with profiling support compiled in but it appears to be working well with very little overhead. As you see I already quickly typed up a script to easily start the thing - mainly because I had to anyway in order not to go insane between reboots - but it would need a bit of work before I can archive it up into something that's useful for others.

So, is there any interest in this?

PS: And yes, seems sound/sdl-mixer(?) is the biggest performance issue on all ports with all dingux/roots up til now, but that was already clear without oprofile :P.

clach04

  • Posts: 256
Re: Got an oprofile...
« Reply #1 on: November 23, 2010, 02:01:06 am »
It's a code profiling tool, similar to gprof (which isn't available on mipsel-linux-uclibc/dingux). You can use it to see how much CPU time parts of your code take, amongst other things. More info here. Needed two small source tweaks, libs (BFD) and a kernel with profiling support compiled in but it appears to be working well with very little overhead. As you see I already quickly typed up a script to easily start the thing - mainly because I had to anyway in order not to go insane between reboots - but it would need a bit of work before I can archive it up into something that's useful for others.

So, is there any interest in this?

PS: And yes, seems sound/sdl-mixer(?) is the biggest performance issue on all ports with all dingux/roots up til now, but that was already clear without oprofile :P.

This is awesome!

I'm not a Dingux developer (I'm using native) but this really is very, very cool. If you get chance, I'd suggest hanging out on the IRC channel as a number of Dingux devs are usually on there and chat about this there to gauge interest. This isn't something I can make use of but it is very impressive.

darfgarf

  • Guest
Re: Got an oprofile...
« Reply #2 on: November 23, 2010, 08:45:08 am »
could be useful, personally i just use 'time foo.dge' and if i want to time somethign in code have it do a fprintf(stderr, "%i", get_current_time(whatever version of time function you like));

 

Post a new topic