mirror of
https://github.com/open-goal/jak-project
synced 2026-09-09 12:14:10 -04:00
tracing: add some more startup related events and a new --profile-until-event flag (#3385)
While trying to narrow down why sometimes SDL takes 20-40seconds to initialize I built up some more profiling features. TLDR - I still don't know why SDL is taking a long time but I've narrowed it down to it initializing the `GAME_CONTROLLER` subsystem. This isn't unprecedented, I found numerous github issues and articles suggesting this is the problem:  I imagine it is hardware/OS related on some level, there are even some recent commits in SDL that have made it worse on certain platforms. I've had this problem myself so I will hope to get it again soon so i can debug where in the SDL code the delay occurs and make a proper bug report. Hopefully this helps but it's not yet confirmed - https://github.com/open-goal/jak-project/pull/3384
This commit is contained in:
@@ -96,6 +96,7 @@ int main(int argc, char** argv) {
|
||||
bool disable_avx2 = false;
|
||||
bool disable_display = false;
|
||||
bool enable_profiling = false;
|
||||
std::string profile_until_event = "";
|
||||
std::string gpu_test = "";
|
||||
std::string gpu_test_out_path = "";
|
||||
int port_number = -1;
|
||||
@@ -111,6 +112,8 @@ int main(int argc, char** argv) {
|
||||
app.add_flag("--no-avx2", disable_avx2, "Disable AVX2 for testing");
|
||||
app.add_flag("--no-display", disable_display, "Disable video display");
|
||||
app.add_flag("--profile", enable_profiling, "Enables profiling immediately from startup");
|
||||
app.add_option("--profile-until-event", profile_until_event,
|
||||
"Stops recording profile events once an event with this name is seen");
|
||||
app.add_option("--gpu-test", gpu_test,
|
||||
"Tests for minimum graphics requirements. Valid Options are: [opengl]");
|
||||
app.add_option("--gpu-test-out-path", gpu_test_out_path,
|
||||
@@ -141,6 +144,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
prof().set_enable(enable_profiling);
|
||||
prof().set_waiting_for_event(profile_until_event);
|
||||
|
||||
// Create struct with all non-kmachine handled args to pass to the runtime
|
||||
GameLaunchOptions game_options;
|
||||
|
||||
Reference in New Issue
Block a user