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
WIP: COMMON: Added tracy profiler support #2686
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
|
||
#ifndef COMMON_TRACE_H | ||
#define COMMON_TRACE_H | ||
|
||
#ifdef TRACY_ENABLE | ||
#include "tracy/Tracy.hpp" | ||
|
||
#define traceValueScoped(name, x) ZoneNamedN(__tracy_scoped_##name, #name, true); ZoneValueV(__tracy_scoped_##name, (uint64_t)(x)) | ||
#define tracePlot(name, x) TracyPlot(name, x) | ||
#define traceMsg(message) TracyMessageL(message) | ||
#define traceThread(name) tracy::SetThreadName(name) | ||
#define traceMutex(type, varname, name) type varname { tracy::SourceLocationData{ nullptr, name, __FILE__, __LINE__, 0 } } | ||
|
||
#define traceBeginFrame(name) (void)0 | ||
#define traceEndFrame(name) FrameMark | ||
#define traceScoped(name) ZoneNamedN(__tracy_scoped_##name, #name, true) | ||
#define traceScopedFunc() ZoneNamedN(__tracy_scoped_function_, __FUNCTION__, true) | ||
#else | ||
#define traceValueScoped(name, x) (void)0 | ||
#define tracePlot(name, x) (void)0 | ||
#define traceMsg(message) (void)0 | ||
#define traceThread(name) (void)0 | ||
#define traceMutex(type, varname, name) type varname | ||
|
||
#define traceBeginFrame(name) (void)0 | ||
#define traceEndFrame(name) (void)0 | ||
#define traceScoped(name) (void)0 | ||
#define traceScopedFunc() (void)0 | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1070,6 +1070,7 @@ const Feature s_features[] = { | |
{ "translation", "USE_TRANSLATION", false, true, "Translation support" }, | ||
{ "vkeybd", "ENABLE_VKEYBD", false, false, "Virtual keyboard support"}, | ||
{ "eventrecorder", "ENABLE_EVENTRECORDER", false, false, "Event recorder support"}, | ||
{ "tracy", "ENABLE_TRACY", false, false, "Tracy profiler support"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not yet done - will be finished if we can agree to include this - but |
||
{ "updates", "USE_UPDATES", false, false, "Updates support"}, | ||
{ "dialogs", "USE_SYSDIALOGS", false, true, "System dialogs support"}, | ||
{ "langdetect", "USE_DETECTLANG", false, true, "System language detection support" }, // This feature actually depends on "translation", there | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of throwing in code to the codebase like this. Would like to hear opinions of other devs.
I see that the lib author made it very straightforward by including everything into once source file, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely true - this is just for letting people play with it to decide whether a proper integration is worth the work. Just like to get feedback if I should continue to integrate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "problem" that I see here is that it's not a single c++ source file - but a lot of different headers and a lot of c++ files. Also the capture files are save, but the network protocol might differ from version to version. So it's the best to keep the profiler ui and the profiler "server" in sync somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The author is suggesting this as integration method, too - https://github.com/wolfpld/tracy/blob/master/manual/tracy.tex#L388
One could also just assume that people who want to profile can copy the source files manually to the proper location and the build system will pick it up if that files exist. This wouldn't be a problem for make - but for msvc you would most likely have to re-run create_project for it.