[Scummvm-git-logs] scummvm master -> eaf41006e65c9983fe4c00d13059536c9e091fc4

rsn8887 noreply at scummvm.org
Mon Jul 28 13:53:59 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
eaf41006e6 PSP2: Add profiling support with vitagprof


Commit: eaf41006e65c9983fe4c00d13059536c9e091fc4
    https://github.com/scummvm/scummvm/commit/eaf41006e65c9983fe4c00d13059536c9e091fc4
Author: William Bonnaventure (william.bonnaventure at gmail.com)
Date: 2025-07-28T08:53:55-05:00

Commit Message:
PSP2: Add profiling support with vitagprof

vitagprof is a library to get working gprof profiling on vita
https://github.com/Aztorius/vita-gprof

Changed paths:
    backends/platform/sdl/psp2/psp2-main.cpp
    backends/platform/sdl/psp2/psp2.mk
    configure


diff --git a/backends/platform/sdl/psp2/psp2-main.cpp b/backends/platform/sdl/psp2/psp2-main.cpp
index ace47485074..c853bafb6f1 100644
--- a/backends/platform/sdl/psp2/psp2-main.cpp
+++ b/backends/platform/sdl/psp2/psp2-main.cpp
@@ -28,6 +28,10 @@
 #include "backends/plugins/psp2/psp2-provider.h"
 #include "base/main.h"
 
+#ifdef ENABLE_PROFILING
+	#include <vitagprof.h>
+#endif
+
 int _newlib_heap_size_user = 192 * 1024 * 1024;
 char boot_params[1024];
 
@@ -95,5 +99,9 @@ exit:
 	// Free OSystem
 	g_system->destroy();
 
+#ifdef ENABLE_PROFILING
+	gprof_stop("ux0:/data/gmon.out", 1);
+#endif
+
 	return res;
 }
diff --git a/backends/platform/sdl/psp2/psp2.mk b/backends/platform/sdl/psp2/psp2.mk
index c595d0fb37f..001c55e4a7a 100644
--- a/backends/platform/sdl/psp2/psp2.mk
+++ b/backends/platform/sdl/psp2/psp2.mk
@@ -10,7 +10,8 @@ psp2vpk: $(PSP2_EXE_STRIPPED) $(PLUGINS)
 	mkdir -p psp2pkg/data/
 	mkdir -p psp2pkg/doc/
 	vita-elf-create $(PSP2_EXE_STRIPPED) $(EXECUTABLE).velf
-	vita-make-fself -s -c $(EXECUTABLE).velf psp2pkg/eboot.bin
+# 	Disable ASLR with -na to support profiling, also it can slow things down
+	vita-make-fself -na -s -c $(EXECUTABLE).velf psp2pkg/eboot.bin
 ifdef DYNAMIC_MODULES
 	# Use psp2rela to convert the main binary to static, this allows plugins to use functions from it without any relocation
 	# TODO: Use psp2rela -fetch_base flag instead of using objdump when the change is widespread
diff --git a/configure b/configure
index 1e180e29f6b..f3a4b73c040 100755
--- a/configure
+++ b/configure
@@ -3449,7 +3449,14 @@ EOF
 		#the next line fixes "branch out of range" error in gob engine when -Os is used
 		append_var CXXFLAGS "-mlong-calls"
 		append_var CXXFLAGS "-mword-relocations"
-		append_var CXXFLAGS "-fomit-frame-pointer"
+		if test "$_enable_prof" = no ; then
+			# -fomit-frame-pointer is incompatible with profiling but is needed for gob engine
+			append_var CXXFLAGS "-fomit-frame-pointer"
+		fi
+		if test "$_enable_prof" = yes ; then
+			# disable dynamic modules when profiling
+			_dynamic_modules=no
+		fi
 		#ensure verbose output during linking to prevent buildbot kills after 1200 seconds
 		if test "$_verbose_build" = yes ; then
 			append_var LDFLAGS "-Wl,-v --verbose"
@@ -4190,6 +4197,9 @@ case $_backend in
 		append_var LIBS "-lSceNet_stub -lSceNetCtl_stub"
 		append_var LIBS "-lSceAppMgr_stub -lSceAppUtil_stub -lScePgf_stub"
 		append_var LIBS "-lSceTouch_stub -lSceHid_stub -lSceMotion_stub"
+		if test "$_enable_prof" = yes ; then
+			append_var LIBS "-lvitagprof"
+		fi
 		_sdl=yes
 		_sdlversion=2.0.0
 		append_var MODULES "backends/platform/sdl"




More information about the Scummvm-git-logs mailing list