Opened 14 years ago

Closed 14 years ago

Last modified 5 years ago

#9115 closed patch

PSP: prepare for gprof

Reported by: bluddy Owned by: bluddy
Priority: normal Component: Port: PSP
Version: Keywords:
Cc: Game:


Allow gprof to be easily activated using a switch in the custom makefile. Upon exit, scummvm should save gmon.out. Use 'psp-gprof gmon.out > gprof.txt' to view the output.

Ticket imported from: #2903608. Ticket imported from: patches/1220.

Attachments (1)

patch.diff (4.6 KB ) - added by bluddy 14 years ago.
Updated patch works globally

Download all attachments as: .zip

Change History (14)

comment:1 by lordhoto, 14 years ago

Is there any reason "gprof_cleanup()" has to be called? Like otherwise memory etc. won't be clean after exiting ScummVM?

I would also probably change "PSP_USE_GPROF" to "USE_GPROF", that way we could use the same define for other platforms with gprof support too (and also maybe add a configure option --enable-gprof, which takes care for that, so people can use gprof with configure on the PSP (and maybe other platforms) too).

comment:2 by bluddy, 14 years ago

Sure, I could make it global. Didn't realize there would be interest in that. 'gprof_cleanup' is a standard call, at least on the PSP, to allow the buffer gprof has built up in memory to be written out to a gmon.out file.

by bluddy, 14 years ago

Attachment: patch.diff added

Updated patch works globally

comment:3 by bluddy, 14 years ago

Here's the global patch. Note: 1. Must disable some engines to have enough memory for gprof on PSP. 2. Dynamic plugins don't work well with gprof. 3. I didn't add the -pg LDFLAG globally because some backends might use ld instead of gcc and ld doesn't understand -pg.

comment:4 by fingolfin, 14 years ago

Folks, we already have --enable-profiling -- please use/extend that, instead of adding another redundant option :).

comment:5 by bluddy, 14 years ago

That's embarrassing. OK, I'll change it so the PSP uses that.

comment:6 by lordhoto, 14 years ago

Oh Max is right, I didn't find that today in configure while I wrote this comment, sorry :-). Maybe that's because I searched for "gprof" instead of "profiling", I somehow thought we had something like that already anyway... :-)

Maybe we should add some documentation for "--enable-profiling", or is it non documented in --help, because it's not relevant for builders/users?

comment:7 by fingolfin, 14 years ago

So, what do we do with this item? Can it be closed?

I also documented "--enable-profiling" and "--enable-release".

comment:8 by bluddy, 14 years ago

I'm tackling PSP optimization next (I decided I need to finish with the PSP stuff before moving on to other stuff) so I'll get back to updating this patch ie. no need to close it.

comment:9 by sev-, 14 years ago

What is the status of this item?

comment:10 by bluddy, 14 years ago

Err... I ended up adding this, so the item can be closed now.

comment:11 by fingolfin, 14 years ago

Closing this then.

And update tracker access rights for bluddy so that he can easily do it himself next time ;)

comment:12 by fingolfin, 14 years ago

Owner: set to bluddy
Status: newclosed

comment:13 by digitall, 5 years ago

Component: Port: PSP
Note: See TracTickets for help on using tickets.