Page MenuHomeWildfire Games

Show system_info.txt path in terminal when it's written
AcceptedPublic

Authored by elexis on Aug 22 2019, 8:16 PM.

Details

Reviewers
Stan
Summary

It should be obvious to the user that runs the program from commandline if the program writes a debug logfile, and the path to that file.
It had been added for userreporter, commands.txt, replay metadata, oos dumps, but not this file.

Test Plan

I heard debug_printf doesn't output on the terminal in windows... Also there might be more files to report.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 9010
Build 14760: Vulcan BuildJenkins
Build 14759: arc lint + arc unit

Event Timeline

elexis created this revision.Aug 22 2019, 8:16 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/455/display/redirect

Stan added a subscriber: Stan.Sep 30 2019, 5:10 PM

Indeed debug_printf doesn't work on windows but that's because we use OutputDebugStringW which redirects to a special debug output instead https://stackoverflow.com/questions/55432747/showing-outputdebugstring-messages-with-window-application

see source/lib/debug.cpp and source/lib/sysdep/os/win/wdbg.cpp

Since it's not really used unless you rely on https://docs.microsoft.com/en-us/sysinternals/downloads/debugview (Which is why I use btw)

We could even disable it for windows for releases as it has a bad performance impact. However we don't do that many debug writes.

https://stackoverflow.com/questions/729435/overhead-associated-with-outputdebugstring-in-release-build

As for other files being written, I guess you could write in the log when printing screenshots and saving the game if that's not already done. Also for user.cfg and the like.

Stan accepted this revision.EditedNov 21 2019, 12:09 PM
[23152] HRT: activating HPET failed: Unknown error (-100022, 0xFFFFFFFFFFFE794A)
[23152] HRT: using name=TSC freq=2712000000.000000
[23152] HRT: counter=TSC freq=2.712e+09 res=3.68732e-10 bits=64
[23152] TIMER| InitVfs: 4.49666 ms
[23152] Writing the mainlog at C:\Users\stanislas.dolcini\AppData\Local\0ad\logs\mainlog.html
[23152] TIMER| CONFIG_Init: 6.09396 ms
[23152] Sound: AlcInit success, using OpenAL Soft
[23152] TIMER| shutdown ConfigDB: 0.71792 us
[23152] TIMER| resource modules: 10.0137 ms
[23152] TIMER TOTALS (10 clients)
[23152] -----------------------------------------------------
[23152]   tc_dds_transform: 0 c (0x)
[23152]   tc_png_decode: 0 c (0x)
[23152]   tc_pool_alloc: 0 c (0x)
[23152]   tc_commit: 0 c (0x)
[23152]   tc_transform: 0 c (0x)
[23152]   tc_plain_transform: 0 c (0x)
[23152]   tc_ShaderGLSLLink: 0 c (0x)
[23152]   tc_ShaderGLSLCompile: 0 c (0x)
[23152]   tc_ShaderValidation: 0 c (0x)
[23152]   xml_validation: 0 c (0x)
[23152] -----------------------------------------------------
[23152] TIMER| shutdown misc: 1.20522 ms
[23152] TIMER| InitVfs: 6.45715 ms
[23152] Writing the mainlog at C:\Users\stanislas.dolcini\AppData\Local\0ad\logs\mainlog.html
[23152] TIMER| CONFIG_Init: 7.38263 ms
[23152] Sound: AlcInit success, using OpenAL Soft
[23152] Unknown cache/TLB descriptor 0xc3
[23152] UserReport written to C:\Users\stanislas.dolcini\AppData\Local\0ad\logs\userreport_hwdetect.txt
[23152] TIMER| RunHardwareDetection: 28.5013 ms
[23152] TIMER| write_sys_info: 9.75737 ms
[23152] TIMER| InitRenderer: 28.2761 ms
[23152] TIMER| ps_console: 27.3919 ms
[23152] TIMER| ps_lang_hotkeys: 3.46217 ms
[23152] TIMER| common/modern/setup.xml: 2.89245 ms
[23152] TIMER| common/modern/styles.xml: 788.783 us
[23152] TIMER| common/modern/sprites.xml: 3.65729 ms
[23152] TIMER| common/setup.xml: 1.73428 ms
[23152] TIMER| common/sprites.xml: 1.7665 ms
[23152] TIMER| common/styles.xml: 500.215 us
[23152] TIMER| pregame/backgrounds/: 2.96526 ms
[23152] TIMER| pregame/sprites.xml: 612.612 us
[23152] TIMER| pregame/styles.xml: 439.068 us
[23152] TIMER| pregame/mainmenu.xml: 98.3877 ms
[23152] TIMER| common/global.xml: 959.385 us
[23152] TIMER| common/modern/setup.xml: 351.133 us
[23152] TIMER| common/modern/styles.xml: 382.129 us
[23152] TIMER| common/modern/sprites.xml: 3.01484 ms
[23152] TIMER| splashscreen/setup.xml: 1.07705 ms
[23152] TIMER| splashscreen/splashscreen.xml: 28.2974 ms
[23152] TIMER| common/global.xml: 430.824 us
[23152] E:[IU]   : Failed to open the configuration file! Exiting... 
[23152] TIMER| shutdown TexMan: 1.93732 us
[23152] TIMER| shutdown Renderer: 2.99142 ms
[23152] TIMER| shutdown SDL: 82.9757 ms
[23152] TIMER| shutdown UserReporter: 2.4152 ms
[23152] TIMER| shutdown ConfigDB: 0.950959 us
[23152] TIMER| resource modules: 32.6692 ms
[23152] TIMER TOTALS (0 clients)
[23152] -----------------------------------------------------
[23152] -----------------------------------------------------
[23152] TIMER| shutdown misc: 1.31033 ms

Given this windows log and a few other texts, other potential canditates:

  • console.txt // Created when using the console.
  • matchsettings.json // Created when starting a SP match
  • matchsettings.mp.json // Created when starting a MP match
  • Interestinglog.html // Created all the time.

On the scope of this patch though, you are good as everything works as expected.

[23152] E:[IU]   : Failed to open the configuration file! Exiting...

I always seem to get that error.

EDIT: Seems to be a harmless windows bug.

This revision is now accepted and ready to land.Nov 21 2019, 12:09 PM
Stan added a comment.Nov 26 2019, 4:18 PM

Was missing Profiler2::SaveToFile() that's writing a file as well.