Page MenuHomeWildfire Games

Make profiler2 configurable
ClosedPublic

Authored by Stan on Nov 26 2019, 5:10 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24340: Make Profiler2 configurable in visual mode. Non visual doesn't load the config…
Summary

Like me some other devs have stuff running on the 8000 port, and the game will start a debug break if port is already used. Instead it would be nice if one could change that without needing to recompile the game. This patch does that.

Also notice the profiler2 is broken if you don't have D2373 applied and you are running the userreporter.
Also notify the user that a json file is written to disk.

Test Plan

Play around with the options to try different configuration.
Make you sure you can now host on other ports

Diff Detail

Event Timeline

Stan created this revision.Nov 26 2019, 5:10 PM

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/651/display/redirect

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

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

Stan retitled this revision from Make profiler configurable to Make profiler2 configurable.Nov 26 2019, 5:28 PM
Stan edited the summary of this revision. (Show Details)
vladislavbelov added inline comments.
binaries/data/config/default.cfg
137

I think number fields can be just numbers, not strings.

source/ps/Profiler2.cpp
194

Is it safe to pass local variables?

946

The value was different, wasn't it?

Stan marked 3 inline comments as done.Nov 26 2019, 5:32 PM
Stan added inline comments.
binaries/data/config/default.cfg
137

I wanted them to be but how to the concat ?

source/ps/Profiler2.cpp
194

Mongoose is not *safe* There are quite a few warnings in that lib...

946

It was but it makes no point does it?

binaries/data/config/default.cfg
137

Just get value as string?

source/ps/Profiler2.cpp
194

I mean will it access string pointers after mg_start call? After current scoped?

946

I think it doesn't work, because ConstructJSONResponse does a search for GetName(), not for CStr(storage->GetName()).EscapeToPrintableASCII(). That means it won't find a thread in case of unprintable characters.

Stan updated this revision to Diff 10428.Nov 27 2019, 12:19 PM
Stan marked 5 inline comments as done.

Use ints remove the changes.

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/653/display/redirect

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

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

Stan added a comment.May 25 2020, 11:51 AM

Looks like I forgot to send my comments...

binaries/data/config/default.cfg
137

Of course XD

source/ps/Profiler2.cpp
194

I'm not sure, can you help me there? What should be done instead?

946

Alright, I'll revert it.

Stan marked an inline comment as done.May 25 2020, 11:51 AM
Stan updated this revision to Diff 12007.May 25 2020, 5:59 PM
Stan added a subscriber: wraitii.

Use Cstr instead of std::string and replace std::stringstream by fmt::format following advice from @wraitii

Stan updated this revision to Diff 12008.May 25 2020, 6:10 PM

Add back context

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.

source/ps/Profiler2.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"
Executing section JS...
Executing section cli...

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

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.

source/ps/Profiler2.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"
Executing section JS...
Executing section cli...

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

Stan updated this revision to Diff 12024.May 26 2020, 11:40 AM

Add a comment about live profiler not working if port is not 8000

Stan updated this revision to Diff 12025.May 26 2020, 11:51 AM

better explanation

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/837/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/838/display/redirect

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.

source/ps/Profiler2.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"
Executing section JS...
Executing section cli...

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

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.

source/ps/Profiler2.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"
Executing section JS...
Executing section cli...

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

Stan updated this revision to Diff 12036.May 28 2020, 8:20 PM

Years, JSP to JSON

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/847/display/redirect

Stan updated this revision to Diff 12037.May 28 2020, 8:55 PM

Revert Jsonp changes as it's a legit format

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/848/display/redirect

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

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

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

Linter detected issues:
Executing section Source...

source/ps/Profiler2.h
|  96| class·CProfiler2
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCProfiler2{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

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

Stan updated this revision to Diff 14411.Dec 5 2020, 10:58 PM

Rebase before committing

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2288/display/redirect

Vulcan added a comment.Dec 6 2020, 9:41 AM

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

builderr-debug-gcc7.txt
../../../source/ps/Profiler2.cpp: In member function 'void CProfiler2::SaveToFile()':
../../../source/ps/Profiler2.cpp:937:15: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} [-Wformat=]
  debug_printf("Writing profile data to %s \n", path.string8());
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~
builderr-release-gcc7.txt
../../../source/ps/Profiler2.cpp: In member function 'void CProfiler2::SaveToFile()':
../../../source/ps/Profiler2.cpp:937:15: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} [-Wformat=]
  debug_printf("Writing profile data to %s \n", path.string8());
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~

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

This revision was not accepted when it landed; it landed in state Needs Review.Dec 7 2020, 9:12 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.