Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GetSysDirectory spam #10703

Merged

Conversation

Dentomologist
Copy link
Contributor

Launching and then immediately closing Dolphin results in 51 (out of 81 total) lines of "Common\FileUtil.cpp:916 I[COMMON]: GetSysDirectory: Setting to [Dolphin Sys path]:". Most lines happen during startup and thus only show up in dolphin.log but 10 also appear in the log widget. Starting a game creates more such lines.

Unless I've misunderstood something the Sys path is constant for any given Dolphin session, and so there's no reason to recreate it each time GetSysDirectory is called.

This PR creates and logs the Sys directory path once, and also does some minor refactoring and removes the extraneous colon at the end of the line.

@Dentomologist Dentomologist force-pushed the remove_getsysdirectory_spam branch 2 times, most recently from 75f9265 to f5dfa2c Compare May 28, 2022 08:23
Source/Core/Common/FileUtil.cpp Outdated Show resolved Hide resolved
Source/Core/Common/FileUtil.cpp Outdated Show resolved Hide resolved
@Dentomologist
Copy link
Contributor Author

I made your suggested changes.

@Dentomologist Dentomologist force-pushed the remove_getsysdirectory_spam branch 2 times, most recently from 3df0193 to 23a3ec5 Compare May 29, 2022 17:50
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this happens in practice, but on Android, s_android_sys_directory can be changed at any time, which would affect subsequent calls to GetSysDirectory(). Can we verify this on Android?

Otherwise seems fine to me.

@JosJuice
Copy link
Member

It will change exactly once (from an empty string to a non-empty string). The assert that's in the code should catch any cases of GetSysDirectory being called before it changes. But we may want to add an additional assert to SetSysDirectory to ensure it never changes twice.

@Dentomologist
Copy link
Contributor Author

I've added the SetSysDirectory assert.

@AdmiralCurtiss AdmiralCurtiss merged commit fc6ba6b into dolphin-emu:master Jun 2, 2022
10 checks passed
@Dentomologist Dentomologist deleted the remove_getsysdirectory_spam branch June 2, 2022 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants