-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (#31) Added possibility to save user metrics (a.k.a. arbitrary values) * `#include <easy/arbitrary_value.h>` * Use `EASY_VALUE("Name", variable_ref);` // See more options at `easy/arbitrary_value.h` * Added file converter (currently only .prof to .json is supported) * (#75) There is no need anymore to wait all threads finish their opened frames when dumping blocks to file/stream * (#81) Added CMake option to choose function names format * Added CMake option `EASY_PROFILER_NO_GUI` to build without `profiler_gui` * (#48) Minimized paddings in .prof file header * Bug fixes * Fixed `EASY_ENABLE_ALIGNMENT` build error * (#75) Fixed UI freeze when hitting `Cancel` button while transmitting profiled blocks from profiled application to the UI * Mac: Added support for building with Apple LLVM clang version < 8.0 * Add support for building with pre 2016 Apple LLVM clang * Automatically detect Apple clang that do not support thread_local * Clarify clang thread_local support code comment * (#72) Windows: VS2017 build fix * Unix: Context switch logger gets the processor cycle counter instead of time of a day * Other bug fixes * (#31) Added arbitrary values viewer * (#100) Added possibility to zoom in selected region * (#91) Added possibility to take a snapshot. Now you can save selected area to separate file. Works both with blue selection (hold right mouse button + move) and black ruler (double-click + hold mouse button + move) * Improved UI styles * Blocks histogram (under Diagram scene) is now resizeable * (#89) Added viewport info widget. See [Settings] -> [See viewport info] * Bug fixes * Fixed hierarchy building for zero duration blocks - events and arbitrary values are always visible * (#89) Trying to fix high-dpi displays problem (maybe not fixed 😞 ) * Other bug fixes
- Loading branch information
Showing
160 changed files
with
29,370 additions
and
6,218 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
ColumnLimit: 100 | ||
IndentWidth: 4 | ||
ReflowComments: false | ||
#IndentPPDirectives: PPDIS_AfterHash #since clang 6.0 | ||
... | ||
|
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 |
---|---|---|
|
@@ -51,17 +51,12 @@ install: | |
sudo apt-get -y install qt55tools qt55script qt55base qt55svg; | ||
else | ||
brew install gcc5; | ||
brew install qt5; | ||
brew link --force qt5; | ||
export HOMEBREW_QT5_VERSION=$(brew list --versions qt5 | rev | cut -d' ' -f1 | rev); | ||
ln -s /usr/local/Cellar/qt/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs; | ||
ln -s /usr/local/Cellar/qt/$HOMEBREW_QT5_VERSION/plugins /usr/local/plugins; | ||
echo "ls -l /usr/local/mkspecs"; | ||
ls -l /usr/local/mkspecs; | ||
echo "ls -l /usr/local/plugins"; | ||
ls -l /usr/local/plugins; | ||
echo "/usr/local/Cellar/qt/"; | ||
ls -l /usr/local/Cellar/qt/; | ||
brew install qt55; | ||
brew link --force qt55; | ||
export QT_NAME="[email protected]"; | ||
export HOMEBREW_QT5_VERSION=$(brew list --versions $QT_NAME | rev | cut -d' ' -f1 | rev); | ||
ln -s /usr/local/Cellar/$QT_NAME/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs; | ||
ln -s /usr/local/Cellar/$QT_NAME/$HOMEBREW_QT5_VERSION/plugins /usr/local/plugins; | ||
fi | ||
|
||
|
||
|
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2016-2018 Sergey Yagovtsev, Victor Zarubkin | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,23 @@ | ||
set(CPP_FILES | ||
converter.cpp | ||
reader.cpp) | ||
|
||
set(HEADER_FILES | ||
converter.h | ||
reader.h) | ||
|
||
include_directories(../easy_profiler_core/) | ||
include_directories(./include) | ||
|
||
add_executable(profiler_converter ${HEADER_FILES} ${CPP_FILES} main.cpp) | ||
target_link_libraries(profiler_converter easy_profiler) | ||
|
||
install( | ||
TARGETS | ||
profiler_converter | ||
RUNTIME | ||
DESTINATION | ||
bin | ||
) | ||
|
||
set_property(TARGET profiler_converter PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) |
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,138 @@ | ||
/** | ||
Lightweight profiler library for c++ | ||
Copyright(C) 2016-2018 Sergey Yagovtsev, Victor Zarubkin | ||
Licensed under either of | ||
* MIT license (LICENSE.MIT or http://opensource.org/licenses/MIT) | ||
* Apache License, Version 2.0, (LICENSE.APACHE or http://www.apache.org/licenses/LICENSE-2.0) | ||
at your option. | ||
The MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
The Apache License, Version 2.0 (the "License"); | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
**/ | ||
|
||
#include "converter.h" | ||
#include <fstream> | ||
|
||
void JsonExporter::convert(const profiler::reader::BlocksTreeNode& node, nlohmann::json& json) const | ||
{ | ||
if (node.info.descriptor != nullptr) | ||
{ | ||
json = {{"id", node.info.blockIndex}, | ||
{"name", node.info.descriptor->blockName}, | ||
{"start", node.info.beginTime}, | ||
{"stop", node.info.endTime}, | ||
{"descriptor", node.info.descriptor->id}}; | ||
} | ||
|
||
convertChildren(node, json); | ||
} | ||
|
||
void JsonExporter::convertChildren(const profiler::reader::BlocksTreeNode& node, nlohmann::json& json) const | ||
{ | ||
if (node.children.empty()) | ||
return; | ||
|
||
auto children = nlohmann::json::array(); | ||
for (const auto& child : node.children) | ||
{ | ||
children.emplace_back(); | ||
convert(child, children.back()); | ||
} | ||
|
||
json["children"] = children; | ||
} | ||
|
||
void JsonExporter::convert(const ::std::string& inputFile, const ::std::string& outputFile) const | ||
{ | ||
profiler::reader::FileReader fr; | ||
if (fr.readFile(inputFile) == 0) | ||
return; | ||
|
||
nlohmann::json json = {{"version", fr.getVersionString()}, {"timeUnits", "ns"}}; | ||
|
||
auto descriptors = nlohmann::json::array(); | ||
const auto& block_descriptors = fr.getBlockDescriptors(); | ||
for (const auto& descriptor : block_descriptors) | ||
{ | ||
descriptors.emplace_back(); | ||
|
||
std::stringstream stream; | ||
stream << "0x" << std::hex << descriptor.argbColor; | ||
|
||
auto& desc = descriptors.back(); | ||
|
||
desc["id"] = descriptor.id; | ||
if (descriptor.parentId != descriptor.id) | ||
desc["parentId"] = descriptor.parentId; | ||
|
||
desc["name"] = descriptor.blockName; | ||
desc["type"] = descriptor.blockType; | ||
desc["color"] = stream.str(); | ||
desc["sourceFile"] = descriptor.fileName; | ||
desc["sourceLine"] = descriptor.lineNumber; | ||
} | ||
|
||
json["blockDescriptors"] = descriptors; | ||
|
||
auto threads = nlohmann::json::array(); | ||
const auto& blocks_tree = fr.getBlocksTree(); | ||
for (const auto& kv : blocks_tree) | ||
{ | ||
threads.emplace_back(); | ||
|
||
auto& thread = threads.back(); | ||
thread["threadId"] = kv.first; | ||
thread["threadName"] = fr.getThreadName(kv.first); | ||
|
||
convertChildren(kv.second, thread); | ||
} | ||
|
||
json["threads"] = threads; | ||
|
||
try | ||
{ | ||
if (!outputFile.empty()) | ||
{ | ||
::std::ofstream file(outputFile); | ||
json.dump(file, true, 1); | ||
} | ||
else | ||
{ | ||
json.dump(::std::cout, true, 1); | ||
} | ||
} | ||
catch (...) | ||
{ | ||
::std::cout << "json.dump() error..."; | ||
} | ||
} |
Oops, something went wrong.