It's possible to track invalid file reads happening in the game during run-time. The error message 'Invalid File Access' means reading or trying to open files from a thread which is not the streaming thread. These file access operations can cause quite severe stalls.
Currently the file access tracking only logs access from the main and render thread.
The following cvars will trigger different option to track the file access.
sys_PakLogInvalidFileAccess:
1 (default):
2:
sys_PakMessageInvalidFileAccess:
The points which define when file access is invalid are set using ICryPak::DisableRuntimeFileAccess with true or false. These points may need to be tweaked for single player and multiplayer.
It is possible to add some exceptions to the file access tracking, so you ignore certain files (e.g game.log).
Simply create an instance of CDebugAllowFileAccess in the scope which accesses the file.
The files collected using pak_LogInvalidFileAccess 2 will need their callstacks resolving, to this we need the .pdb/s from the build, the XenonStackParse tool, and the helper script ProcessFileAccess.py
The tools can found in the XenonStackParse folder of the Tools directory.
The directory structure for running ProcessFileAccess.py should be as follows:
<Root>
--> XenonStackParse
--> FileAccessLogs (this dir should contain the .pdbs)
------> Processed (outut from XenonStackParse)
Run ProcessFileAccess.py from the FileAccessLogs dir (XenonStackParse uses the working directory to search for the .pdb files). This will create a direction called processed, which will have a file containing the resolved callstack for each of the logged files.