Easyprofiler added

This commit is contained in:
Arin Alexander 2018-02-28 23:19:04 +03:00
parent edb89544f8
commit 6ad35d63be
218 changed files with 36639 additions and 17 deletions

2
3rdparty/easyprofiler/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build/
/bin/

322
3rdparty/easyprofiler/CMakeCache.txt vendored Normal file
View File

@ -0,0 +1,322 @@
# This is the CMakeCache file.
# For build in directory: /home/alex/Work/C++Projects/easyprofiler
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Build easy_profiler as shared library.
BUILD_SHARED_LIBS:BOOL=ON
//Use std::chrono::high_resolution_clock as a timer
BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK:BOOL=OFF
//Use std::chrono::steady_clock as a timer
BUILD_WITH_CHRONO_STEADY_CLOCK:BOOL=OFF
//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=Release
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//CXX compiler
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the compiler during release builds for minimum
// size.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the compiler during release builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the compiler during release builds with debug info.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=easy_profiler
//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//Default listening port
EASY_DEFAULT_PORT:STRING=28077
//Enable new threads registration when collecting context switch
// events
EASY_OPTION_IMPLICIT_THREAD_REGISTRATION:BOOL=ON
//Enable automatic startListen on startup
EASY_OPTION_LISTEN:BOOL=OFF
//Print errors to stderr
EASY_OPTION_LOG:BOOL=OFF
//Use predefined set of colors (see profiler_colors.h). If you
// want to use your own colors palette you can turn this option
// OFF
EASY_OPTION_PREDEFINED_COLORS:BOOL=ON
//Use pretty-printed function names with signature and argument
// types
EASY_OPTION_PRETTY_PRINT:BOOL=OFF
//Enable self profiling (measure time for internal storage expand)
EASY_OPTION_PROFILE_SELF:BOOL=OFF
//Storage expand default status (profiler::ON or profiler::OFF)
EASY_OPTION_PROFILE_SELF_BLOCKS_ON:BOOL=OFF
//The directory containing a CMake configuration file for Qt5Core.
Qt5Core_DIR:PATH=/home/alex/Work/Qt/5.8/gcc_64/lib/cmake/Qt5Core
//The directory containing a CMake configuration file for Qt5Gui.
Qt5Gui_DIR:PATH=/home/alex/Work/Qt/5.8/gcc_64/lib/cmake/Qt5Gui
//The directory containing a CMake configuration file for Qt5Widgets.
Qt5Widgets_DIR:PATH=/home/alex/Work/Qt/5.8/gcc_64/lib/cmake/Qt5Widgets
//Value Computed by CMake
easy_profiler_BINARY_DIR:STATIC=/home/alex/Work/C++Projects/easyprofiler
//Dependencies for the target
easy_profiler_LIB_DEPENDS:STATIC=general;pthread;
//Value Computed by CMake
easy_profiler_SOURCE_DIR:STATIC=/home/alex/Work/C++Projects/easyprofiler
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/home/alex/Work/C++Projects/easyprofiler
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=5
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/home/alex/Work/C++Projects/easyprofiler
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=5
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1

View File

@ -0,0 +1,68 @@
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "5.4.0")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_template_template_parameters;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP)
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

Binary file not shown.

View File

@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Linux-4.4.0-93-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-93-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-4.4.0-93-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "4.4.0-93-generic")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)

View File

@ -0,0 +1,533 @@
/* This source file must have a .cpp extension so that all C++ compilers
recognize the extension without flags. Borland does not know .cxx for
example. */
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
# define COMPILER_ID "Fujitsu"
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
# define COMPILER_ID "ADSP"
#if defined(__VISUALDSPVERSION__)
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
#elif defined(__ARMCC_VERSION)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
# if defined(_SGI_COMPILER_VERSION)
/* _SGI_COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
# else
/* _COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__sgi)
# define COMPILER_ID "MIPSpro"
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
# define PLATFORM_ID "IRIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# else /* unknown platform */
# define PLATFORM_ID ""
# endif
#else /* unknown platform */
# define PLATFORM_ID ""
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID ""
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number components. */
#ifdef COMPILER_VERSION_MAJOR
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
#if __cplusplus >= 201402L
"14"
#elif __cplusplus >= 201103L
"11"
#else
"98"
#endif
"]";
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;
return require;
}

Binary file not shown.

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/alex/Work/C++Projects/easyprofiler")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/alex/Work/C++Projects/easyprofiler")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1,356 @@
The system is: Linux - 4.4.0-93-generic - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/3.5.1/CompilerIdCXX/a.out"
Determining if the CXX compiler works passed with the following output:
Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_56b63/fast"
/usr/bin/make -f CMakeFiles/cmTC_56b63.dir/build.make CMakeFiles/cmTC_56b63.dir/build
make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_56b63.dir/testCXXCompiler.cxx.o
/usr/bin/c++ -o CMakeFiles/cmTC_56b63.dir/testCXXCompiler.cxx.o -c /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_56b63
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_56b63.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_56b63.dir/testCXXCompiler.cxx.o -o cmTC_56b63 -rdynamic
make[1]: Leaving directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_aa90b/fast"
/usr/bin/make -f CMakeFiles/cmTC_aa90b.dir/build.make CMakeFiles/cmTC_aa90b.dir/build
make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -o CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
Linking CXX executable cmTC_aa90b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aa90b.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_aa90b -rdynamic
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.6' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_aa90b' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccL6oSX7.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_aa90b /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
make[1]: Leaving directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Parsed CXX implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command:"/usr/bin/make" "cmTC_aa90b/fast"]
ignore line: [/usr/bin/make -f CMakeFiles/cmTC_aa90b.dir/build.make CMakeFiles/cmTC_aa90b.dir/build]
ignore line: [make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp']
ignore line: [Building CXX object CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -o CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Linking CXX executable cmTC_aa90b]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aa90b.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_aa90b -rdynamic ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.6' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
ignore line: [Thread model: posix]
ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_aa90b' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccL6oSX7.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_aa90b /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccL6oSX7.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [--sysroot=/] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [--as-needed] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_aa90b] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..]
arg [CMakeFiles/cmTC_aa90b.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore
remove lib [gcc_s]
remove lib [gcc]
remove lib [gcc_s]
remove lib [gcc]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib]
implicit libs: [stdc++;m;c]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []
Detecting CXX [-std=c++14] compiler features compiled with the following output:
Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_46192/fast"
/usr/bin/make -f CMakeFiles/cmTC_46192.dir/build.make CMakeFiles/cmTC_46192.dir/build
make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_46192.dir/feature_tests.cxx.o
/usr/bin/c++ -std=c++14 -o CMakeFiles/cmTC_46192.dir/feature_tests.cxx.o -c /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_46192
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_46192.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_46192.dir/feature_tests.cxx.o -o cmTC_46192 -rdynamic
make[1]: Leaving directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers
Feature record: CXX_FEATURE:1cxx_alias_templates
Feature record: CXX_FEATURE:1cxx_alignas
Feature record: CXX_FEATURE:1cxx_alignof
Feature record: CXX_FEATURE:1cxx_attributes
Feature record: CXX_FEATURE:1cxx_attribute_deprecated
Feature record: CXX_FEATURE:1cxx_auto_type
Feature record: CXX_FEATURE:1cxx_binary_literals
Feature record: CXX_FEATURE:1cxx_constexpr
Feature record: CXX_FEATURE:1cxx_contextual_conversions
Feature record: CXX_FEATURE:1cxx_decltype
Feature record: CXX_FEATURE:1cxx_decltype_auto
Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types
Feature record: CXX_FEATURE:1cxx_default_function_template_args
Feature record: CXX_FEATURE:1cxx_defaulted_functions
Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
Feature record: CXX_FEATURE:1cxx_delegating_constructors
Feature record: CXX_FEATURE:1cxx_deleted_functions
Feature record: CXX_FEATURE:1cxx_digit_separators
Feature record: CXX_FEATURE:1cxx_enum_forward_declarations
Feature record: CXX_FEATURE:1cxx_explicit_conversions
Feature record: CXX_FEATURE:1cxx_extended_friend_declarations
Feature record: CXX_FEATURE:1cxx_extern_templates
Feature record: CXX_FEATURE:1cxx_final
Feature record: CXX_FEATURE:1cxx_func_identifier
Feature record: CXX_FEATURE:1cxx_generalized_initializers
Feature record: CXX_FEATURE:1cxx_generic_lambdas
Feature record: CXX_FEATURE:1cxx_inheriting_constructors
Feature record: CXX_FEATURE:1cxx_inline_namespaces
Feature record: CXX_FEATURE:1cxx_lambdas
Feature record: CXX_FEATURE:1cxx_lambda_init_captures
Feature record: CXX_FEATURE:1cxx_local_type_template_args
Feature record: CXX_FEATURE:1cxx_long_long_type
Feature record: CXX_FEATURE:1cxx_noexcept
Feature record: CXX_FEATURE:1cxx_nonstatic_member_init
Feature record: CXX_FEATURE:1cxx_nullptr
Feature record: CXX_FEATURE:1cxx_override
Feature record: CXX_FEATURE:1cxx_range_for
Feature record: CXX_FEATURE:1cxx_raw_string_literals
Feature record: CXX_FEATURE:1cxx_reference_qualified_functions
Feature record: CXX_FEATURE:1cxx_relaxed_constexpr
Feature record: CXX_FEATURE:1cxx_return_type_deduction
Feature record: CXX_FEATURE:1cxx_right_angle_brackets
Feature record: CXX_FEATURE:1cxx_rvalue_references
Feature record: CXX_FEATURE:1cxx_sizeof_member
Feature record: CXX_FEATURE:1cxx_static_assert
Feature record: CXX_FEATURE:1cxx_strong_enums
Feature record: CXX_FEATURE:1cxx_template_template_parameters
Feature record: CXX_FEATURE:1cxx_thread_local
Feature record: CXX_FEATURE:1cxx_trailing_return_types
Feature record: CXX_FEATURE:1cxx_unicode_literals
Feature record: CXX_FEATURE:1cxx_uniform_initialization
Feature record: CXX_FEATURE:1cxx_unrestricted_unions
Feature record: CXX_FEATURE:1cxx_user_literals
Feature record: CXX_FEATURE:1cxx_variable_templates
Feature record: CXX_FEATURE:1cxx_variadic_macros
Feature record: CXX_FEATURE:1cxx_variadic_templates
Detecting CXX [-std=c++11] compiler features compiled with the following output:
Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_270c0/fast"
/usr/bin/make -f CMakeFiles/cmTC_270c0.dir/build.make CMakeFiles/cmTC_270c0.dir/build
make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_270c0.dir/feature_tests.cxx.o
/usr/bin/c++ -std=c++11 -o CMakeFiles/cmTC_270c0.dir/feature_tests.cxx.o -c /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_270c0
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_270c0.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_270c0.dir/feature_tests.cxx.o -o cmTC_270c0 -rdynamic
make[1]: Leaving directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers
Feature record: CXX_FEATURE:1cxx_alias_templates
Feature record: CXX_FEATURE:1cxx_alignas
Feature record: CXX_FEATURE:1cxx_alignof
Feature record: CXX_FEATURE:1cxx_attributes
Feature record: CXX_FEATURE:0cxx_attribute_deprecated
Feature record: CXX_FEATURE:1cxx_auto_type
Feature record: CXX_FEATURE:0cxx_binary_literals
Feature record: CXX_FEATURE:1cxx_constexpr
Feature record: CXX_FEATURE:0cxx_contextual_conversions
Feature record: CXX_FEATURE:1cxx_decltype
Feature record: CXX_FEATURE:0cxx_decltype_auto
Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types
Feature record: CXX_FEATURE:1cxx_default_function_template_args
Feature record: CXX_FEATURE:1cxx_defaulted_functions
Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
Feature record: CXX_FEATURE:1cxx_delegating_constructors
Feature record: CXX_FEATURE:1cxx_deleted_functions
Feature record: CXX_FEATURE:0cxx_digit_separators
Feature record: CXX_FEATURE:1cxx_enum_forward_declarations
Feature record: CXX_FEATURE:1cxx_explicit_conversions
Feature record: CXX_FEATURE:1cxx_extended_friend_declarations
Feature record: CXX_FEATURE:1cxx_extern_templates
Feature record: CXX_FEATURE:1cxx_final
Feature record: CXX_FEATURE:1cxx_func_identifier
Feature record: CXX_FEATURE:1cxx_generalized_initializers
Feature record: CXX_FEATURE:0cxx_generic_lambdas
Feature record: CXX_FEATURE:1cxx_inheriting_constructors
Feature record: CXX_FEATURE:1cxx_inline_namespaces
Feature record: CXX_FEATURE:1cxx_lambdas
Feature record: CXX_FEATURE:0cxx_lambda_init_captures
Feature record: CXX_FEATURE:1cxx_local_type_template_args
Feature record: CXX_FEATURE:1cxx_long_long_type
Feature record: CXX_FEATURE:1cxx_noexcept
Feature record: CXX_FEATURE:1cxx_nonstatic_member_init
Feature record: CXX_FEATURE:1cxx_nullptr
Feature record: CXX_FEATURE:1cxx_override
Feature record: CXX_FEATURE:1cxx_range_for
Feature record: CXX_FEATURE:1cxx_raw_string_literals
Feature record: CXX_FEATURE:1cxx_reference_qualified_functions
Feature record: CXX_FEATURE:0cxx_relaxed_constexpr
Feature record: CXX_FEATURE:0cxx_return_type_deduction
Feature record: CXX_FEATURE:1cxx_right_angle_brackets
Feature record: CXX_FEATURE:1cxx_rvalue_references
Feature record: CXX_FEATURE:1cxx_sizeof_member
Feature record: CXX_FEATURE:1cxx_static_assert
Feature record: CXX_FEATURE:1cxx_strong_enums
Feature record: CXX_FEATURE:1cxx_template_template_parameters
Feature record: CXX_FEATURE:1cxx_thread_local
Feature record: CXX_FEATURE:1cxx_trailing_return_types
Feature record: CXX_FEATURE:1cxx_unicode_literals
Feature record: CXX_FEATURE:1cxx_uniform_initialization
Feature record: CXX_FEATURE:1cxx_unrestricted_unions
Feature record: CXX_FEATURE:1cxx_user_literals
Feature record: CXX_FEATURE:0cxx_variable_templates
Feature record: CXX_FEATURE:1cxx_variadic_macros
Feature record: CXX_FEATURE:1cxx_variadic_templates
Detecting CXX [-std=c++98] compiler features compiled with the following output:
Change Dir: /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_aba3e/fast"
/usr/bin/make -f CMakeFiles/cmTC_aba3e.dir/build.make CMakeFiles/cmTC_aba3e.dir/build
make[1]: Entering directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_aba3e.dir/feature_tests.cxx.o
/usr/bin/c++ -std=c++98 -o CMakeFiles/cmTC_aba3e.dir/feature_tests.cxx.o -c /home/alex/Work/C++Projects/easyprofiler/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_aba3e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aba3e.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_aba3e.dir/feature_tests.cxx.o -o cmTC_aba3e -rdynamic
make[1]: Leaving directory '/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/CMakeTmp'
Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers
Feature record: CXX_FEATURE:0cxx_alias_templates
Feature record: CXX_FEATURE:0cxx_alignas
Feature record: CXX_FEATURE:0cxx_alignof
Feature record: CXX_FEATURE:0cxx_attributes
Feature record: CXX_FEATURE:0cxx_attribute_deprecated
Feature record: CXX_FEATURE:0cxx_auto_type
Feature record: CXX_FEATURE:0cxx_binary_literals
Feature record: CXX_FEATURE:0cxx_constexpr
Feature record: CXX_FEATURE:0cxx_contextual_conversions
Feature record: CXX_FEATURE:0cxx_decltype
Feature record: CXX_FEATURE:0cxx_decltype_auto
Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types
Feature record: CXX_FEATURE:0cxx_default_function_template_args
Feature record: CXX_FEATURE:0cxx_defaulted_functions
Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers
Feature record: CXX_FEATURE:0cxx_delegating_constructors
Feature record: CXX_FEATURE:0cxx_deleted_functions
Feature record: CXX_FEATURE:0cxx_digit_separators
Feature record: CXX_FEATURE:0cxx_enum_forward_declarations
Feature record: CXX_FEATURE:0cxx_explicit_conversions
Feature record: CXX_FEATURE:0cxx_extended_friend_declarations
Feature record: CXX_FEATURE:0cxx_extern_templates
Feature record: CXX_FEATURE:0cxx_final
Feature record: CXX_FEATURE:0cxx_func_identifier
Feature record: CXX_FEATURE:0cxx_generalized_initializers
Feature record: CXX_FEATURE:0cxx_generic_lambdas
Feature record: CXX_FEATURE:0cxx_inheriting_constructors
Feature record: CXX_FEATURE:0cxx_inline_namespaces
Feature record: CXX_FEATURE:0cxx_lambdas
Feature record: CXX_FEATURE:0cxx_lambda_init_captures
Feature record: CXX_FEATURE:0cxx_local_type_template_args
Feature record: CXX_FEATURE:0cxx_long_long_type
Feature record: CXX_FEATURE:0cxx_noexcept
Feature record: CXX_FEATURE:0cxx_nonstatic_member_init
Feature record: CXX_FEATURE:0cxx_nullptr
Feature record: CXX_FEATURE:0cxx_override
Feature record: CXX_FEATURE:0cxx_range_for
Feature record: CXX_FEATURE:0cxx_raw_string_literals
Feature record: CXX_FEATURE:0cxx_reference_qualified_functions
Feature record: CXX_FEATURE:0cxx_relaxed_constexpr
Feature record: CXX_FEATURE:0cxx_return_type_deduction
Feature record: CXX_FEATURE:0cxx_right_angle_brackets
Feature record: CXX_FEATURE:0cxx_rvalue_references
Feature record: CXX_FEATURE:0cxx_sizeof_member
Feature record: CXX_FEATURE:0cxx_static_assert
Feature record: CXX_FEATURE:0cxx_strong_enums
Feature record: CXX_FEATURE:1cxx_template_template_parameters
Feature record: CXX_FEATURE:0cxx_thread_local
Feature record: CXX_FEATURE:0cxx_trailing_return_types
Feature record: CXX_FEATURE:0cxx_unicode_literals
Feature record: CXX_FEATURE:0cxx_uniform_initialization
Feature record: CXX_FEATURE:0cxx_unrestricted_unions
Feature record: CXX_FEATURE:0cxx_user_literals
Feature record: CXX_FEATURE:0cxx_variable_templates
Feature record: CXX_FEATURE:0cxx_variadic_macros
Feature record: CXX_FEATURE:0cxx_variadic_templates

View File

@ -0,0 +1,2 @@
# Hashes of file build rules.
74e55f76d310972c5aad534ac6b85d71 profiler_gui/CMakeFiles/profiler_gui_automoc

View File

@ -0,0 +1,36 @@
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/install.dir
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/list_install_components.dir
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/install/strip.dir
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/install/local.dir
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/rebuild_cache.dir
/home/alex/Work/C++Projects/easyprofiler/CMakeFiles/edit_cache.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/install.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/list_install_components.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/rebuild_cache.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/install/strip.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/install/local.dir
/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/edit_cache.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/install.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/list_install_components.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/rebuild_cache.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/install/strip.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/install/local.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/edit_cache.dir
/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui_automoc.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/install.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/list_install_components.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/rebuild_cache.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/edit_cache.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/profiler_sample_disabled_profiler.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/profiler_sample.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/install/strip.dir
/home/alex/Work/C++Projects/easyprofiler/sample/CMakeFiles/install/local.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/install.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/list_install_components.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/rebuild_cache.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/profiler_reader.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/install/local.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/install/strip.dir
/home/alex/Work/C++Projects/easyprofiler/reader/CMakeFiles/edit_cache.dir

View File

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

Binary file not shown.

View File

@ -0,0 +1,405 @@
const char features[] = {"\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
"1"
#else
"0"
#endif
"cxx_aggregate_default_initializers\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_alias_templates\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_alignas\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_alignof\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_attributes\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_attribute_deprecated\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_auto_type\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_binary_literals\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_constexpr\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_contextual_conversions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_decltype\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_decltype_auto\n"
"CXX_FEATURE:"
#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_decltype_incomplete_return_types\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_default_function_template_args\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_defaulted_functions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_defaulted_move_initializers\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_delegating_constructors\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_deleted_functions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_digit_separators\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_enum_forward_declarations\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_explicit_conversions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_extended_friend_declarations\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_extern_templates\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_final\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_func_identifier\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_generalized_initializers\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_generic_lambdas\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_inheriting_constructors\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_inline_namespaces\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_lambdas\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_lambda_init_captures\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_local_type_template_args\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_long_long_type\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_noexcept\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_nonstatic_member_init\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_nullptr\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_override\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_range_for\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_raw_string_literals\n"
"CXX_FEATURE:"
#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_reference_qualified_functions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
"1"
#else
"0"
#endif
"cxx_relaxed_constexpr\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
"1"
#else
"0"
#endif
"cxx_return_type_deduction\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_right_angle_brackets\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_rvalue_references\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_sizeof_member\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_static_assert\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_strong_enums\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus
"1"
#else
"0"
#endif
"cxx_template_template_parameters\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_thread_local\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_trailing_return_types\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_unicode_literals\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_uniform_initialization\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_unrestricted_unions\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
"1"
#else
"0"
#endif
"cxx_user_literals\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
"1"
#else
"0"
#endif
"cxx_variable_templates\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_variadic_macros\n"
"CXX_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
"1"
#else
"0"
#endif
"cxx_variadic_templates\n"
};
int main(int argc, char** argv) { (void)argv; return features[argc]; }

View File

@ -0,0 +1 @@
35

34
3rdparty/easyprofiler/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.0)
project(easy_profiler CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(EASY_PROGRAM_VERSION_MAJOR 1)
set(EASY_PROGRAM_VERSION_MINOR 3)
set(EASY_PROGRAM_VERSION_PATCH 0)
set(EASY_PRODUCT_VERSION_STRING "${EASY_PROGRAM_VERSION_MAJOR}.${EASY_PROGRAM_VERSION_MINOR}.${EASY_PROGRAM_VERSION_PATCH}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
# set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/sdk)
macro(easy_define_target_option TARGET SOURCE_OPTION TARGET_DEFINITION)
if (${SOURCE_OPTION})
set(_VALUE 1)
else ()
set(_VALUE 0)
endif ()
target_compile_options(${TARGET} PUBLIC -D${TARGET_DEFINITION}=${_VALUE})
endmacro()
SET(CMAKE_INSTALL_RPATH "$ORIGIN")
add_subdirectory(easy_profiler_core)
add_subdirectory(profiler_gui)
if (NOT EASY_PROFILER_NO_SAMPLES)
add_subdirectory(sample)
add_subdirectory(reader)
endif ()

177
3rdparty/easyprofiler/LICENSE.APACHE vendored Normal file
View File

@ -0,0 +1,177 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

18
3rdparty/easyprofiler/LICENSE.MIT vendored Normal file
View File

@ -0,0 +1,18 @@
Copyright (c) 2017 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.

224
3rdparty/easyprofiler/README.md vendored Normal file
View File

@ -0,0 +1,224 @@
# easy_profiler [![1.3.0](https://img.shields.io/badge/version-1.3.0-009688.svg)](https://github.com/yse/easy_profiler/releases)
[![Build Status](https://travis-ci.org/yse/easy_profiler.svg?branch=develop)](https://travis-ci.org/yse/easy_profiler)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/yse/easy_profiler?branch=develop&svg=true)](https://ci.appveyor.com/project/yse/easy-profiler/branch/develop)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
1. [About](#about)
2. [Key features](#key-features)
3. [Usage](#usage)
- [Prepare build system](#prepare-build-system)
- [General build system](#general)
- [CMake](#build-with-cmake)
- [Add profiling blocks](#add-profiling-blocks)
- [Collect blocks](#collect-blocks)
- [Collect via network](#collect-via-network)
- [Collect via file](#collect-via-file)
- [Note about context-switch](#note-about-context-switch)
4. [Build](#build)
- [Linux](#linux)
- [Windows](#windows)
5. [License](#license)
# About
Lightweight cross-platform profiler library for c++
You can profile any function in you code. Furthermore this library provide measuring time of any block of code.
For example, information for 12 millions of blocks is using less than 300Mb of memory.
Working profiler slows your application execution for only 1-2%.
![Block time](https://hsto.org/files/3e4/afe/8b7/3e4afe8b77ac4ad3a6f8c805be4b7f13.png)
_Average overhead per block is about 15ns/block (tested on Intel Core i7-5930K 3.5GHz, Win7)_
Disabled profiler will not affect your application execution in any way. You can leave it in your Release build
and enable it at run-time at any moment during application launch to see what is happening at the moment.
Also the library can capture system's context switch events between threads. Context switch information includes
duration, target thread id, thread owner process id, thread owner process name.
You can see the results of measuring in simple GUI application which provides full statistics and renders beautiful time-line.
![GUI screenshot](https://cloud.githubusercontent.com/assets/1775230/24852044/a0b1edd0-1dde-11e7-8736-7052b840ad06.png)
_Profiling CryEngine SDK example_
# Key features
- Extremely low overhead
- Low additional memory usage
- Cross-platform
- Measuring over network
- Capture thread context-switch events
- Fully remove integration via defines
- GUI could be connected to an application which is already profiling (so you can profile initialization of your application)
- Monitor main thread fps at real-time in GUI even if profiling is disabled or draw your own HUD/fps-plot directly in your application using data provided by profiler
- Configurable timer type with CMakeLists or defines
# Usage
## Prepare build system
### General
First of all you can specify path to include directory which contains `include/profiler` directory and define macro `BUILD_WITH_EASY_PROFILER`.
For linking with easy_profiler you can specify path to library.
### Build with cmake
If you are using `cmake` set `CMAKE_PREFIX_PATH` to `lib/cmake/easy_profiler` directory (from [release](https://github.com/yse/easy_profiler/releases) package) and use function `find_package(easy_profiler)` with `target_link_libraries(... easy_profiler)`. Example:
``` cmake
project(app_for_profiling)
set(SOURCES
main.cpp
)
#CMAKE_PREFIX_PATH should be set to <easy_profiler-release_dir>/lib/cmake/easy_profiler
find_package(easy_profiler REQUIRED)
add_executable(app_for_profiling ${SOURCES})
target_link_libraries(app_for_profiling easy_profiler)
```
## Add profiling blocks
Example of usage.
This code snippet will generate block with function name and Magenta color:
```cpp
#include <easy/profiler.h>
void frame() {
EASY_FUNCTION(profiler::colors::Magenta); // Magenta block with name "frame"
prepareRender();
calculatePhysics();
}
```
To profile any block you may do this as following.
You can specify these blocks also with Google material design colors or just set name of the block
(in this case it will have default color which is `Amber100`):
```cpp
#include <easy/profiler.h>
void foo() {
// some code
EASY_BLOCK("Calculating sum"); // Block with default color
int sum = 0;
for (int i = 0; i < 10; ++i) {
EASY_BLOCK("Addition", profiler::colors::Red); // Scoped red block (no EASY_END_BLOCK needed)
sum += i;
}
EASY_END_BLOCK; // This ends "Calculating sum" block
EASY_BLOCK("Calculating multiplication", profiler::colors::Blue500); // Blue block
int mul = 1;
for (int i = 1; i < 11; ++i)
mul *= i;
//EASY_END_BLOCK; // This is not needed because all blocks are ended on destructor when closing braces met
}
```
You can also use your own colors. easy_profiler is using standard 32-bit ARGB color format.
Example:
```cpp
#include <easy/profiler.h>
void bar() {
EASY_FUNCTION(0xfff080aa); // Function block with custom color
// some code
}
```
## Collect blocks
There are two ways to cature blocks
### Collect via network
It's most prefered and convenient approach in many case.
1. Initialize listening by `profiler::startListen()`. It's start new thread to listen on `28077` port the start-capture-signal from gui-application.
2. To stop listening you can call `profiler::stopListen()` function.
### Collect via file
1. Enable profiler by `EASY_PROFILER_ENABLE` macro
2. Dump blocks to file in any place you want by `profiler::dumpBlocksToFile("test_profile.prof")` function
Example:
```cpp
int main()
{
EASY_PROFILER_ENABLE;
/* do work*/
profiler::dumpBlocksToFile("test_profile.prof");
}
```
### Note about context-switch
To capture a thread context-switch event you need:
- On Windows: run profiling application "as administrator"
- On linux: you can run special `systemtap` script with root privileges as follow (example on Fedora):
```bash
#stap -o /tmp/cs_profiling_info.log scripts/context_switch_logger.stp name APPLICATION_NAME
```
APPLICATION_NAME - name of profiling application
# Build
## Prerequisites
* CMake 3.0 or higher
* Compiler with c++11 support
* for Unix systems: compiler with `thread_local` support is **highly recommended**: _GCC >=4.8_, _Clang >=3.3_
Additional requirements for GUI:
* Qt 5.3.0 or higher
## Linux
```bash
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE="Release" ..
$ make
```
## Windows
If you are using QtCreator IDE you can just open `CMakeLists.txt` file in root directory.
If you are using Visual Studio you can generate solution by cmake generator command.
Examples shows how to generate Win64 solution for Visual Studio 2013. To generate for another version use proper cmake generator (-G "name of generator").
### Way 1
Specify path to cmake scripts in Qt5 dir (usually in lib/cmake subdir) and execute cmake generator command,
for example:
```batch
$ mkdir build
$ cd build
$ cmake -DCMAKE_PREFIX_PATH="C:\Qt\5.3\msvc2013_64\lib\cmake" .. -G "Visual Studio 12 2013 Win64"
```
### Way 2
Create system variable "Qt5Widgets_DIR" and set it's value to "[path-to-Qt5-binaries]\lib\cmake\Qt5Widgets".
For example, "C:\Qt\5.3\msvc2013_64\lib\cmake\Qt5Widgets".
And then run cmake generator as follows:
```batch
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 12 2013 Win64"
```
# License
Licensed under either of
- MIT license ([LICENSE.MIT](LICENSE.MIT) or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0, ([LICENSE.APACHE](LICENSE.APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
at your option.

6
3rdparty/easyprofiler/appveyor.bat vendored Normal file
View File

@ -0,0 +1,6 @@
mkdir build_msvc
cd build_msvc
cmake -G "%GENERATOR%" ../
cmake --build . --config Release
goto :EOF

19
3rdparty/easyprofiler/appveyor.yml vendored Normal file
View File

@ -0,0 +1,19 @@
platform:
- Win64
configuration:
- Release
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
Qt5Widgets_DIR: "C:\\Qt\\5.5\\msvc2013_64\\lib\\cmake\\Qt5Widgets"
GENERATOR: "Visual Studio 12 2013 Win64"
test: off
build_script:
- CALL appveyor.bat
skip_commits:
message: /.*\[skip appveyor\].*/

View File

@ -0,0 +1,53 @@
# Install script for directory: /home/alex/Work/C++Projects/easyprofiler
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/cmake_install.cmake")
include("/home/alex/Work/C++Projects/easyprofiler/profiler_gui/cmake_install.cmake")
include("/home/alex/Work/C++Projects/easyprofiler/sample/cmake_install.cmake")
include("/home/alex/Work/C++Projects/easyprofiler/reader/cmake_install.cmake")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/home/alex/Work/C++Projects/easyprofiler/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/alex/Work/C++Projects/easyprofiler")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/alex/Work/C++Projects/easyprofiler")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "easy_profiler" for configuration "Release"
set_property(TARGET easy_profiler APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(easy_profiler PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libeasy_profiler.so"
IMPORTED_SONAME_RELEASE "libeasy_profiler.so"
)
list(APPEND _IMPORT_CHECK_TARGETS easy_profiler )
list(APPEND _IMPORT_CHECK_FILES_FOR_easy_profiler "${_IMPORT_PREFIX}/bin/libeasy_profiler.so" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View File

@ -0,0 +1,95 @@
# Generated by CMake 3.5.1
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
message(FATAL_ERROR "CMake >= 2.6.0 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget easy_profiler)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
endif()
if(TARGET ${_expectedTarget})
list(APPEND _targetsDefined ${_expectedTarget})
endif()
endforeach()
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT "${_targetsDefined}" STREQUAL "")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
endif()
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
# Create imported target easy_profiler
add_library(easy_profiler SHARED IMPORTED)
set_target_properties(easy_profiler PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "EASY_PROFILER_VERSION_MAJOR=1;EASY_PROFILER_VERSION_MINOR=3;EASY_PROFILER_VERSION_PATCH=0;EASY_DEFAULT_PORT=28077;BUILD_WITH_EASY_PROFILER=1"
INTERFACE_COMPILE_OPTIONS "-DEASY_CHRONO_STEADY_CLOCK=0;-DEASY_CHRONO_HIGHRES_CLOCK=0;-DEASY_OPTION_START_LISTEN_ON_STARTUP=0;-DEASY_OPTION_MEASURE_STORAGE_EXPAND=0;-DEASY_OPTION_STORAGE_EXPAND_BLOCKS_ON=0;-DEASY_OPTION_IMPLICIT_THREAD_REGISTRATION=1;-DEASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS=0;-DEASY_OPTION_LOG_ENABLED=0;-DEASY_OPTION_PRETTY_PRINT_FUNCTIONS=0;-DEASY_OPTION_BUILTIN_COLORS=1;-std=gnu++11"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "pthread"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
endif()
# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/easy_profilerTargets-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(target ${_IMPORT_CHECK_TARGETS} )
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
if(NOT EXISTS "${file}" )
message(FATAL_ERROR "The imported target \"${target}\" references the file
\"${file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_IMPORT_CHECK_FILES_FOR_${target})
endforeach()
unset(_IMPORT_CHECK_TARGETS)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View File

@ -0,0 +1,37 @@
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_CXX
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/block.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/easy_socket.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/event_trace_win.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/nonscoped_block.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/profile_manager.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/reader.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/thread_storage.cpp" "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o"
)
set(CMAKE_CXX_COMPILER_ID "GNU")
# Preprocessor definitions for this target.
set(CMAKE_TARGET_DEFINITIONS_CXX
"BUILD_WITH_EASY_PROFILER=1"
"EASY_DEFAULT_PORT=28077"
"EASY_PROFILER_VERSION_MAJOR=1"
"EASY_PROFILER_VERSION_MINOR=3"
"EASY_PROFILER_VERSION_PATCH=0"
"_BUILD_PROFILER=1"
)
# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
"easy_profiler_core/include"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@ -0,0 +1,275 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/alex/Work/C++Projects/easyprofiler
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/alex/Work/C++Projects/easyprofiler
# Include any dependencies generated for this target.
include easy_profiler_core/CMakeFiles/easy_profiler.dir/depend.make
# Include the progress variables for this target.
include easy_profiler_core/CMakeFiles/easy_profiler.dir/progress.make
# Include the compile flags for this target's objects.
include easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o: easy_profiler_core/block.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/block.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/block.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/block.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/block.cpp > CMakeFiles/easy_profiler.dir/block.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/block.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/block.cpp -o CMakeFiles/easy_profiler.dir/block.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o: easy_profiler_core/easy_socket.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/easy_socket.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/easy_socket.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/easy_socket.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/easy_socket.cpp > CMakeFiles/easy_profiler.dir/easy_socket.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/easy_socket.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/easy_socket.cpp -o CMakeFiles/easy_profiler.dir/easy_socket.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o: easy_profiler_core/event_trace_win.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/event_trace_win.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/event_trace_win.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/event_trace_win.cpp > CMakeFiles/easy_profiler.dir/event_trace_win.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/event_trace_win.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/event_trace_win.cpp -o CMakeFiles/easy_profiler.dir/event_trace_win.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o: easy_profiler_core/nonscoped_block.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/nonscoped_block.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/nonscoped_block.cpp > CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/nonscoped_block.cpp -o CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o: easy_profiler_core/profile_manager.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/profile_manager.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/profile_manager.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/profile_manager.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/profile_manager.cpp > CMakeFiles/easy_profiler.dir/profile_manager.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/profile_manager.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/profile_manager.cpp -o CMakeFiles/easy_profiler.dir/profile_manager.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o: easy_profiler_core/reader.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/reader.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/reader.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/reader.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/reader.cpp > CMakeFiles/easy_profiler.dir/reader.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/reader.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/reader.cpp -o CMakeFiles/easy_profiler.dir/reader.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o: easy_profiler_core/CMakeFiles/easy_profiler.dir/flags.make
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o: easy_profiler_core/thread_storage.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/easy_profiler.dir/thread_storage.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/thread_storage.cpp
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/easy_profiler.dir/thread_storage.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/thread_storage.cpp > CMakeFiles/easy_profiler.dir/thread_storage.cpp.i
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/easy_profiler.dir/thread_storage.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/thread_storage.cpp -o CMakeFiles/easy_profiler.dir/thread_storage.cpp.s
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.requires:
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.provides: easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.requires
$(MAKE) -f easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.provides.build
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.provides
easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.provides.build: easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o
# Object files for target easy_profiler
easy_profiler_OBJECTS = \
"CMakeFiles/easy_profiler.dir/block.cpp.o" \
"CMakeFiles/easy_profiler.dir/easy_socket.cpp.o" \
"CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o" \
"CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o" \
"CMakeFiles/easy_profiler.dir/profile_manager.cpp.o" \
"CMakeFiles/easy_profiler.dir/reader.cpp.o" \
"CMakeFiles/easy_profiler.dir/thread_storage.cpp.o"
# External object files for target easy_profiler
easy_profiler_EXTERNAL_OBJECTS =
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/build.make
bin/libeasy_profiler.so: easy_profiler_core/CMakeFiles/easy_profiler.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Linking CXX shared library ../bin/libeasy_profiler.so"
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/easy_profiler.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
easy_profiler_core/CMakeFiles/easy_profiler.dir/build: bin/libeasy_profiler.so
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/build
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/block.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/easy_socket.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/profile_manager.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/reader.cpp.o.requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/requires: easy_profiler_core/CMakeFiles/easy_profiler.dir/thread_storage.cpp.o.requires
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/requires
easy_profiler_core/CMakeFiles/easy_profiler.dir/clean:
cd /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core && $(CMAKE_COMMAND) -P CMakeFiles/easy_profiler.dir/cmake_clean.cmake
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/clean
easy_profiler_core/CMakeFiles/easy_profiler.dir/depend:
cd /home/alex/Work/C++Projects/easyprofiler && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : easy_profiler_core/CMakeFiles/easy_profiler.dir/depend

View File

@ -0,0 +1,16 @@
file(REMOVE_RECURSE
"CMakeFiles/easy_profiler.dir/block.cpp.o"
"CMakeFiles/easy_profiler.dir/easy_socket.cpp.o"
"CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o"
"CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o"
"CMakeFiles/easy_profiler.dir/profile_manager.cpp.o"
"CMakeFiles/easy_profiler.dir/reader.cpp.o"
"CMakeFiles/easy_profiler.dir/thread_storage.cpp.o"
"../bin/libeasy_profiler.pdb"
"../bin/libeasy_profiler.so"
)
# Per-language clean rules from dependency scanning.
foreach(lang CXX)
include(CMakeFiles/easy_profiler.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

View File

@ -0,0 +1,2 @@
# Empty dependencies file for easy_profiler.
# This may be replaced when dependencies are built.

View File

@ -0,0 +1,10 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# compile CXX with /usr/bin/c++
CXX_FLAGS = -O3 -DNDEBUG -fPIC -DEASY_CHRONO_STEADY_CLOCK=0 -DEASY_CHRONO_HIGHRES_CLOCK=0 -DEASY_OPTION_START_LISTEN_ON_STARTUP=0 -DEASY_OPTION_MEASURE_STORAGE_EXPAND=0 -DEASY_OPTION_STORAGE_EXPAND_BLOCKS_ON=0 -DEASY_OPTION_IMPLICIT_THREAD_REGISTRATION=1 -DEASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS=0 -DEASY_OPTION_LOG_ENABLED=0 -DEASY_OPTION_PRETTY_PRINT_FUNCTIONS=0 -DEASY_OPTION_BUILTIN_COLORS=1 -Wall -Wno-long-long -Wno-reorder -Wno-braced-scalar-init -pedantic -std=gnu++11 -std=gnu++11
CXX_DEFINES = -DBUILD_WITH_EASY_PROFILER=1 -DEASY_DEFAULT_PORT=28077 -DEASY_PROFILER_VERSION_MAJOR=1 -DEASY_PROFILER_VERSION_MINOR=3 -DEASY_PROFILER_VERSION_PATCH=0 -D_BUILD_PROFILER=1 -Deasy_profiler_EXPORTS
CXX_INCLUDES = -I/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include

View File

@ -0,0 +1 @@
/usr/bin/c++ -fPIC -O3 -DNDEBUG -shared -Wl,-soname,libeasy_profiler.so -o ../bin/libeasy_profiler.so CMakeFiles/easy_profiler.dir/block.cpp.o CMakeFiles/easy_profiler.dir/easy_socket.cpp.o CMakeFiles/easy_profiler.dir/event_trace_win.cpp.o CMakeFiles/easy_profiler.dir/nonscoped_block.cpp.o CMakeFiles/easy_profiler.dir/profile_manager.cpp.o CMakeFiles/easy_profiler.dir/reader.cpp.o CMakeFiles/easy_profiler.dir/thread_storage.cpp.o -lpthread -Wl,-rpath,:::::::

View File

@ -0,0 +1,9 @@
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1,309 @@
message(STATUS "")
message(STATUS "EASY_PROFILER.Core version = ${EASY_PRODUCT_VERSION_STRING}")
message(STATUS "")
#####################################################################
# Checking c++11 thread_local support
if (NOT WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
set(NO_CXX11_THREAD_LOCAL_SUPPORT TRUE)
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3")
set(NO_CXX11_THREAD_LOCAL_SUPPORT TRUE)
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0")
set(NO_CXX11_THREAD_LOCAL_SUPPORT TRUE)
endif ()
endif ()
# TODO: Check thread_local keyword support for other compilers for Unix
if (NO_CXX11_THREAD_LOCAL_SUPPORT)
message(WARNING " Your compiler does not support C++11 thread_local feature.")
message(WARNING " Without C++11 thread_local feature you may face to possible memory leak or application crash if using implicit thread registration and using EASY_THREAD instead of EASY_THREAD_SCOPE.")
endif ()
endif ()
#####################################################################
###########################################################
# EasyProfiler options:
set(EASY_OPTION_IMPLICIT_THREAD_REGISTER_TEXT "Enable new threads registration when collecting context switch events")
set(EASY_DEFAULT_PORT 28077 CACHE STRING "Default listening port")
set(EASY_OPTION_LISTEN OFF CACHE BOOL "Enable automatic startListen on startup")
set(EASY_OPTION_PROFILE_SELF OFF CACHE BOOL "Enable self profiling (measure time for internal storage expand)")
set(EASY_OPTION_PROFILE_SELF_BLOCKS_ON OFF CACHE BOOL "Storage expand default status (profiler::ON or profiler::OFF)")
set(EASY_OPTION_LOG OFF CACHE BOOL "Print errors to stderr")
set(EASY_OPTION_PRETTY_PRINT OFF CACHE BOOL "Use pretty-printed function names with signature and argument types")
set(EASY_OPTION_PREDEFINED_COLORS ON CACHE BOOL "Use predefined set of colors (see profiler_colors.h). If you want to use your own colors palette you can turn this option OFF")
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build easy_profiler as shared library.")
if (WIN32)
set(EASY_OPTION_IMPLICIT_THREAD_REGISTRATION ON CACHE BOOL ${EASY_OPTION_IMPLICIT_THREAD_REGISTER_TEXT})
set(EASY_OPTION_EVENT_TRACING ON CACHE BOOL "Enable event tracing by default")
set(EASY_OPTION_LOW_PRIORITY_EVENT_TRACING ON CACHE BOOL "Set low priority for event tracing thread")
else ()
if (NO_CXX11_THREAD_LOCAL_SUPPORT)
set(EASY_OPTION_IMPLICIT_THREAD_REGISTRATION OFF CACHE BOOL ${EASY_OPTION_IMPLICIT_THREAD_REGISTER_TEXT})
set(EASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS OFF CACHE BOOL "Enable easy_profiler to remove empty unguarded threads. This fixes potential memory leak on Unix systems, but may lead to an application crash! This is used when C++11 thread_local is unavailable.")
else ()
set(EASY_OPTION_IMPLICIT_THREAD_REGISTRATION ON CACHE BOOL ${EASY_OPTION_IMPLICIT_THREAD_REGISTER_TEXT})
endif ()
endif ()
set(BUILD_WITH_CHRONO_STEADY_CLOCK OFF CACHE BOOL "Use std::chrono::steady_clock as a timer" )
set(BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK OFF CACHE BOOL "Use std::chrono::high_resolution_clock as a timer")
# End EasyProfiler options.
###########################################################
#####################################################################
# Print EasyProfiler options status:
message(STATUS "-------- EASY_PROFILER OPTIONS: --------")
if (BUILD_WITH_CHRONO_STEADY_CLOCK)
message(STATUS " Use std::chrono::steady_clock as a timer")
elseif (BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK)
message(STATUS " Use std::chrono::high_resolution_clock as a timer")
else ()
if (WIN32)
message(STATUS " Use QueryPerformanceCounter as a timer")
else ()
message(STATUS " Use rtdsc as a timer")
endif ()
endif ()
message(STATUS " Default listening port = ${EASY_DEFAULT_PORT}")
message(STATUS " Auto-start listening = ${EASY_OPTION_LISTEN}")
message(STATUS " Profile self = ${EASY_OPTION_PROFILE_SELF}")
message(STATUS " Profile self blocks initial status = ${EASY_OPTION_PROFILE_SELF_BLOCKS_ON}")
message(STATUS " Implicit thread registration = ${EASY_OPTION_IMPLICIT_THREAD_REGISTRATION}")
if (WIN32)
message(STATUS " Event tracing = ${EASY_OPTION_EVENT_TRACING}")
message(STATUS " Event tracing has low priority = ${EASY_OPTION_LOW_PRIORITY_EVENT_TRACING}")
elseif (NO_CXX11_THREAD_LOCAL_SUPPORT)
if (EASY_OPTION_IMPLICIT_THREAD_REGISTRATION)
message(STATUS " WARNING! Implicit thread registration for Unix systems can lead to memory leak")
message(STATUS " because there is no possibility to check if thread is alive and remove dead threads.")
endif ()
message(STATUS " Removing empty unguarded threads = ${EASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS}")
if (EASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS)
message(STATUS " WARNING! Removing empty unguarded threads may lead to an application crash!")
message(STATUS " But fixes potential memory leak on Unix systems.")
else ()
message(STATUS " WARNING! There is a possibility of memory leak without removing empty unguarded threads.")
endif ()
endif ()
message(STATUS " Log messages = ${EASY_OPTION_LOG}")
message(STATUS " Function names pretty-print = ${EASY_OPTION_PRETTY_PRINT}")
message(STATUS " Use EasyProfiler colors palette = ${EASY_OPTION_PREDEFINED_COLORS}")
message(STATUS " Shared library: ${BUILD_SHARED_LIBS}")
message(STATUS "------ END EASY_PROFILER OPTIONS -------")
message(STATUS "")
# End printing EasyProfiler options status.
#####################################################################
#################################################
# Add source files:
set(CPP_FILES
block.cpp
easy_socket.cpp
event_trace_win.cpp
nonscoped_block.cpp
profile_manager.cpp
reader.cpp
thread_storage.cpp
)
set(H_FILES
chunk_allocator.h
current_time.h
current_thread.h
event_trace_win.h
nonscoped_block.h
profile_manager.h
thread_storage.h
spin_lock.h
stack_buffer.h
)
set(INCLUDE_FILES
include/easy/arbitrary_value.h
include/easy/easy_net.h
include/easy/easy_socket.h
include/easy/profiler.h
include/easy/reader.h
include/easy/serialized_block.h
include/easy/details/arbitrary_value_aux.h
include/easy/details/arbitrary_value_public_types.h
include/easy/details/easy_compiler_support.h
include/easy/details/profiler_aux.h
include/easy/details/profiler_colors.h
include/easy/details/profiler_public_types.h
)
source_group(include FILES ${INCLUDE_FILES})
set(SOURCES
${CPP_FILES}
${H_FILES}
${INCLUDE_FILES}
)
add_library(easy_profiler ${SOURCES} resources.rc)
# End adding source files.
#################################################
target_include_directories(easy_profiler PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
target_compile_definitions(easy_profiler PRIVATE
-D_BUILD_PROFILER=1
#-DEASY_PROFILER_API_DISABLED # uncomment this to disable profiler api only (you will have to rebuild only easy_profiler)
)
if (NOT BUILD_SHARED_LIBS)
target_compile_definitions(easy_profiler PUBLIC -DEASY_PROFILER_STATIC=1)
endif ()
target_compile_definitions(easy_profiler PUBLIC
-DEASY_PROFILER_VERSION_MAJOR=${EASY_PROGRAM_VERSION_MAJOR}
-DEASY_PROFILER_VERSION_MINOR=${EASY_PROGRAM_VERSION_MINOR}
-DEASY_PROFILER_VERSION_PATCH=${EASY_PROGRAM_VERSION_PATCH}
-DEASY_DEFAULT_PORT=${EASY_DEFAULT_PORT}
-DBUILD_WITH_EASY_PROFILER=1
)
#####################################################################
# Add EasyProfiler options definitions:
easy_define_target_option(easy_profiler BUILD_WITH_CHRONO_STEADY_CLOCK EASY_CHRONO_STEADY_CLOCK)
easy_define_target_option(easy_profiler BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK EASY_CHRONO_HIGHRES_CLOCK)
easy_define_target_option(easy_profiler EASY_OPTION_LISTEN EASY_OPTION_START_LISTEN_ON_STARTUP)
easy_define_target_option(easy_profiler EASY_OPTION_PROFILE_SELF EASY_OPTION_MEASURE_STORAGE_EXPAND)
easy_define_target_option(easy_profiler EASY_OPTION_PROFILE_SELF_BLOCKS_ON EASY_OPTION_STORAGE_EXPAND_BLOCKS_ON)
easy_define_target_option(easy_profiler EASY_OPTION_IMPLICIT_THREAD_REGISTRATION EASY_OPTION_IMPLICIT_THREAD_REGISTRATION)
if (WIN32)
easy_define_target_option(easy_profiler EASY_OPTION_EVENT_TRACING EASY_OPTION_EVENT_TRACING_ENABLED)
easy_define_target_option(easy_profiler EASY_OPTION_LOW_PRIORITY_EVENT_TRACING EASY_OPTION_LOW_PRIORITY_EVENT_TRACING)
else ()
easy_define_target_option(easy_profiler EASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS EASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS)
endif ()
easy_define_target_option(easy_profiler EASY_OPTION_LOG EASY_OPTION_LOG_ENABLED)
easy_define_target_option(easy_profiler EASY_OPTION_PRETTY_PRINT EASY_OPTION_PRETTY_PRINT_FUNCTIONS)
easy_define_target_option(easy_profiler EASY_OPTION_PREDEFINED_COLORS EASY_OPTION_BUILTIN_COLORS)
# End adding EasyProfiler options definitions.
#####################################################################
###############################################################################
# Add platform specific compile options:
if (UNIX)
target_compile_options(easy_profiler PRIVATE -Wall -Wno-long-long -Wno-reorder -Wno-braced-scalar-init -pedantic)
target_link_libraries(easy_profiler pthread)
elseif (WIN32)
target_compile_definitions(easy_profiler PRIVATE -D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
target_link_libraries(easy_profiler ws2_32 psapi)
endif ()
if (MINGW)
target_compile_definitions(easy_profiler PRIVATE -DSTRSAFE_NO_DEPRECATE)
endif ()
if (MSVC)
target_compile_options(easy_profiler PRIVATE /WX)
endif ()
if (APPLE)
target_compile_options(easy_profiler PUBLIC -std=gnu++11)
else ()
if (CMAKE_VERSION VERSION_LESS "3.1")
if (NOT MSVC)
target_compile_options(easy_profiler PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11>)
endif ()
else ()
if (NOT MSVC)
target_compile_options(easy_profiler PUBLIC -std=gnu++11)
endif ()
set_target_properties(easy_profiler PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
endif ()
endif ()
# End adding platform specific compile options.
###############################################################################
#########################################################################################
# Installation:
set(config_install_dir "lib/cmake/${PROJECT_NAME}")
set(include_install_dir "include")
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
# Configuration
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
set(targets_export_name "${PROJECT_NAME}Targets")
include(CMakePackageConfigHelpers)
include(InstallRequiredSystemLibraries)
write_basic_package_version_file(
"${version_config}"
VERSION
${EASY_PRODUCT_VERSION_STRING}
COMPATIBILITY
SameMajorVersion
)
configure_package_config_file(
"cmake/config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)
install(
FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}"
)
install(
FILES
${INCLUDE_FILES}
DESTINATION
include/easy
)
install(
FILES
LICENSE.MIT
LICENSE.APACHE
DESTINATION
.
)
install(
TARGETS
easy_profiler
EXPORT
${targets_export_name}
DESTINATION
bin
INCLUDES DESTINATION "${include_install_dir}"
)
install(
EXPORT "${targets_export_name}"
DESTINATION "${config_install_dir}"
)
target_compile_definitions(easy_profiler PUBLIC )

View File

@ -0,0 +1,177 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View File

@ -0,0 +1,18 @@
Copyright (c) 2017 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.

View File

@ -0,0 +1,241 @@
/************************************************************************
* file name : block.cpp
* ----------------- :
* creation time : 2016/02/16
* authors : Sergey Yagovtsev, Victor Zarubkin
* emails : yse.sey@gmail.com, v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains implementation of profiling blocks
* :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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 <easy/profiler.h>
#include "profile_manager.h"
#include "current_time.h"
using namespace profiler;
#ifndef EASY_PROFILER_API_DISABLED
Event::Event(timestamp_t _begin_time) EASY_NOEXCEPT : m_begin(_begin_time), m_end(0)
{
}
Event::Event(timestamp_t _begin_time, timestamp_t _end_time) EASY_NOEXCEPT : m_begin(_begin_time), m_end(_end_time)
{
}
BaseBlockData::BaseBlockData(timestamp_t _begin_time, block_id_t _descriptor_id) EASY_NOEXCEPT
: Event(_begin_time)
, m_id(_descriptor_id)
{
}
BaseBlockData::BaseBlockData(timestamp_t _begin_time, timestamp_t _end_time, block_id_t _descriptor_id) EASY_NOEXCEPT
: Event(_begin_time, _end_time)
, m_id(_descriptor_id)
{
}
Block::Block(Block&& that) EASY_NOEXCEPT
: BaseBlockData(that.m_begin, that.m_id)
, m_name(that.m_name)
, m_status(that.m_status)
, m_isScoped(that.m_isScoped)
{
m_end = that.m_end;
that.m_end = that.m_begin;
}
Block::Block(timestamp_t _begin_time, block_id_t _descriptor_id, const char* _runtimeName) EASY_NOEXCEPT
: BaseBlockData(_begin_time, _descriptor_id)
, m_name(_runtimeName)
, m_status(::profiler::ON)
, m_isScoped(true)
{
}
Block::Block(timestamp_t _begin_time, timestamp_t _end_time, block_id_t _descriptor_id, const char* _runtimeName) EASY_NOEXCEPT
: BaseBlockData(_begin_time, _end_time, _descriptor_id)
, m_name(_runtimeName)
, m_status(::profiler::ON)
, m_isScoped(true)
{
}
Block::Block(const BaseBlockDescriptor* _descriptor, const char* _runtimeName, bool _scoped) EASY_NOEXCEPT
: BaseBlockData(1ULL, _descriptor->id())
, m_name(_runtimeName)
, m_status(_descriptor->status())
, m_isScoped(_scoped)
{
}
void Block::start()
{
m_begin = getCurrentTime();
}
void Block::start(timestamp_t _time) EASY_NOEXCEPT
{
m_begin = _time;
}
void Block::finish()
{
m_end = getCurrentTime();
}
void Block::finish(timestamp_t _time) EASY_NOEXCEPT
{
m_end = _time;
}
Block::~Block()
{
if (!finished())
::profiler::endBlock();
}
#else
Event::Event(timestamp_t) EASY_NOEXCEPT : m_begin(0), m_end(0)
{
}
Event::Event(timestamp_t, timestamp_t) EASY_NOEXCEPT : m_begin(0), m_end(0)
{
}
BaseBlockData::BaseBlockData(timestamp_t, block_id_t) EASY_NOEXCEPT
: Event(0, 0)
, m_id(~0U)
{
}
BaseBlockData::BaseBlockData(timestamp_t, timestamp_t, block_id_t) EASY_NOEXCEPT
: Event(0, 0)
, m_id(~0U)
{
}
Block::Block(Block&& that) EASY_NOEXCEPT
: BaseBlockData(0, ~0U)
, m_name("")
, m_status(::profiler::OFF)
, m_isScoped(that.m_isScoped)
{
}
Block::Block(timestamp_t, block_id_t, const char*) EASY_NOEXCEPT
: BaseBlockData(0, ~0U)
, m_name("")
, m_status(::profiler::OFF)
, m_isScoped(true)
{
}
Block::Block(timestamp_t, timestamp_t, block_id_t, const char*) EASY_NOEXCEPT
: BaseBlockData(0, ~0U)
, m_name("")
, m_status(::profiler::OFF)
, m_isScoped(true)
{
}
Block::Block(const BaseBlockDescriptor*, const char*, bool _scoped) EASY_NOEXCEPT
: BaseBlockData(0, ~0U)
, m_name("")
, m_status(::profiler::OFF)
, m_isScoped(_scoped)
{
}
void Block::start()
{
}
void Block::start(timestamp_t) EASY_NOEXCEPT
{
}
void Block::finish()
{
}
void Block::finish(timestamp_t) EASY_NOEXCEPT
{
}
Block::~Block()
{
}
#endif
//////////////////////////////////////////////////////////////////////////
CSwitchEvent::CSwitchEvent(timestamp_t _begin_time, thread_id_t _tid) EASY_NOEXCEPT
: Event(_begin_time)
, m_thread_id(_tid)
{
}
CSwitchBlock::CSwitchBlock(timestamp_t _begin_time, thread_id_t _tid, const char* _runtimeName) EASY_NOEXCEPT
: CSwitchEvent(_begin_time, _tid)
, m_name(_runtimeName)
{
}
//////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,509 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_CHUNK_ALLOCATOR_H
#define EASY_PROFILER_CHUNK_ALLOCATOR_H
#include <easy/details/easy_compiler_support.h>
#include <cstring>
#include <cstddef>
#include <stdint.h>
#include "outstream.h"
//////////////////////////////////////////////////////////////////////////
#ifndef EASY_ENABLE_ALIGNMENT
# define EASY_ENABLE_ALIGNMENT 0
#endif
#ifndef EASY_ALIGNMENT_SIZE
# define EASY_ALIGNMENT_SIZE alignof(std::max_align_t)
#endif
#if EASY_ENABLE_ALIGNMENT == 0
# define EASY_ALIGNED(TYPE, VAR, A) TYPE VAR
# define EASY_MALLOC(MEMSIZE, A) malloc(MEMSIZE)
# define EASY_FREE(MEMPTR) free(MEMPTR)
#else
// MSVC and GNUC aligned versions of malloc are defined in malloc.h
# include <malloc.h>
# if defined(_MSC_VER)
# define EASY_ALIGNED(TYPE, VAR, A) __declspec(align(A)) TYPE VAR
# define EASY_MALLOC(MEMSIZE, A) _aligned_malloc(MEMSIZE, A)
# define EASY_FREE(MEMPTR) _aligned_free(MEMPTR)
# elif defined(__GNUC__)
# define EASY_ALIGNED(TYPE, VAR, A) TYPE VAR __attribute__((aligned(A)))
# define EASY_MALLOC(MEMSIZE, A) memalign(A, MEMSIZE)
# define EASY_FREE(MEMPTR) free(MEMPTR)
# else
# define EASY_ALIGNED(TYPE, VAR, A) TYPE VAR
# define EASY_MALLOC(MEMSIZE, A) malloc(MEMSIZE)
# define EASY_FREE(MEMPTR) free(MEMPTR)
# endif
#endif
//////////////////////////////////////////////////////////////////////////
//! Checks if a pointer is aligned.
//! \param ptr The pointer to check.
//! \param alignment The alignement (must be a power of 2)
//! \returns true if the memory is aligned.
//!
template <uint32_t ALIGNMENT>
EASY_FORCE_INLINE bool is_aligned(void* ptr)
{
static_assert(ALIGNMENT % 2 == 0, "Alignment must be a power of two.");
return ((uintptr_t)ptr & (ALIGNMENT-1)) == 0;
}
EASY_FORCE_INLINE void unaligned_zero16(void* ptr)
{
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(uint16_t*)ptr = 0;
#else
((char*)ptr)[0] = 0;
((char*)ptr)[1] = 0;
#endif
}
EASY_FORCE_INLINE void unaligned_zero32(void* ptr)
{
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(uint32_t*)ptr = 0;
#else
((char*)ptr)[0] = 0;
((char*)ptr)[1] = 0;
((char*)ptr)[2] = 0;
((char*)ptr)[3] = 0;
#endif
}
EASY_FORCE_INLINE void unaligned_zero64(void* ptr)
{
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(uint64_t*)ptr = 0;
#else
// Assume unaligned is more common.
if (!is_aligned<alignof(uint64_t)>(ptr)) {
((char*)ptr)[0] = 0;
((char*)ptr)[1] = 0;
((char*)ptr)[2] = 0;
((char*)ptr)[3] = 0;
((char*)ptr)[4] = 0;
((char*)ptr)[5] = 0;
((char*)ptr)[6] = 0;
((char*)ptr)[7] = 0;
}
else {
*(uint64_t*)ptr = 0;
}
#endif
}
template <typename T>
EASY_FORCE_INLINE void unaligned_store16(void* ptr, T val)
{
static_assert(sizeof(T) == 2, "16 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(T*)ptr = val;
#else
const char* const temp = (char*)&val;
((char*)ptr)[0] = temp[0];
((char*)ptr)[1] = temp[1];
#endif
}
template <typename T>
EASY_FORCE_INLINE void unaligned_store32(void* ptr, T val)
{
static_assert(sizeof(T) == 4, "32 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(T*)ptr = val;
#else
const char* const temp = (char*)&val;
((char*)ptr)[0] = temp[0];
((char*)ptr)[1] = temp[1];
((char*)ptr)[2] = temp[2];
((char*)ptr)[3] = temp[3];
#endif
}
template <typename T>
EASY_FORCE_INLINE void unaligned_store64(void* ptr, T val)
{
static_assert(sizeof(T) == 8, "64 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*(T*)ptr = val;
#else
const char* const temp = (char*)&val;
// Assume unaligned is more common.
if (!is_aligned<alignof(T)>(ptr)) {
((char*)ptr)[0] = temp[0];
((char*)ptr)[1] = temp[1];
((char*)ptr)[2] = temp[2];
((char*)ptr)[3] = temp[3];
((char*)ptr)[4] = temp[4];
((char*)ptr)[5] = temp[5];
((char*)ptr)[6] = temp[6];
((char*)ptr)[7] = temp[7];
}
else {
*(T*)ptr = val;
}
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load16(const void* ptr)
{
static_assert(sizeof(T) == 2, "16 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
return *(T*)ptr;
#else
T value;
((char*)&value)[0] = ((char*)ptr)[0];
((char*)&value)[1] = ((char*)ptr)[1];
return value;
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load16(const void* ptr, T* val)
{
static_assert(sizeof(T) == 2, "16 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*val = *(T*)ptr;
return *val;
#else
((char*)val)[0] = ((char*)ptr)[0];
((char*)val)[1] = ((char*)ptr)[1];
return *val;
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load32(const void* ptr)
{
static_assert(sizeof(T) == 4, "32 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
return *(T*)ptr;
#else
T value;
((char*)&value)[0] = ((char*)ptr)[0];
((char*)&value)[1] = ((char*)ptr)[1];
((char*)&value)[2] = ((char*)ptr)[2];
((char*)&value)[3] = ((char*)ptr)[3];
return value;
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load32(const void* ptr, T* val)
{
static_assert(sizeof(T) == 4, "32 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*val = *(T*)ptr;
#else
((char*)&val)[0] = ((char*)ptr)[0];
((char*)&val)[1] = ((char*)ptr)[1];
((char*)&val)[2] = ((char*)ptr)[2];
((char*)&val)[3] = ((char*)ptr)[3];
return *val;
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load64(const void* ptr)
{
static_assert(sizeof(T) == 8, "64 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
return *(T*)ptr;
#else
if (!is_aligned<alignof(T)>(ptr)) {
T value;
((char*)&value)[0] = ((char*)ptr)[0];
((char*)&value)[1] = ((char*)ptr)[1];
((char*)&value)[2] = ((char*)ptr)[2];
((char*)&value)[3] = ((char*)ptr)[3];
((char*)&value)[4] = ((char*)ptr)[4];
((char*)&value)[5] = ((char*)ptr)[5];
((char*)&value)[6] = ((char*)ptr)[6];
((char*)&value)[7] = ((char*)ptr)[7];
return value;
}
else {
return *(T*)ptr;
}
#endif
}
template <typename T>
EASY_FORCE_INLINE T unaligned_load64(const void* ptr, T* val)
{
static_assert(sizeof(T) == 8, "64 bit type required.");
#ifndef EASY_ENABLE_STRICT_ALIGNMENT
*val = *(T*)ptr;
#else
if (!is_aligned<alignof(T)>(ptr)) {
((char*)&val)[0] = ((char*)ptr)[0];
((char*)&val)[1] = ((char*)ptr)[1];
((char*)&val)[2] = ((char*)ptr)[2];
((char*)&val)[3] = ((char*)ptr)[3];
((char*)&val)[4] = ((char*)ptr)[4];
((char*)&val)[5] = ((char*)ptr)[5];
((char*)&val)[6] = ((char*)ptr)[6];
((char*)&val)[7] = ((char*)ptr)[7];
return *val;
}
else {
*val = *(T*)ptr;
return *val;
}
#endif
}
//////////////////////////////////////////////////////////////////////////
template <uint16_t N>
class chunk_allocator
{
struct chunk { EASY_ALIGNED(char, data[N], EASY_ALIGNMENT_SIZE); chunk* prev = nullptr; };
struct chunk_list
{
chunk* last;
chunk_list() : last(nullptr)
{
static_assert(sizeof(char) == 1, "easy_profiler logic error: sizeof(char) != 1 for this platform! Please, contact easy_profiler authors to resolve your problem.");
emplace_back();
}
~chunk_list()
{
do free_last(); while (last != nullptr);
}
void clear_all_except_last()
{
while (last->prev != nullptr)
free_last();
zero_last_chunk_size();
}
void emplace_back()
{
auto prev = last;
last = ::new (EASY_MALLOC(sizeof(chunk), EASY_ALIGNMENT_SIZE)) chunk();
last->prev = prev;
zero_last_chunk_size();
}
/** Invert current chunks list to enable to iterate over chunks list in direct order.
This method is used by serialize().
*/
void invert()
{
chunk* next = nullptr;
while (last->prev != nullptr) {
auto p = last->prev;
last->prev = next;
next = last;
last = p;
}
last->prev = next;
}
private:
chunk_list(const chunk_list&) = delete;
chunk_list(chunk_list&&) = delete;
void free_last()
{
auto p = last;
last = last->prev;
EASY_FREE(p);
}
void zero_last_chunk_size()
{
// Although there is no need for unaligned access stuff b/c a new chunk will
// usually be at least 8 byte aligned (and we only need 2 byte alignment),
// this is the only way I have been able to get rid of the GCC strict-aliasing warning
// without using std::memset. It's an extra line, but is just as fast as *(uint16_t*)last->data = 0;
char* const data = last->data;
*(uint16_t*)data = (uint16_t)0;
}
};
// Used in serialize(): workaround for no constexpr support in MSVC 2013.
static const int_fast32_t MAX_CHUNK_OFFSET = N - sizeof(uint16_t);
static const uint16_t N_MINUS_ONE = N - 1;
chunk_list m_chunks; ///< List of chunks.
uint32_t m_size; ///< Number of elements stored(# of times allocate() has been called.)
uint16_t m_chunkOffset; ///< Number of bytes used in the current chunk.
public:
chunk_allocator() : m_size(0), m_chunkOffset(0)
{
}
/** Allocate n bytes.
Automatically checks if there is enough preserved memory to store additional n bytes
and allocates additional buffer if needed.
*/
void* allocate(uint16_t n)
{
++m_size;
if (!need_expand(n))
{
// Temp to avoid extra load due to this* aliasing.
uint16_t chunkOffset = m_chunkOffset;
char* data = m_chunks.last->data + chunkOffset;
chunkOffset += n + sizeof(uint16_t);
m_chunkOffset = chunkOffset;
unaligned_store16(data, n);
data += sizeof(uint16_t);
// If there is enough space for at least another payload size,
// set it to zero.
if (chunkOffset < N_MINUS_ONE)
unaligned_zero16(data + n);
return data;
}
m_chunkOffset = n + sizeof(uint16_t);
m_chunks.emplace_back();
char* data = m_chunks.last->data;
unaligned_store16(data, n);
data += sizeof(uint16_t);
// We assume here that it takes more than one element to fill a chunk.
unaligned_zero16(data + n);
return data;
}
/** Check if current storage is not enough to store additional n bytes.
*/
bool need_expand(uint16_t n) const
{
return (m_chunkOffset + n + sizeof(uint16_t)) > N;
}
uint32_t size() const
{
return m_size;
}
bool empty() const
{
return m_size == 0;
}
void clear()
{
m_size = 0;
m_chunkOffset = 0;
m_chunks.clear_all_except_last(); // There is always at least one chunk
}
/** Serialize data to stream.
\warning Data will be cleared after serialization.
*/
void serialize(profiler::OStream& _outputStream)
{
// Chunks are stored in reversed order (stack).
// To be able to iterate them in direct order we have to invert the chunks list.
m_chunks.invert();
// Each chunk is an array of N bytes that can hold between
// 1(if the list isn't empty) and however many elements can fit in a chunk,
// where an element consists of a payload size + a payload as follows:
// elementStart[0..1]: size as a uint16_t
// elementStart[2..size-1]: payload.
// The maximum chunk offset is N-sizeof(uint16_t) b/c, if we hit that (or go past),
// there is either no space left, 1 byte left, or 2 bytes left, all of which are
// too small to cary more than a zero-sized element.
chunk* current = m_chunks.last;
do {
const char* data = current->data;
int_fast32_t chunkOffset = 0; // signed int so overflow is not checked.
uint16_t payloadSize = unaligned_load16<uint16_t>(data);
while (chunkOffset < MAX_CHUNK_OFFSET && payloadSize != 0) {
const uint16_t chunkSize = sizeof(uint16_t) + payloadSize;
_outputStream.write(data, chunkSize);
data += chunkSize;
chunkOffset += chunkSize;
unaligned_load16(data, &payloadSize);
}
current = current->prev;
} while (current != nullptr);
clear();
}
private:
chunk_allocator(const chunk_allocator&) = delete;
chunk_allocator(chunk_allocator&&) = delete;
}; // END of class chunk_allocator.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_CHUNK_ALLOCATOR_H

View File

@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -0,0 +1,104 @@
# Install script for directory: /home/alex/Work/C++Projects/easyprofiler/easy_profiler_core
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler" TYPE FILE FILES
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/generated/easy_profilerConfig.cmake"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/generated/easy_profilerConfigVersion.cmake"
)
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/easy" TYPE FILE FILES
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/arbitrary_value.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/easy_net.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/easy_socket.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/profiler.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/reader.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/serialized_block.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/arbitrary_value_aux.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/easy_compiler_support.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/profiler_aux.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/profiler_colors.h"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include/easy/details/profiler_public_types.h"
)
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/." TYPE FILE FILES
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/LICENSE.MIT"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/LICENSE.APACHE"
)
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so"
RPATH "$ORIGIN")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE SHARED_LIBRARY FILES "/home/alex/Work/C++Projects/easyprofiler/bin/libeasy_profiler.so")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so"
OLD_RPATH ":::::::"
NEW_RPATH "$ORIGIN")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/libeasy_profiler.so")
endif()
endif()
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler/easy_profilerTargets.cmake")
file(DIFFERENT EXPORT_FILE_CHANGED FILES
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler/easy_profilerTargets.cmake"
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/Export/lib/cmake/easy_profiler/easy_profilerTargets.cmake")
if(EXPORT_FILE_CHANGED)
file(GLOB OLD_CONFIG_FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler/easy_profilerTargets-*.cmake")
if(OLD_CONFIG_FILES)
message(STATUS "Old export file \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler/easy_profilerTargets.cmake\" will be replaced. Removing files [${OLD_CONFIG_FILES}].")
file(REMOVE ${OLD_CONFIG_FILES})
endif()
endif()
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler" TYPE FILE FILES "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/Export/lib/cmake/easy_profiler/easy_profilerTargets.cmake")
if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/easy_profiler" TYPE FILE FILES "/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/Export/lib/cmake/easy_profiler/easy_profilerTargets-release.cmake")
endif()
endif()

View File

@ -0,0 +1,79 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_CURRENT_THREAD_H
#define EASY_PROFILER_CURRENT_THREAD_H
#include <easy/details/profiler_public_types.h>
#ifdef _WIN32
# include <Windows.h>
#elif defined(__APPLE__)
# include <pthread.h>
# include <Availability.h>
#else
# include <sys/types.h>
# include <unistd.h>
# include <sys/syscall.h>
#endif
inline profiler::thread_id_t getCurrentThreadId()
{
#ifdef _WIN32
return (profiler::thread_id_t)::GetCurrentThreadId();
#elif defined(__APPLE__)
# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6) || \
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
EASY_THREAD_LOCAL static uint64_t _id = 0;
if (!_id)
pthread_threadid_np(NULL, &_id);
return (profiler::thread_id_t)_id;
# else
return (profiler::thread_id_t)pthread_self();
# endif
#else
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid);
return _id;
#endif
}
#endif // EASY_PROFILER_CURRENT_THREAD_H

View File

@ -0,0 +1,174 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_CURRENT_TIME_H
#define EASY_PROFILER_CURRENT_TIME_H
#include <easy/details/profiler_public_types.h>
#if defined(_MSC_VER) && _MSC_VER <= 1800
// std::chrono for MSVC2013 is broken - it has very low resolution of 16ms
// restrict usage of std::chrono
# if EASY_CHRONO_HIGHRES_CLOCK
# undef EASY_CHRONO_HIGHRES_CLOCK
# endif
# if EASY_CHRONO_STEADY_CLOCK
# undef EASY_CHRONO_STEADY_CLOCK
# endif
#endif
#if EASY_CHRONO_HIGHRES_CLOCK
# include <chrono>
# define EASY_CHRONO_CLOCK std::chrono::high_resolution_clock
#elif EASY_CHRONO_STEADY_CLOCK
# include <chrono>
# define EASY_CHRONO_CLOCK std::chrono::steady_clock
#elif defined(_WIN32)
# include <Windows.h>
#else
# include <chrono>
# include <time.h>
# ifdef __ARM_ARCH
# include <sys/time.h>
# endif//__ARM_ARCH
#endif
static inline profiler::timestamp_t getCurrentTime()
{
#if EASY_CHRONO_HIGHRES_CLOCK || EASY_CHRONO_STEADY_CLOCK
return (profiler::timestamp_t)EASY_CHRONO_CLOCK::now().time_since_epoch().count();
#elif defined(_WIN32)
//see https://msdn.microsoft.com/library/windows/desktop/dn553408(v=vs.85).aspx
LARGE_INTEGER elapsedMicroseconds;
if (!QueryPerformanceCounter(&elapsedMicroseconds))
return 0;
return (profiler::timestamp_t)elapsedMicroseconds.QuadPart;
#else// not _WIN32
#if (defined(__GNUC__) || defined(__ICC))
// part of code from google/benchmark library (Licensed under the Apache License, Version 2.0)
// see https://github.com/google/benchmark/blob/master/src/cycleclock.h#L111
#if defined(__i386__)
int64_t ret;
__asm__ volatile("rdtsc" : "=A"(ret));
return ret;
#elif defined(__x86_64__) || defined(__amd64__)
uint64_t low, high;
__asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
return (high << 32) | low;
#elif defined(__powerpc__) || defined(__ppc__)
// This returns a time-base, which is not always precisely a cycle-count.
int64_t tbl, tbu0, tbu1;
asm("mftbu %0" : "=r"(tbu0));
asm("mftb %0" : "=r"(tbl));
asm("mftbu %0" : "=r"(tbu1));
tbl &= -static_cast<int64>(tbu0 == tbu1);
// high 32 bits in tbu1; low 32 bits in tbl (tbu0 is garbage)
return (tbu1 << 32) | tbl;
#elif defined(__sparc__)
int64_t tick;
asm(".byte 0x83, 0x41, 0x00, 0x00");
asm("mov %%g1, %0" : "=r"(tick));
return tick;
#elif defined(__ia64__)
int64_t itc;
asm("mov %0 = ar.itc" : "=r"(itc));
return itc;
#elif defined(COMPILER_MSVC) && defined(_M_IX86)
// Older MSVC compilers (like 7.x) don't seem to support the
// __rdtsc intrinsic properly, so I prefer to use _asm instead
// when I know it will work. Otherwise, I'll use __rdtsc and hope
// the code is being compiled with a non-ancient compiler.
_asm rdtsc
#elif defined(COMPILER_MSVC)
return __rdtsc();
#elif defined(__aarch64__)
// System timer of ARMv8 runs at a different frequency than the CPU's.
// The frequency is fixed, typically in the range 1-50MHz. It can be
// read at CNTFRQ special register. We assume the OS has set up
// the virtual timer properly.
int64_t virtual_timer_value;
asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
return virtual_timer_value;
#elif defined(__ARM_ARCH)
#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount
uint32_t pmccntr;
uint32_t pmuseren;
uint32_t pmcntenset;
// Read the user mode perf monitor counter access permissions.
asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
if (pmuseren & 1) { // Allows reading perfmon counters for user mode code.
asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
if (pmcntenset & 0x80000000ul) { // Is it counting?
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
// The counter is set up to count every 64th cycle
return static_cast<int64_t>(pmccntr) * 64; // Should optimize to << 6
}
}
#endif
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#elif defined(__mips__)
// mips apparently only allows rdtsc for superusers, so we fall
// back to gettimeofday. It's possible clock_gettime would be better.
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#else
#warning You need to define fast getCurrentTime() for your OS and CPU
return std::chrono::high_resolution_clock::now().time_since_epoch().count();
#define EASY_CHRONO_CLOCK std::chrono::high_resolution_clock
#endif
#else // not _WIN32, __GNUC__, __ICC
#warning You need to define fast getCurrentTime() for your OS and CPU
return std::chrono::high_resolution_clock::now().time_since_epoch().count();
#define EASY_CHRONO_CLOCK std::chrono::high_resolution_clock
#endif
#endif
}
#endif // EASY_PROFILER_CURRENT_TIME_H

View File

@ -0,0 +1,431 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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 <easy/easy_socket.h>
#include <string.h>
#include <thread>
#include <limits>
#if defined(_WIN32)
# pragma comment (lib, "Ws2_32.lib")
# pragma comment (lib, "Mswsock.lib")
# pragma comment (lib, "AdvApi32.lib")
# ifdef max
# undef max
# endif
#else
# include <errno.h>
# include <sys/ioctl.h>
#endif
/////////////////////////////////////////////////////////////////
#if defined(_WIN32)
const int SOCK_ABORTED = WSAECONNABORTED;
const int SOCK_RESET = WSAECONNRESET;
const int SOCK_IN_PROGRESS = WSAEINPROGRESS;
#else
const int SOCK_ABORTED = ECONNABORTED;
const int SOCK_RESET = ECONNRESET;
const int SOCK_IN_PROGRESS = EINPROGRESS;
const int SOCK_BROKEN_PIPE = EPIPE;
const int SOCK_ENOENT = ENOENT;
#endif
const int SEND_BUFFER_SIZE = 64 * 1024 * 1024;
/////////////////////////////////////////////////////////////////
static int closeSocket(EasySocket::socket_t s)
{
#if defined(_WIN32)
return ::closesocket(s);
#else
return ::close(s);
#endif
}
/////////////////////////////////////////////////////////////////
bool EasySocket::checkSocket(socket_t s) const
{
return s > 0;
}
void EasySocket::setBlocking(EasySocket::socket_t s, bool blocking)
{
#if defined(_WIN32)
u_long iMode = blocking ? 0 : 1;//0 - blocking, 1 - non blocking
::ioctlsocket(s, FIONBIO, &iMode);
#else
int iMode = blocking ? 0 : 1;//0 - blocking, 1 - non blocking
::ioctl(s, FIONBIO, (char*)&iMode);
#endif
}
int EasySocket::bind(uint16_t port)
{
if (!checkSocket(m_socket))
return -1;
struct sockaddr_in serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(port);
auto res = ::bind(m_socket, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
return res;
}
void EasySocket::flush()
{
if (m_socket)
closeSocket(m_socket);
if (m_replySocket != m_socket)
closeSocket(m_replySocket);
#if defined(_WIN32)
m_socket = 0;
m_replySocket = 0;
#else
m_wsaret = 0;
#endif
}
void EasySocket::checkResult(int result)
{
if (result >= 0)
{
m_state = ConnectionState::Connected;
return;
}
if (result == -1) // is this check necessary?
{
#if defined(_WIN32)
const int error_code = WSAGetLastError();
#else
const int error_code = errno;
#endif
switch (error_code)
{
case SOCK_ABORTED:
case SOCK_RESET:
#if !defined(_WIN32)
case SOCK_BROKEN_PIPE:
case SOCK_ENOENT:
#endif
m_state = ConnectionState::Disconnected;
break;
case SOCK_IN_PROGRESS:
m_state = ConnectionState::Connecting;
break;
default:
break;
}
}
}
void EasySocket::init()
{
if (m_wsaret != 0)
return;
#if !defined(_WIN32)
const int protocol = 0;
#else
const int protocol = IPPROTO_TCP;
#endif
m_socket = ::socket(AF_INET, SOCK_STREAM, protocol);
if (!checkSocket(m_socket))
return;
setBlocking(m_socket, true);
#if !defined(_WIN32)
m_wsaret = 1;
#endif
const int opt = 1;
::setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, sizeof(int));
}
EasySocket::ConnectionState EasySocket::state() const
{
return m_state;
}
bool EasySocket::isDisconnected() const
{
return static_cast<int>(m_state) <= 0;
}
bool EasySocket::isConnected() const
{
return m_state == ConnectionState::Connected;
}
EasySocket::EasySocket()
{
#if defined(_WIN32)
WSADATA wsaData;
m_wsaret = WSAStartup(0x101, &wsaData);
#else
m_wsaret = 0;
#endif
init();
}
EasySocket::~EasySocket()
{
flush();
#if defined(_WIN32)
if (m_wsaret == 0)
WSACleanup();
#endif
}
void EasySocket::setReceiveTimeout(int milliseconds)
{
if (!isConnected() || !checkSocket(m_replySocket))
return;
if (milliseconds <= 0)
milliseconds = std::numeric_limits<int>::max() / 1000;
#if defined(_WIN32)
const DWORD timeout = static_cast<DWORD>(milliseconds);
::setsockopt(m_replySocket, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout, sizeof(DWORD));
#else
struct timeval tv;
if (milliseconds >= 1000)
{
const int s = milliseconds / 1000;
const int us = (milliseconds - s * 1000) * 1000;
tv.tv_sec = s;
tv.tv_usec = us;
}
else
{
tv.tv_sec = 0;
tv.tv_usec = milliseconds * 1000;
}
::setsockopt(m_replySocket, SOL_SOCKET, SO_RCVTIMEO, (const char*)&tv, sizeof (struct timeval));
#endif
}
int EasySocket::send(const void* buffer, size_t nbytes)
{
if (!checkSocket(m_replySocket))
return -1;
#if defined(_WIN32) || defined(__APPLE__)
const int res = ::send(m_replySocket, (const char*)buffer, (int)nbytes, 0);
#else
const int res = (int)::send(m_replySocket, buffer, nbytes, MSG_NOSIGNAL);
#endif
checkResult(res);
return res;
}
int EasySocket::receive(void* buffer, size_t nbytes)
{
if (!checkSocket(m_replySocket))
return -1;
#if defined(_WIN32)
const int res = ::recv(m_replySocket, (char*)buffer, (int)nbytes, 0);
#else
const int res = (int)::read(m_replySocket, buffer, nbytes);
#endif
checkResult(res);
if (res == 0)
m_state = ConnectionState::Disconnected;
return res;
}
int EasySocket::listen(int count)
{
if (!checkSocket(m_socket))
return -1;
const int res = ::listen(m_socket, count);
checkResult(res);
return res;
}
int EasySocket::accept()
{
if (!checkSocket(m_socket))
return -1;
fd_set fdread;
FD_ZERO (&fdread);
FD_SET (m_socket, &fdread);
fd_set fdwrite = fdread;
fd_set fdexcl = fdread;
struct timeval tv { 0, 500 };
const int rc = ::select((int)m_socket + 1, &fdread, &fdwrite, &fdexcl, &tv);
if (rc <= 0)
return -1; // there is no connection for accept
m_replySocket = ::accept(m_socket, nullptr, nullptr);
checkResult((int)m_replySocket);
if (checkSocket(m_replySocket))
{
::setsockopt(m_replySocket, SOL_SOCKET, SO_SNDBUF, (char*)&SEND_BUFFER_SIZE, sizeof(int));
//const int flag = 1;
//const int result = setsockopt(m_replySocket,IPPROTO_TCP,TCP_NODELAY,(char *)&flag,sizeof(int));
#if defined(__APPLE__)
// Apple doesn't have MSG_NOSIGNAL, work around it
const int value = 1;
::setsockopt(m_replySocket, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value));
#endif
//setBlocking(m_replySocket,true);
}
return (int)m_replySocket;
}
bool EasySocket::setAddress(const char* address, uint16_t port)
{
m_server = ::gethostbyname(address);
if (m_server == nullptr)
return false;
memset((char*)&m_serverAddress, 0, sizeof(m_serverAddress));
m_serverAddress.sin_family = AF_INET;
memcpy((char*)&m_serverAddress.sin_addr.s_addr, (char*)m_server->h_addr, (size_t)m_server->h_length);
m_serverAddress.sin_port = htons(port);
return true;
}
int EasySocket::connect()
{
if (m_server == nullptr || m_socket <= 0)
return -1;
int res = 0;
//TODO: more intelligence
#if !defined(_WIN32)
setBlocking(m_socket, false);
const int sleepMs = 20;
const int waitSec = 1;
const int waitMs = waitSec * 1000 / sleepMs;
for (int counter = 0; counter++ < waitMs;)
{
res = ::connect(m_socket, (struct sockaddr*)&m_serverAddress, sizeof(m_serverAddress));
#if defined(__APPLE__)
// on Apple, treat EISCONN error as success
if (res == -1 && errno == EISCONN)
{
res = 0;
break;
}
#endif
checkResult(res);
if (res == 0)
{
break;
}
if (m_state == ConnectionState::Connecting)
{
std::this_thread::sleep_for(std::chrono::milliseconds(sleepMs));
continue;
}
if (isDisconnected())
{
break;
}
}
setBlocking(m_socket, true);
#else
res = ::connect(m_socket, (struct sockaddr*)&m_serverAddress, sizeof(m_serverAddress));
checkResult(res);
#endif
if (res == 0)
{
struct timeval tv;
tv.tv_sec = 1;
tv.tv_usec = 0;
::setsockopt(m_socket, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(struct timeval));
#if defined(__APPLE__)
// Apple doesn't have MSG_NOSIGNAL, work around it
const int value = 1;
setsockopt(m_socket, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value));
#endif
m_replySocket = m_socket;
}
return res;
}

View File

@ -0,0 +1,27 @@
#ifndef EASY_PROFILER__EVENT_TRACE_STATUS__H_
#define EASY_PROFILER__EVENT_TRACE_STATUS__H_
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
namespace profiler {
enum EventTracingEnableStatus : unsigned char
{
EVENT_TRACING_LAUNCHED_SUCCESSFULLY = 0,
EVENT_TRACING_NOT_ENOUGH_ACCESS_RIGHTS,
EVENT_TRACING_WAS_LAUNCHED_BY_SOMEBODY_ELSE,
EVENT_TRACING_BAD_PROPERTIES_SIZE,
EVENT_TRACING_OPEN_TRACE_ERROR,
EVENT_TRACING_MISTERIOUS_ERROR,
};
} // END of namespace profiler.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER__EVENT_TRACE_STATUS__H_

View File

@ -0,0 +1,550 @@
/************************************************************************
* file name : event_trace_win.cpp
* ----------------- :
* creation time : 2016/09/04
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains implementation of EasyEventTracer class used for tracing
* : Windows system events to get context switches.
* ----------------- :
* change log : * 2016/09/04 Victor Zarubkin: initial commit.
* :
* : * 2016/09/13 Victor Zarubkin: get process id and process name
* : of the owner of thread with id == CSwitch::NewThreadId.
* :
* : * 2016/09/17 Victor Zarubkin: added log messages printing.
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifdef _WIN32
#include <memory.h>
#include <chrono>
#include <unordered_map>
#include <easy/profiler.h>
#include "profile_manager.h"
#include "current_time.h"
#include "event_trace_win.h"
#include <Psapi.h>
#ifdef __MINGW32__
#include <processthreadsapi.h>
#endif
//#include <Shellapi.h>
#if EASY_OPTION_LOG_ENABLED != 0
# include <iostream>
# ifndef EASY_ERRORLOG
# define EASY_ERRORLOG ::std::cerr
# endif
# ifndef EASY_LOG
# define EASY_LOG ::std::cerr
# endif
# ifndef EASY_ERROR
# define EASY_ERROR(LOG_MSG) EASY_ERRORLOG << "EasyProfiler ERROR: " << LOG_MSG
# endif
# ifndef EASY_WARNING
# define EASY_WARNING(LOG_MSG) EASY_ERRORLOG << "EasyProfiler WARNING: " << LOG_MSG
# endif
# ifndef EASY_LOGMSG
# define EASY_LOGMSG(LOG_MSG) EASY_LOG << "EasyProfiler INFO: " << LOG_MSG
# endif
# ifndef EASY_LOG_ONLY
# define EASY_LOG_ONLY(CODE) CODE
# endif
#else
# ifndef EASY_ERROR
# define EASY_ERROR(LOG_MSG)
# endif
# ifndef EASY_WARNING
# define EASY_WARNING(LOG_MSG)
# endif
# ifndef EASY_LOGMSG
# define EASY_LOGMSG(LOG_MSG)
# endif
# ifndef EASY_LOG_ONLY
# define EASY_LOG_ONLY(CODE)
# endif
#endif
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//extern ProfileManager& MANAGER;
#define MANAGER ProfileManager::instance()
extern const ::profiler::color_t EASY_COLOR_INTERNAL_EVENT;
#ifdef __MINGW32__
::std::atomic<uint64_t> TRACING_END_TIME = ATOMIC_VAR_INIT(~0ULL);
char KERNEL_LOGGER[] = KERNEL_LOGGER_NAME;
#else
::std::atomic_uint64_t TRACING_END_TIME = ATOMIC_VAR_INIT(~0ULL);
#endif
namespace profiler {
const decltype(EVENT_DESCRIPTOR::Opcode) SWITCH_CONTEXT_OPCODE = 36;
const int RAW_TIMESTAMP_TIME_TYPE = 1;
//////////////////////////////////////////////////////////////////////////
struct ProcessInfo {
std::string name;
processid_t id = 0;
int8_t valid = 0;
};
//////////////////////////////////////////////////////////////////////////
// CSwitch class
// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa964744(v=vs.85).aspx
// EventType = 36
struct CSwitch
{
uint32_t NewThreadId;
uint32_t OldThreadId;
int8_t NewThreadPriority;
int8_t OldThreadPriority;
uint8_t PreviousCState;
int8_t SpareByte;
int8_t OldThreadWaitReason;
int8_t OldThreadWaitMode;
int8_t OldThreadState;
int8_t OldThreadWaitIdealProcessor;
uint32_t NewThreadWaitTime;
uint32_t Reserved;
};
//////////////////////////////////////////////////////////////////////////
struct do_not_calc_hash {
template <class T> inline size_t operator()(T _value) const {
return static_cast<size_t>(_value);
}
};
typedef ::std::unordered_map<decltype(CSwitch::NewThreadId), ProcessInfo*, do_not_calc_hash> thread_process_info_map;
typedef ::std::unordered_map<processid_t, ProcessInfo, do_not_calc_hash> process_info_map;
// Using static is safe because processTraceEvent() is called from one thread
process_info_map PROCESS_INFO_TABLE;
thread_process_info_map THREAD_PROCESS_INFO_TABLE = ([](){ thread_process_info_map initial; initial[0U] = nullptr; return ::std::move(initial); })();
//////////////////////////////////////////////////////////////////////////
void WINAPI processTraceEvent(PEVENT_RECORD _traceEvent)
{
if (_traceEvent->EventHeader.EventDescriptor.Opcode != SWITCH_CONTEXT_OPCODE)
return;
if (sizeof(CSwitch) != _traceEvent->UserDataLength)
return;
EASY_FUNCTION(EASY_COLOR_INTERNAL_EVENT, ::profiler::OFF);
auto _contextSwitchEvent = reinterpret_cast<CSwitch*>(_traceEvent->UserData);
const auto time = static_cast<::profiler::timestamp_t>(_traceEvent->EventHeader.TimeStamp.QuadPart);
if (time > TRACING_END_TIME.load(::std::memory_order_acquire))
return;
DWORD pid = 0;
const char* process_name = "";
// Trying to get target process name and id
auto it = THREAD_PROCESS_INFO_TABLE.find(_contextSwitchEvent->NewThreadId);
if (it == THREAD_PROCESS_INFO_TABLE.end())
{
auto hThread = OpenThread(THREAD_QUERY_LIMITED_INFORMATION, FALSE, _contextSwitchEvent->NewThreadId);
if (hThread != nullptr)
{
pid = GetProcessIdOfThread(hThread);
auto pinfo = &PROCESS_INFO_TABLE[pid];
if (pinfo->valid == 0)
{
if (pinfo->name.empty())
{
static char numbuf[128] = {};
sprintf(numbuf, "%u", pid);
pinfo->name = numbuf;
pinfo->id = pid;
}
/*
According to documentation, using GetModuleBaseName() requires
PROCESS_QUERY_INFORMATION | PROCESS_VM_READ access rights.
But it works fine with PROCESS_QUERY_LIMITED_INFORMATION instead of PROCESS_QUERY_INFORMATION.
See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683196(v=vs.85).aspx
*/
//auto hProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
//if (hProc == nullptr)
auto hProc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ, FALSE, pid);
if (hProc != nullptr)
{
static TCHAR buf[MAX_PATH] = {}; // Using static is safe because processTraceEvent() is called from one thread
auto len = GetModuleBaseName(hProc, 0, buf, MAX_PATH);
if (len != 0)
{
pinfo->name.reserve(pinfo->name.size() + 2 + len);
pinfo->name.append(" ", 1);
pinfo->name.append(buf, len);
pinfo->valid = 1;
}
CloseHandle(hProc);
}
else
{
//auto err = GetLastError();
//printf("OpenProcess(%u) fail: GetLastError() == %u\n", pid, err);
pinfo->valid = -1;
if (pid == 4) {
pinfo->name.reserve(pinfo->name.size() + 8);
pinfo->name.append(" System", 7);
}
}
}
process_name = pinfo->name.c_str();
THREAD_PROCESS_INFO_TABLE[_contextSwitchEvent->NewThreadId] = pinfo;
CloseHandle(hThread);
}
else
{
//printf("Can not OpenThread(%u);\n", _contextSwitchEvent->NewThreadId);
THREAD_PROCESS_INFO_TABLE[_contextSwitchEvent->NewThreadId] = nullptr;
}
}
else
{
auto pinfo = it->second;
if (pinfo != nullptr)
process_name = pinfo->name.c_str();
else if (it->first == 0)
process_name = "System Idle";
else if (it->first == 4)
process_name = "System";
}
MANAGER.beginContextSwitch(_contextSwitchEvent->OldThreadId, time, _contextSwitchEvent->NewThreadId, process_name);
MANAGER.endContextSwitch(_contextSwitchEvent->NewThreadId, pid, time);
}
//////////////////////////////////////////////////////////////////////////
#ifndef EASY_MAGIC_STATIC_AVAILABLE
class EasyEventTracerInstance {
friend EasyEventTracer;
EasyEventTracer instance;
} EASY_EVENT_TRACER;
#endif
EasyEventTracer& EasyEventTracer::instance()
{
#ifndef EASY_MAGIC_STATIC_AVAILABLE
return EASY_EVENT_TRACER.instance;
#else
static EasyEventTracer tracer;
return tracer;
#endif
}
EasyEventTracer::EasyEventTracer()
{
m_lowPriority = ATOMIC_VAR_INIT(EASY_OPTION_LOW_PRIORITY_EVENT_TRACING);
}
EasyEventTracer::~EasyEventTracer()
{
disable();
}
bool EasyEventTracer::isLowPriority() const
{
return m_lowPriority.load(::std::memory_order_acquire);
}
void EasyEventTracer::setLowPriority(bool _value)
{
m_lowPriority.store(_value, ::std::memory_order_release);
}
bool setPrivilege(HANDLE hToken, LPCSTR _privelegeName)
{
bool success = false;
if (hToken)
{
LUID privilegyId;
if (LookupPrivilegeValue(NULL, _privelegeName, &privilegyId))
{
TOKEN_PRIVILEGES tokenPrivilege;
tokenPrivilege.PrivilegeCount = 1;
tokenPrivilege.Privileges[0].Luid = privilegyId;
tokenPrivilege.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
success = AdjustTokenPrivileges(hToken, FALSE, &tokenPrivilege, sizeof(TOKEN_PRIVILEGES), NULL, NULL) != FALSE;
}
}
EASY_LOG_ONLY(
if (!success)
EASY_WARNING("Failed to set " << _privelegeName << " privelege for the application.\n");
)
return success;
}
void EasyEventTracer::setProcessPrivileges()
{
static bool alreadySet = false;
if (alreadySet)
return;
alreadySet = true;
HANDLE hToken = nullptr;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
{
#if EASY_OPTION_LOG_ENABLED != 0
const bool success = setPrivilege(hToken, SE_DEBUG_NAME);
if (!success)
EASY_WARNING("Some context switch events could not get process name.\n");
#else
setPrivilege(hToken, SE_DEBUG_NAME);
#endif
CloseHandle(hToken);
}
EASY_LOG_ONLY(
else {
EASY_WARNING("Failed to open process to adjust priveleges.\n");
}
)
}
::profiler::EventTracingEnableStatus EasyEventTracer::startTrace(bool _force, int _step)
{
auto startTraceResult = StartTrace(&m_sessionHandle, KERNEL_LOGGER_NAME, props());
switch (startTraceResult)
{
case ERROR_SUCCESS:
return EVENT_TRACING_LAUNCHED_SUCCESSFULLY;
case ERROR_ALREADY_EXISTS:
{
if (_force)
{
// Try to stop another event tracing session to force launch self session.
if (_step == 0)
{
/*
According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa363696(v=vs.85).aspx
SessionHandle is ignored (and could be NULL) if SessionName is not NULL,
and you only need to set the Wnode.BufferSize, Wnode.Guid, LoggerNameOffset, and LogFileNameOffset
in EVENT_TRACE_PROPERTIES structure if ControlCode is EVENT_TRACE_CONTROL_STOP.
All data is already set for m_properties to the moment. Simply copy m_properties and use the copy.
This method supposed to be faster than launching console window and executing shell command,
but if that would not work, return to using shell command "logman stop".
*/
// static is safe because we are guarded by spin-lock m_spin
static Properties p = ([]{ Properties prp; strncpy(prp.sessionName, KERNEL_LOGGER_NAME, sizeof(prp.sessionName)); return prp; })();
p.base = m_properties.base; // Use copy of m_properties to make sure m_properties will not be changed
// Stop another session
ControlTrace((TRACEHANDLE)NULL, KERNEL_LOGGER_NAME, reinterpret_cast<EVENT_TRACE_PROPERTIES*>(&p), EVENT_TRACE_CONTROL_STOP);
// Console window variant:
//if (32 >= (int)ShellExecute(NULL, NULL, "logman", "stop \"" KERNEL_LOGGER_NAME "\" -ets", NULL, SW_HIDE))
// return EVENT_TRACING_WAS_LAUNCHED_BY_SOMEBODY_ELSE;
}
if (_step < 4)
{
// Command executed successfully. Wait for a few time until tracing session finish.
::std::this_thread::sleep_for(::std::chrono::milliseconds(500));
return startTrace(true, ++_step);
}
}
EASY_ERROR("Event tracing not launched: ERROR_ALREADY_EXISTS. To stop another session execute cmd: logman stop \"" << KERNEL_LOGGER_NAME << "\" -ets\n");
return EVENT_TRACING_WAS_LAUNCHED_BY_SOMEBODY_ELSE;
}
case ERROR_ACCESS_DENIED:
EASY_ERROR("Event tracing not launched: ERROR_ACCESS_DENIED. Try to launch your application as Administrator.\n");
return EVENT_TRACING_NOT_ENOUGH_ACCESS_RIGHTS;
case ERROR_BAD_LENGTH:
EASY_ERROR("Event tracing not launched: ERROR_BAD_LENGTH. It seems that your KERNEL_LOGGER_NAME differs from \"" << m_properties.sessionName << "\". Try to re-compile easy_profiler or contact EasyProfiler developers.\n");
return EVENT_TRACING_BAD_PROPERTIES_SIZE;
}
EASY_ERROR("Event tracing not launched: StartTrace() returned " << startTraceResult << ::std::endl);
return EVENT_TRACING_MISTERIOUS_ERROR;
}
::profiler::EventTracingEnableStatus EasyEventTracer::enable(bool _force)
{
::profiler::guard_lock<::profiler::spin_lock> lock(m_spin);
if (m_bEnabled)
return EVENT_TRACING_LAUNCHED_SUCCESSFULLY;
/*
Trying to set debug privilege for current process
to be able to get other process information (process name).
*/
EasyEventTracer::setProcessPrivileges();
// Clear properties
memset(&m_properties, 0, sizeof(m_properties));
m_properties.base.Wnode.BufferSize = sizeof(m_properties);
m_properties.base.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
m_properties.base.Wnode.ClientContext = RAW_TIMESTAMP_TIME_TYPE;
m_properties.base.Wnode.Guid = SystemTraceControlGuid;
m_properties.base.LoggerNameOffset = sizeof(m_properties.base);
m_properties.base.EnableFlags = EVENT_TRACE_FLAG_CSWITCH;
m_properties.base.LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
// Start event tracing
auto res = startTrace(_force);
if (res != EVENT_TRACING_LAUNCHED_SUCCESSFULLY)
return res;
memset(&m_trace, 0, sizeof(m_trace));
#ifdef __MINGW32__
m_trace.LoggerName = KERNEL_LOGGER;
#else
m_trace.LoggerName = KERNEL_LOGGER_NAME;
#endif
m_trace.ProcessTraceMode = PROCESS_TRACE_MODE_REAL_TIME | PROCESS_TRACE_MODE_EVENT_RECORD | PROCESS_TRACE_MODE_RAW_TIMESTAMP;
m_trace.EventRecordCallback = ::profiler::processTraceEvent;
m_openedHandle = OpenTrace(&m_trace);
if (m_openedHandle == INVALID_PROCESSTRACE_HANDLE)
{
EASY_ERROR("Event tracing not launched: OpenTrace() returned invalid handle.\n");
return EVENT_TRACING_OPEN_TRACE_ERROR;
}
/*
Have to launch a thread to process events because according to MSDN documentation:
The ProcessTrace function blocks the thread until it delivers all events, the BufferCallback function returns FALSE,
or you call CloseTrace. If the consumer is consuming events in real time, the ProcessTrace function returns after
the controller stops the trace session. (Note that there may be a several-second delay before the function returns.)
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364093(v=vs.85).aspx
*/
m_processThread = ::std::thread([this](bool _lowPriority)
{
if (_lowPriority) // Set low priority for event tracing thread
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST);
EASY_THREAD_SCOPE("EasyProfiler.ETW");
ProcessTrace(&m_openedHandle, 1, 0, 0);
}, m_lowPriority.load(::std::memory_order_acquire));
m_bEnabled = true;
EASY_LOGMSG("Event tracing launched\n");
return EVENT_TRACING_LAUNCHED_SUCCESSFULLY;
}
void EasyEventTracer::disable()
{
::profiler::guard_lock<::profiler::spin_lock> lock(m_spin);
if (!m_bEnabled)
return;
EASY_LOGMSG("Event tracing is stopping...\n");
TRACING_END_TIME.store(getCurrentTime(), ::std::memory_order_release);
ControlTrace(m_openedHandle, KERNEL_LOGGER_NAME, props(), EVENT_TRACE_CONTROL_STOP);
CloseTrace(m_openedHandle);
// Wait for ProcessTrace to finish to make sure no processTraceEvent() will be called later.
if (m_processThread.joinable())
m_processThread.join();
m_bEnabled = false;
// processTraceEvent() is not called anymore. Clean static maps is safe.
PROCESS_INFO_TABLE.clear();
THREAD_PROCESS_INFO_TABLE.clear();
THREAD_PROCESS_INFO_TABLE[0U] = nullptr;
TRACING_END_TIME.store(~0ULL, ::std::memory_order_release);
EASY_LOGMSG("Event tracing stopped\n");
}
} // END of namespace profiler.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // _WIN32

View File

@ -0,0 +1,129 @@
/************************************************************************
* file name : event_trace_win.h
* ----------------- :
* creation time : 2016/09/04
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of EasyEventTracer class used for tracing
* : Windows system events to get context switches.
* ----------------- :
* change log : * 2016/09/04 Victor Zarubkin: initial commit.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER_EVENT_TRACE_WINDOWS_H
#define EASY_PROFILER_EVENT_TRACE_WINDOWS_H
#ifdef _WIN32
#define INITGUID // This is to enable using SystemTraceControlGuid in evntrace.h.
#include <Windows.h>
#include <Strsafe.h>
#include <wmistr.h>
#include <evntrace.h>
#include <evntcons.h>
#include <thread>
#include <atomic>
#include "event_trace_status.h"
#include "spin_lock.h"
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
namespace profiler {
class EasyEventTracer EASY_FINAL
{
#ifndef EASY_MAGIC_STATIC_AVAILABLE
friend class EasyEventTracerInstance;
#endif
#pragma pack(push, 1)
struct Properties {
EVENT_TRACE_PROPERTIES base;
char sessionName[sizeof(KERNEL_LOGGER_NAME)];
};
#pragma pack(pop)
::std::thread m_processThread;
Properties m_properties;
EVENT_TRACE_LOGFILE m_trace;
::profiler::spin_lock m_spin;
::std::atomic_bool m_lowPriority;
TRACEHANDLE m_sessionHandle = INVALID_PROCESSTRACE_HANDLE;
TRACEHANDLE m_openedHandle = INVALID_PROCESSTRACE_HANDLE;
bool m_bEnabled = false;
public:
static EasyEventTracer& instance();
~EasyEventTracer();
bool isLowPriority() const;
::profiler::EventTracingEnableStatus enable(bool _force = false);
void disable();
void setLowPriority(bool _value);
static void setProcessPrivileges();
private:
EasyEventTracer();
inline EVENT_TRACE_PROPERTIES* props()
{
return reinterpret_cast<EVENT_TRACE_PROPERTIES*>(&m_properties);
}
::profiler::EventTracingEnableStatus startTrace(bool _force, int _step = 0);
}; // END of class EasyEventTracer.
} // END of namespace profiler.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // _WIN32
#endif // EASY_PROFILER_EVENT_TRACE_WINDOWS_H

View File

@ -0,0 +1,28 @@
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include("${CMAKE_CURRENT_LIST_DIR}/easy_profilerTargets.cmake")
check_required_components("easy_profiler")

View File

@ -0,0 +1,46 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
# but only if the requested major version is the same as the current one.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "1.3.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if("1.3.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
else()
set(CVF_VERSION_MAJOR "1.3.0")
endif()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()

View File

@ -0,0 +1,298 @@
/************************************************************************
* file name : hashed_str.h
* ----------------- :
* creation time : 2016/09/11
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains definition of C-strings with calculated hash-code.
* : These strings may be used as optimized keys for std::unordered_map.
* ----------------- :
* change log : * 2016/09/11 Victor Zarubkin: Initial commit. Moved sources from reader.cpp
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER__HASHED_CSTR__H_
#define EASY_PROFILER__HASHED_CSTR__H_
#include <functional>
#include <string.h>
#include <string>
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#if 0 == 1//defined(_MSC_VER)// && _MSC_VER >= 1800
# define EASY_PROFILER_HASHED_CSTR_DEFINED
namespace profiler {
/** \brief Simple C-string pointer with length.
It is used as base class for a key in std::unordered_map.
It is used to get better performance than std::string.
It simply stores a pointer and a length, there is no
any memory allocation and copy.
\warning Make sure you know what you are doing. You have to be sure that
pointed C-string will exist until you finish using this cstring.
\ingroup profiler
*/
class cstring
{
protected:
const char* m_str;
size_t m_len;
public:
cstring(const char* _str) : m_str(_str), m_len(strlen(_str))
{
}
cstring(const char* _str, size_t _len) : m_str(_str), m_len(_len)
{
}
cstring(const cstring&) = default;
cstring& operator = (const cstring&) = default;
inline bool operator == (const cstring& _other) const
{
return m_len == _other.m_len && !strncmp(m_str, _other.m_str, m_len);
}
inline bool operator != (const cstring& _other) const
{
return !operator == (_other);
}
inline bool operator < (const cstring& _other) const
{
if (m_len == _other.m_len)
{
return strncmp(m_str, _other.m_str, m_len) < 0;
}
return m_len < _other.m_len;
}
inline const char* c_str() const
{
return m_str;
}
inline size_t size() const
{
return m_len;
}
}; // END of class cstring.
/** \brief cstring with precalculated hash.
This is used to calculate hash for C-string and to cache it
to be used in the future without recurring hash calculatoin.
\note This class is used as a key in std::unordered_map.
\ingroup profiler
*/
class hashed_cstr : public cstring
{
typedef cstring Parent;
size_t m_hash;
public:
hashed_cstr(const char* _str) : Parent(_str), m_hash(0)
{
m_hash = ::std::_Hash_seq((const unsigned char *)m_str, m_len);
}
hashed_cstr(const char* _str, size_t _hash_code) : Parent(_str), m_hash(_hash_code)
{
}
hashed_cstr(const char* _str, size_t _len, size_t _hash_code) : Parent(_str, _len), m_hash(_hash_code)
{
}
hashed_cstr(const hashed_cstr&) = default;
hashed_cstr& operator = (const hashed_cstr&) = default;
inline bool operator == (const hashed_cstr& _other) const
{
return m_hash == _other.m_hash && Parent::operator == (_other);
}
inline bool operator != (const hashed_cstr& _other) const
{
return !operator == (_other);
}
inline size_t hcode() const
{
return m_hash;
}
}; // END of class hashed_cstr.
} // END of namespace profiler.
namespace std {
/** \brief Simply returns precalculated hash of a C-string. */
template <> struct hash<::profiler::hashed_cstr> {
typedef ::profiler::hashed_cstr argument_type;
typedef size_t result_type;
inline size_t operator () (const ::profiler::hashed_cstr& _str) const {
return _str.hcode();
}
};
} // END of namespace std.
#else ////////////////////////////////////////////////////////////////////
// TODO: Create hashed_cstr for Linux (need to use Linux version of std::_Hash_seq)
#endif
namespace profiler {
class hashed_stdstring
{
::std::string m_str;
size_t m_hash;
public:
hashed_stdstring(const char* _str) : m_str(_str), m_hash(::std::hash<::std::string>()(m_str))
{
}
hashed_stdstring(const ::std::string& _str) : m_str(_str), m_hash(::std::hash<::std::string>()(m_str))
{
}
hashed_stdstring(::std::string&& _str) : m_str(::std::forward<::std::string&&>(_str)), m_hash(::std::hash<::std::string>()(m_str))
{
}
hashed_stdstring(hashed_stdstring&& _other) : m_str(::std::move(_other.m_str)), m_hash(_other.m_hash)
{
}
hashed_stdstring(const char* _str, size_t _hash_code) : m_str(_str), m_hash(_hash_code)
{
}
hashed_stdstring(const ::std::string& _str, size_t _hash_code) : m_str(_str), m_hash(_hash_code)
{
}
hashed_stdstring(::std::string&& _str, size_t _hash_code) : m_str(::std::forward<::std::string&&>(_str)), m_hash(_hash_code)
{
}
hashed_stdstring(const hashed_stdstring&) = default;
hashed_stdstring& operator = (const hashed_stdstring&) = default;
hashed_stdstring& operator = (hashed_stdstring&& _other)
{
m_str = ::std::move(_other.m_str);
m_hash = _other.m_hash;
return *this;
}
inline bool operator == (const hashed_stdstring& _other) const
{
return m_hash == _other.m_hash && m_str == _other.m_str;
}
inline bool operator != (const hashed_stdstring& _other) const
{
return !operator == (_other);
}
inline size_t hcode() const
{
return m_hash;
}
inline const char* c_str() const
{
return m_str.c_str();
}
inline size_t size() const
{
return m_str.size();
}
}; // END of class hashed_stdstring.
} // END of namespace profiler.
namespace std {
/** \brief Simply returns precalculated hash of a std::string. */
template <> struct hash<::profiler::hashed_stdstring> {
typedef ::profiler::hashed_stdstring argument_type;
typedef size_t result_type;
inline size_t operator () (const ::profiler::hashed_stdstring& _str) const {
return _str.hcode();
}
};
} // END of namespace std.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER__HASHED_CSTR__H_

View File

@ -0,0 +1,308 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_ARBITRARY_VALUE_H
#define EASY_PROFILER_ARBITRARY_VALUE_H
#include <easy/details/arbitrary_value_public_types.h>
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
#ifdef USING_EASY_PROFILER
/** Macro used to create a unique Value Identification Number.
Use this if you want to change the same value from different places in your code.
Otherwise do not mind.
\code
struct A {
int someCount;
};
void foo(const A& a) {
EASY_VALUE("foo count", a.someCount); // Value ID is automatically set to (uint64_t)&a.someCount
// This notation is completely the same as EASY_VALUE("foo count", a.someCount, EASY_VIN(a.someCount));
}
void bar(const A& b) {
EASY_VALUE("bar count", b.someCount); // Same ID as for "foo count" if &b == &a (and different ID otherwise)
}
void baz(const A& c) {
EASY_VALUE("baz count", c.someCount, EASY_VIN(EASY_FUNC_NAME)); // Different ID from "foo count" and "bar count"
EASY_VALUE("qux count", 100500, EASY_VIN(EASY_FUNC_NAME)); // Same ID as for "baz count"
}
\endcode
\ingroup profiler
*/
# define EASY_VIN(member) ::profiler::ValueId(member)
/** Macro used to identify global value which would be recognized by it's name in GUI.
\code
struct A {
int someCount;
};
struct B {
int someOtherCount;
};
void foo(const A& a) {
EASY_VALUE("Count", a.someCount, EASY_GLOBAL_VIN);
}
void bar(const B& b) {
EASY_VALUE("Count", b.someOtherCount, EASY_GLOBAL_VIN); // Same ID as for foo::"Count" despite of &b != &a
}
\endcode
\ingroup profiler
*/
# define EASY_GLOBAL_VIN ::profiler::ValueId()
/** Macro used to identify unique value.
\code
struct A {
int someCount;
};
void foo(const A& a) {
// All these values would have different IDs despite of names, pointers and values are the same
EASY_VALUE("foo count", a.someCount, EASY_UNIQUE_VIN);
EASY_VALUE("foo count", a.someCount, EASY_UNIQUE_VIN);
EASY_VALUE("foo count", a.someCount, EASY_UNIQUE_VIN);
}
\endcode
\ingroup profiler
*/
# define EASY_UNIQUE_VIN ::profiler::ValueId(EASY_UNIQUE_DESC(__LINE__))
/** Macro used to store single arbitrary value.
\note Also stores a time-stamp of it's occurrence like an Event.
\note To store an array, please, use EASY_ARRAY macro.
\note Currently arbitrary values support only compile-time names.
\sa EASY_ARRAY, EASY_TEXT, EASY_STRING
\ingroup profiler
*/
# define EASY_VALUE(name, value, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(\
::profiler::extract_enable_flag(__VA_ARGS__), EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name),\
__FILE__, __LINE__, ::profiler::BlockType::Value, ::profiler::extract_color(__VA_ARGS__), false));\
::profiler::setValue(EASY_UNIQUE_DESC(__LINE__), value, ::profiler::extract_value_id(value, ## __VA_ARGS__));
/** Macro used to store an array of arbitrary values.
\note Also stores a time-stamp of it's occurrence like an Event.
\note Currently arbitrary values support only compile-time names.
\sa EASY_VALUE, EASY_TEXT, EASY_STRING
\ingroup profiler
*/
# define EASY_ARRAY(name, value, size, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(\
::profiler::extract_enable_flag(__VA_ARGS__), EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name),\
__FILE__, __LINE__, ::profiler::BlockType::Value, ::profiler::extract_color(__VA_ARGS__), false));\
::profiler::setValue(EASY_UNIQUE_DESC(__LINE__), value, ::profiler::extract_value_id(value, ## __VA_ARGS__), size);
/** Macro used to store custom text.
Could be C-string or std::string.
\note Also stores a time-stamp of it's occurrence like an Event.
\note Currently arbitrary values support only compile-time names.
\sa EASY_VALUE, EASY_ARRAY, EASY_STRING
\ingroup profiler
*/
# define EASY_TEXT(name, text, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(\
::profiler::extract_enable_flag(__VA_ARGS__), EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name),\
__FILE__, __LINE__, ::profiler::BlockType::Value, ::profiler::extract_color(__VA_ARGS__), false));\
::profiler::setText(EASY_UNIQUE_DESC(__LINE__), text, ::profiler::extract_value_id(text , ## __VA_ARGS__));
/** Macro used to store custom text of specified length.
Same as EASY_TEXT, but with explicitly specified length.
Use this for C-strings of known length (compile-time or run-time).
\note Recommendation (not a requirement): Take into account a zero-terminator '\0' symbol (e.g. strlen("BlaBla") + 1).
\note Also stores a time-stamp of it's occurrence like an Event.
\note Currently arbitrary values support only compile-time names.
\sa EASY_VALUE, EASY_ARRAY, EASY_TEXT
\ingroup profiler
*/
# define EASY_STRING(name, text, size, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(\
::profiler::extract_enable_flag(__VA_ARGS__), EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name),\
__FILE__, __LINE__, ::profiler::BlockType::Value, ::profiler::extract_color(__VA_ARGS__), false));\
::profiler::setText(EASY_UNIQUE_DESC(__LINE__), text, ::profiler::extract_value_id(text, ## __VA_ARGS__), size);
namespace profiler
{
EASY_CONSTEXPR uint16_t MaxArbitraryValuesArraySize = 65535;
extern "C" PROFILER_API void storeValue(const BaseBlockDescriptor* _desc, DataType _type, const void* _data,
size_t _size, bool _isArray, ValueId _vin);
template <class T>
inline void setValue(const BaseBlockDescriptor* _desc, T _value, ValueId _vin)
{
static_assert(!::std::is_pointer<T>::value,
"You should not pass pointers into EASY_VALUE. Pass a reference instead.");
using Type = typename ::std::remove_reference<typename ::std::remove_cv<T>::type>::type;
static_assert(StdToDataType<Type>::data_type != DataType::TypesCount,
"You should use standard builtin scalar types as profiler::Value type!");
storeValue(_desc, StdToDataType<Type>::data_type, &_value, sizeof(Type), false, _vin);
}
template <class T>
inline void setValue(const BaseBlockDescriptor* _desc, const T* _valueArray, ValueId _vin, uint16_t _arraySize)
{
static_assert(StdToDataType<T>::data_type != DataType::TypesCount,
"You should use standard builtin scalar types as profiler::Value type!");
storeValue(_desc, StdToDataType<T>::data_type, _valueArray, sizeof(T) * _arraySize, true, _vin);
}
template <class T, size_t N>
inline void setValue(const BaseBlockDescriptor* _desc, const T (&_value)[N], ValueId _vin)
{
static_assert(StdToDataType<T>::data_type != DataType::TypesCount,
"You should use standard builtin scalar types as profiler::Value type!");
static_assert(N <= MaxArbitraryValuesArraySize, "Maximum arbitrary values array size is 65535.");
storeValue(_desc, StdToDataType<T>::data_type, _value, sizeof(_value), true, _vin);
}
inline void setText(const BaseBlockDescriptor* _desc, const char* _text, ValueId _vin, uint16_t _textLength)
{
storeValue(_desc, DataType::String, _text, _textLength, true, _vin);
}
inline void setText(const BaseBlockDescriptor* _desc, const char* _text, ValueId _vin)
{
storeValue(_desc, DataType::String, _text, strlen(_text) + 1, true, _vin);
}
inline void setText(const BaseBlockDescriptor* _desc, const ::std::string& _text, ValueId _vin)
{
storeValue(_desc, DataType::String, _text.c_str(), _text.size() + 1, true, _vin);
}
template <size_t N>
inline void setText(const BaseBlockDescriptor* _desc, const char (&_text)[N], ValueId _vin)
{
static_assert(N <= MaxArbitraryValuesArraySize, "Maximum arbitrary values array size is 65535.");
storeValue(_desc, DataType::String, &_text[0], N, true, _vin);
}
} // end of namespace profiler.
#else
# define EASY_GLOBAL_VIN
# define EASY_UNIQUE_VIN
# define EASY_VIN(member)
# define EASY_VALUE(...)
# define EASY_ARRAY(...)
# define EASY_TEXT(...)
# define EASY_STRING(...)
namespace profiler
{
inline void storeValue(const BaseBlockDescriptor*, DataType, const void*, size_t, bool, ValueId) {}
template <class T>
inline void setValue(const BaseBlockDescriptor*, T, ValueId) {}
template <class T>
inline void setValue(const BaseBlockDescriptor*, const T*, ValueId, uint16_t) {}
template <class T, size_t N>
inline void setValue(const BaseBlockDescriptor*, const T (&)[N], ValueId) {}
inline void setText(const BaseBlockDescriptor*, const char*, ValueId, uint16_t) {}
inline void setText(const BaseBlockDescriptor*, const char*, ValueId) {}
inline void setText(const BaseBlockDescriptor*, const ::std::string&, ValueId) {}
template <size_t N>
inline void setText(const BaseBlockDescriptor*, const char (&)[N], ValueId) {}
} // end of namespace profiler.
#endif // USING_EASY_PROFILER
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
#endif // EASY_PROFILER_ARBITRARY_VALUE_H

View File

@ -0,0 +1,130 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_ARBITRARY_VALUE_AUX_H
#define EASY_PROFILER_ARBITRARY_VALUE_AUX_H
#include <easy/details/easy_compiler_support.h>
#include <stdint.h>
namespace profiler
{
using vin_t = uint64_t;
class ValueId EASY_FINAL
{
friend ::ThreadStorage;
vin_t m_id;
public:
#if defined(_MSC_VER) && _MSC_VER <= 1800
inline EASY_CONSTEXPR_FCN ValueId(const ValueId& _another) : m_id(_another.m_id) {}
inline EASY_CONSTEXPR_FCN ValueId(ValueId&& _another) : m_id(_another.m_id) {}
#else
inline EASY_CONSTEXPR_FCN ValueId(const ValueId&) = default;
inline EASY_CONSTEXPR_FCN ValueId(ValueId&&) = default;
#endif
explicit inline EASY_CONSTEXPR_FCN ValueId() : m_id(0) {}
explicit inline EASY_CONSTEXPR_FCN ValueId(const void* _member) : m_id(reinterpret_cast<vin_t>(_member)) {}
template <class T>
explicit inline EASY_CONSTEXPR_FCN ValueId(const T& _member) : m_id(reinterpret_cast<vin_t>(&_member)) {}
template <class T, size_t N>
explicit inline EASY_CONSTEXPR_FCN ValueId(const T (&_member)[N]) : m_id(reinterpret_cast<vin_t>((void*)_member)) {}
ValueId& operator = (const ValueId&) = delete;
ValueId& operator = (ValueId&&) = delete;
};
namespace {
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN bool subextract_value_id(TArgs...);
template <>
inline EASY_CONSTEXPR_FCN bool subextract_value_id<>() { return false; }
template <class T>
inline EASY_CONSTEXPR_FCN bool subextract_value_id(T) { return false; }
inline EASY_CONSTEXPR_FCN ValueId subextract_value_id(ValueId _value) { return _value; }
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN ValueId subextract_value_id(ValueId _value, TArgs...) { return _value; }
template <class T, class ... TArgs>
inline EASY_CONSTEXPR_FCN auto subextract_value_id(T, TArgs... _args) -> decltype(subextract_value_id(_args...)) {
return subextract_value_id(_args...);
}
struct GetFirst {
template <class T, class ... TArgs>
static EASY_CONSTEXPR_FCN ValueId get(const T& _first, TArgs...) { return ValueId(_first); }
template <class T, size_t N, class ... TArgs>
static EASY_CONSTEXPR_FCN ValueId get(const T (&_first)[N], TArgs...) { return ValueId(_first); }
};
struct GetRest {
template <class T, class ... TArgs>
static EASY_CONSTEXPR_FCN ValueId get(const T&, TArgs... _args) { return subextract_value_id(_args...); }
};
} // end of noname namespace.
template <class T, class ... TArgs>
inline EASY_CONSTEXPR_FCN ValueId extract_value_id(const T& _first, TArgs... _args) {
return ::std::conditional<::std::is_same<ValueId, decltype(subextract_value_id(_args...))>::value, GetRest, GetFirst>
::type::get(_first, _args...);
}
template <class T, size_t N, class ... TArgs>
inline EASY_CONSTEXPR_FCN ValueId extract_value_id(const T (&_first)[N], TArgs... _args) {
return ::std::conditional<::std::is_same<ValueId, decltype(subextract_value_id(_args...))>::value, GetRest, GetFirst>
::type::get(_first, _args...);
}
} // end of namespace profiler.
#endif // EASY_PROFILER_ARBITRARY_VALUE_AUX_H

View File

@ -0,0 +1,102 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_ARBITRARY_VALUE_PUBLIC_TYPES_H
#define EASY_PROFILER_ARBITRARY_VALUE_PUBLIC_TYPES_H
#include <easy/details/arbitrary_value_aux.h>
#include <easy/details/profiler_public_types.h>
#include <string.h>
namespace profiler
{
enum class DataType : uint8_t
{
Bool = 0,
Char,
Int8,
Uint8,
Int16,
Uint16,
Int32,
Uint32,
Int64,
Uint64,
Float,
Double,
String,
TypesCount
}; // end of enum class DataType.
template <DataType dataType> struct StdType;
template <class T> struct StdToDataType EASY_FINAL {
EASY_STATIC_CONSTEXPR auto data_type = DataType::TypesCount;
};
# define EASY_DATATYPE_CONVERSION(DataTypeName, StdTypeName)\
template <> struct StdType<DataTypeName> EASY_FINAL { using value_type = StdTypeName; };\
template <> struct StdToDataType<StdTypeName> EASY_FINAL { EASY_STATIC_CONSTEXPR auto data_type = DataTypeName; }
EASY_DATATYPE_CONVERSION(DataType::Bool , bool );
EASY_DATATYPE_CONVERSION(DataType::Char , char );
EASY_DATATYPE_CONVERSION(DataType::Int8 , int8_t );
EASY_DATATYPE_CONVERSION(DataType::Uint8 , uint8_t );
EASY_DATATYPE_CONVERSION(DataType::Int16 , int16_t );
EASY_DATATYPE_CONVERSION(DataType::Uint16, uint16_t);
EASY_DATATYPE_CONVERSION(DataType::Int32 , int32_t );
EASY_DATATYPE_CONVERSION(DataType::Uint32, uint32_t);
EASY_DATATYPE_CONVERSION(DataType::Int64 , int64_t );
EASY_DATATYPE_CONVERSION(DataType::Uint64, uint64_t);
EASY_DATATYPE_CONVERSION(DataType::Float , float );
EASY_DATATYPE_CONVERSION(DataType::Double, double );
# undef EASY_DATATYPE_CONVERSION
template <> struct StdType<DataType::String> EASY_FINAL { using value_type = char; };
template <> struct StdToDataType<const char*> EASY_FINAL { EASY_STATIC_CONSTEXPR auto data_type = DataType::String; };
} // end of namespace profiler.
#endif //EASY_PROFILER_ARBITRARY_VALUE_PUBLIC_TYPES_H

View File

@ -0,0 +1,224 @@
/************************************************************************
* file name : easy_compiler_support.h
* ----------------- :
* creation time : 2016/09/22
* authors : Victor Zarubkin, Sergey Yagovtsev
* emails : v.s.zarubkin@gmail.com, yse.sey@gmail.com
* ----------------- :
* description : This file contains auxiliary profiler macros for different compiler support.
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER_COMPILER_SUPPORT_H
#define EASY_PROFILER_COMPILER_SUPPORT_H
#include <cstddef>
#if defined(_WIN32) && !defined(EASY_PROFILER_STATIC)
// Visual Studio and MinGW
# ifdef _BUILD_PROFILER
# define PROFILER_API __declspec(dllexport)
# else
# define PROFILER_API __declspec(dllimport)
# endif
#endif
#if defined(_MSC_VER)
//////////////////////////////////////////////////////////////////////////
// Visual Studio
# if defined(EASY_OPTION_PRETTY_PRINT_FUNCTIONS) && EASY_OPTION_PRETTY_PRINT_FUNCTIONS != 0
# define EASY_FUNC_NAME __FUNCSIG__
# else
# define EASY_FUNC_NAME __FUNCTION__
# endif
# if _MSC_VER <= 1800
// There is no support for C++11 thread_local keyword prior to Visual Studio 2015. Use __declspec(thread) instead.
// There is also no support for C++11 magic statics feature :( So it becomes slightly harder to initialize static vars - additional "if" for each profiler block.
# define EASY_THREAD_LOCAL __declspec(thread)
# define EASY_LOCAL_STATIC_PTR(VarType, VarName, VarInitializer)\
__declspec(thread) static VarType VarName = 0;\
if (!VarName)\
VarName = VarInitializer
// No constexpr support before Visual Studio 2015
# define EASY_CONSTEXPR const
# define EASY_STATIC_CONSTEXPR static const
# define EASY_CONSTEXPR_FCN
// No noexcept support before Visual Studio 2015
# define EASY_NOEXCEPT throw()
# endif
# define EASY_FORCE_INLINE __forceinline
#elif defined(__clang__)
//////////////////////////////////////////////////////////////////////////
// Clang Compiler
# define EASY_COMPILER_VERSION (__clang_major__ * 10 + __clang_minor__)
# if EASY_COMPILER_VERSION < 33 || (defined(__APPLE_CC__) && __APPLE_CC__ < 8000)
// There is no support for C++11 thread_local keyword prior to Clang v3.3 and Apple LLVM clang 8.0. Use __thread instead.
# define EASY_THREAD_LOCAL __thread
# endif
# if EASY_COMPILER_VERSION < 31
// No constexpr support before Clang v3.1
# define EASY_CONSTEXPR const
# define EASY_STATIC_CONSTEXPR static const
# define EASY_CONSTEXPR_FCN
# endif
# if EASY_COMPILER_VERSION < 29
// There is no support for C++11 magic statics feature prior to clang 2.9. It becomes slightly harder to initialize static vars - additional "if" for each profiler block.
# define EASY_LOCAL_STATIC_PTR(VarType, VarName, VarInitializer)\
EASY_THREAD_LOCAL static VarType VarName = 0;\
if (!VarName)\
VarName = VarInitializer
// There is no support for C++11 final keyword prior to Clang v2.9
# define EASY_FINAL
# endif
# define EASY_FORCE_INLINE inline __attribute__((always_inline))
# undef EASY_COMPILER_VERSION
#elif defined(__GNUC__)
//////////////////////////////////////////////////////////////////////////
// GNU Compiler
# define EASY_COMPILER_VERSION (__GNUC__ * 10 + __GNUC_MINOR__)
# if EASY_COMPILER_VERSION < 48
// There is no support for C++11 thread_local keyword prior to gcc 4.8. Use __thread instead.
# define EASY_THREAD_LOCAL __thread
# endif
# if EASY_COMPILER_VERSION < 46
// No constexpr support before GCC v4.6
# define EASY_CONSTEXPR const
# define EASY_STATIC_CONSTEXPR static const
# define EASY_CONSTEXPR_FCN
// No noexcept support before GCC v4.6
# define EASY_NOEXCEPT throw()
# endif
# if EASY_COMPILER_VERSION < 43
// There is no support for C++11 magic statics feature prior to gcc 4.3. It becomes slightly harder to initialize static vars - additional "if" for each profiler block.
# define EASY_LOCAL_STATIC_PTR(VarType, VarName, VarInitializer)\
EASY_THREAD_LOCAL static VarType VarName = 0;\
if (!VarName)\
VarName = VarInitializer
# endif
# if EASY_COMPILER_VERSION < 47
// There is no support for C++11 final keyword prior to gcc 4.7
# define EASY_FINAL
# endif
# define EASY_FORCE_INLINE inline __attribute__((always_inline))
# undef EASY_COMPILER_VERSION
#else
//////////////////////////////////////////////////////////////////////////
// TODO: Add other compilers support
static_assert(false, "EasyProfiler is not configured for using your compiler type. Please, contact developers.");
#endif
// END
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Default values
#ifndef EASY_FUNC_NAME
# if defined(EASY_OPTION_PRETTY_PRINT_FUNCTIONS) && EASY_OPTION_PRETTY_PRINT_FUNCTIONS != 0
# define EASY_FUNC_NAME __PRETTY_FUNCTION__
# else
# define EASY_FUNC_NAME __func__
# endif
#endif
#ifndef EASY_THREAD_LOCAL
# define EASY_THREAD_LOCAL thread_local
# define EASY_CXX11_TLS_AVAILABLE
#endif
#ifndef EASY_LOCAL_STATIC_PTR
# define EASY_LOCAL_STATIC_PTR(VarType, VarName, VarInitializer) static VarType VarName = VarInitializer
# define EASY_MAGIC_STATIC_AVAILABLE
#endif
#ifndef EASY_FINAL
# define EASY_FINAL final
#endif
#ifndef EASY_FORCE_INLINE
# define EASY_FORCE_INLINE inline
#endif
#ifndef EASY_CONSTEXPR
# define EASY_CONSTEXPR constexpr
# define EASY_STATIC_CONSTEXPR static constexpr
# define EASY_CONSTEXPR_FCN constexpr
# define EASY_CONSTEXPR_AVAILABLE
#endif
#ifndef EASY_NOEXCEPT
# define EASY_NOEXCEPT noexcept
# define EASY_NOEXCEPT_AVAILABLE
#endif
#ifndef PROFILER_API
# define PROFILER_API
#endif
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_COMPILER_SUPPORT_H

View File

@ -0,0 +1,214 @@
/************************************************************************
* file name : profiler_aux.h
* ----------------- :
* creation time : 2016/06/11
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : This file contains auxiliary profiler macros and funcitons.
* ----------------- :
* change log : * 2016/06/11 Victor Zarubkin: Moved sources from profiler.h
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER_AUX_H
#define EASY_PROFILER_AUX_H
#include <stdint.h>
#include <easy/details/easy_compiler_support.h>
#include <easy/details/profiler_colors.h>
//////////////////////////////////////////////////////////////////////////
namespace profiler {
enum EasyBlockStatus : uint8_t {
OFF = 0, ///< The block is OFF
ON = 1, ///< The block is ON (but if it's parent block is off recursively then this block will be off too)
FORCE_ON = ON | 2, ///< The block is ALWAYS ON (even if it's parent has turned off all children)
OFF_RECURSIVE = 4, ///< The block is OFF and all of it's children by call-stack are also OFF.
ON_WITHOUT_CHILDREN = ON | OFF_RECURSIVE, ///< The block is ON but all of it's children are OFF.
FORCE_ON_WITHOUT_CHILDREN = FORCE_ON | OFF_RECURSIVE, ///< The block is ALWAYS ON but all of it's children are OFF.
};
}
//////////////////////////////////////////////////////////////////////////
#include <type_traits>
#include <string>
# define EASY_STRINGIFY(a) #a
# define EASY_STRINGIFICATION(a) EASY_STRINGIFY(a)
# define EASY_TOKEN_JOIN(x, y) x ## y
# define EASY_TOKEN_CONCATENATE(x, y) EASY_TOKEN_JOIN(x, y)
# define EASY_UNIQUE_BLOCK(x) EASY_TOKEN_CONCATENATE(unique_profiler_mark_name_, x)
# define EASY_UNIQUE_FRAME_COUNTER(x) EASY_TOKEN_CONCATENATE(unique_profiler_frame_mark_name_, x)
# define EASY_UNIQUE_DESC(x) EASY_TOKEN_CONCATENATE(unique_profiler_descriptor_, x)
#ifdef BUILD_WITH_EASY_PROFILER
namespace profiler {
template <const bool> struct NameSwitch;
class ForceConstStr EASY_FINAL {
friend NameSwitch<true>;
friend NameSwitch<false>;
const char* c_str;
public:
ForceConstStr() = delete;
ForceConstStr(const ForceConstStr&) = delete;
ForceConstStr(ForceConstStr&&) = delete;
ForceConstStr& operator = (const ForceConstStr&) = delete;
ForceConstStr& operator = (ForceConstStr&&) = delete;
explicit EASY_CONSTEXPR_FCN ForceConstStr(const char* _str) : c_str(_str) {}
explicit ForceConstStr(const ::std::string& _str) : c_str(_str.c_str()) {}
};
template <const bool IS_REF> struct NameSwitch EASY_FINAL {
static const char* runtime_name(const char* name) { return name; }
static const char* runtime_name(const ::std::string& name) { return name.c_str(); }
static EASY_CONSTEXPR_FCN const char* runtime_name(const ForceConstStr&) { return ""; }
template <class T>
static EASY_CONSTEXPR_FCN const char* compiletime_name(const T&, const char* autoGeneratedName) { return autoGeneratedName; }
static EASY_CONSTEXPR_FCN const char* compiletime_name(const char*, const char* autoGeneratedName) { return autoGeneratedName; }
static EASY_CONSTEXPR_FCN const char* compiletime_name(const ForceConstStr& name, const char*) { return name.c_str; }
};
template <> struct NameSwitch<true> EASY_FINAL {
static EASY_CONSTEXPR_FCN const char* runtime_name(const char*) { return ""; }
static EASY_CONSTEXPR_FCN const char* runtime_name(const ForceConstStr&) { return ""; }
static const char* runtime_name(const ::std::string& name) { return name.c_str(); }
template <class T>
static EASY_CONSTEXPR_FCN const char* compiletime_name(const T&, const char* autoGeneratedName) { return autoGeneratedName; }
static EASY_CONSTEXPR_FCN const char* compiletime_name(const char* name, const char*) { return name; }
static EASY_CONSTEXPR_FCN const char* compiletime_name(const ForceConstStr& name, const char*) { return name.c_str; }
};
//***********************************************
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN color_t extract_color(TArgs...);
template <>
inline EASY_CONSTEXPR_FCN color_t extract_color<>() {
return ::profiler::colors::Default;
}
template <class T>
inline EASY_CONSTEXPR_FCN color_t extract_color(T) {
return ::profiler::colors::Default;
}
template <>
inline EASY_CONSTEXPR_FCN color_t extract_color<color_t>(color_t _color) {
return _color;
}
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN color_t extract_color(color_t _color, TArgs...) {
return _color;
}
template <class T, class ... TArgs>
inline EASY_CONSTEXPR_FCN color_t extract_color(T, TArgs... _args) {
return extract_color(_args...);
}
//***********************************************
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag(TArgs...);
template <>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag<>() {
return ::profiler::ON;
}
template <class T>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag(T) {
return ::profiler::ON;
}
template <>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag(EasyBlockStatus _flag) {
return _flag;
}
template <class ... TArgs>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag(EasyBlockStatus _flag, TArgs...) {
return _flag;
}
template <class T, class ... TArgs>
inline EASY_CONSTEXPR_FCN EasyBlockStatus extract_enable_flag(T, TArgs... _args) {
return extract_enable_flag(_args...);
}
//***********************************************
} // END of namespace profiler.
# define EASY_UNIQUE_LINE_ID __FILE__ ":" EASY_STRINGIFICATION(__LINE__)
# define EASY_COMPILETIME_NAME(name) ::profiler::NameSwitch<::std::is_reference<decltype(name)>::value>::compiletime_name(name, EASY_UNIQUE_LINE_ID)
# define EASY_RUNTIME_NAME(name) ::profiler::NameSwitch<::std::is_reference<decltype(name)>::value>::runtime_name(name)
# define EASY_CONST_NAME(name) ::profiler::ForceConstStr(name)
#else
# define EASY_CONST_NAME(name)
#endif // BUILD_WITH_EASY_PROFILER
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_AUX_H

View File

@ -0,0 +1,413 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_COLORS_H
#define EASY_PROFILER_COLORS_H
#include <cstdint>
#include <easy/details/easy_compiler_support.h>
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
namespace profiler {
using color_t = uint32_t; // Standard four-byte ARGB color format
namespace colors {
///< Change alpha for color. Only 8 major bytes (0xff000000) used from alpha.
inline EASY_CONSTEXPR_FCN color_t modify_alpha32(color_t _color, color_t _alpha) {
return (_alpha & 0xff000000) | (_color & 0x00ffffff);
}
///< Change alpha for color.
inline EASY_CONSTEXPR_FCN color_t modify_alpha8(color_t _color, uint8_t _alpha) {
return (static_cast<color_t>(_alpha) << 24) | (_color & 0x00ffffff);
}
///< Create color from ARGB components.
inline EASY_CONSTEXPR_FCN color_t color(uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t _alpha = 0xff) {
return (static_cast<color_t>(_alpha) << 24) | (static_cast<color_t>(_red) << 16) | (static_cast<color_t>(_green) << 8) | static_cast<color_t>(_blue);
}
#if !defined(EASY_OPTION_BUILTIN_COLORS) || EASY_OPTION_BUILTIN_COLORS != 0
// Google Material Design colors
// See https://material.google.com/style/color.html
EASY_CONSTEXPR color_t Red50 = 0xffffebee;
EASY_CONSTEXPR color_t Red100 = 0xffffcdd2;
EASY_CONSTEXPR color_t Red200 = 0xffef9a9a;
EASY_CONSTEXPR color_t Red300 = 0xffe57373;
EASY_CONSTEXPR color_t Red400 = 0xffef5350;
EASY_CONSTEXPR color_t Red500 = 0xfff44336;
EASY_CONSTEXPR color_t Red600 = 0xffe53935;
EASY_CONSTEXPR color_t Red700 = 0xffd32f2f;
EASY_CONSTEXPR color_t Red800 = 0xffc62828;
EASY_CONSTEXPR color_t Red900 = 0xffb71c1c;
EASY_CONSTEXPR color_t RedA100 = 0xffff8a80;
EASY_CONSTEXPR color_t RedA200 = 0xffff5252;
EASY_CONSTEXPR color_t RedA400 = 0xffff1744;
EASY_CONSTEXPR color_t RedA700 = 0xffd50000;
EASY_CONSTEXPR color_t Pink50 = 0xfffce4ec;
EASY_CONSTEXPR color_t Pink100 = 0xfff8bbd0;
EASY_CONSTEXPR color_t Pink200 = 0xfff48fb1;
EASY_CONSTEXPR color_t Pink300 = 0xfff06292;
EASY_CONSTEXPR color_t Pink400 = 0xffec407a;
EASY_CONSTEXPR color_t Pink500 = 0xffe91e63;
EASY_CONSTEXPR color_t Pink600 = 0xffd81b60;
EASY_CONSTEXPR color_t Pink700 = 0xffc2185b;
EASY_CONSTEXPR color_t Pink800 = 0xffad1457;
EASY_CONSTEXPR color_t Pink900 = 0xff880e4f;
EASY_CONSTEXPR color_t PinkA100 = 0xffff80ab;
EASY_CONSTEXPR color_t PinkA200 = 0xffff4081;
EASY_CONSTEXPR color_t PinkA400 = 0xfff50057;
EASY_CONSTEXPR color_t PinkA700 = 0xffc51162;
EASY_CONSTEXPR color_t Purple50 = 0xfff3e5f5;
EASY_CONSTEXPR color_t Purple100 = 0xffe1bee7;
EASY_CONSTEXPR color_t Purple200 = 0xffce93d8;
EASY_CONSTEXPR color_t Purple300 = 0xffba68c8;
EASY_CONSTEXPR color_t Purple400 = 0xffab47bc;
EASY_CONSTEXPR color_t Purple500 = 0xff9c27b0;
EASY_CONSTEXPR color_t Purple600 = 0xff8e24aa;
EASY_CONSTEXPR color_t Purple700 = 0xff7b1fa2;
EASY_CONSTEXPR color_t Purple800 = 0xff6a1b9a;
EASY_CONSTEXPR color_t Purple900 = 0xff4a148c;
EASY_CONSTEXPR color_t PurpleA100 = 0xffea80fc;
EASY_CONSTEXPR color_t PurpleA200 = 0xffe040fb;
EASY_CONSTEXPR color_t PurpleA400 = 0xffd500f9;
EASY_CONSTEXPR color_t PurpleA700 = 0xffaa00ff;
EASY_CONSTEXPR color_t DeepPurple50 = 0xffede7f6;
EASY_CONSTEXPR color_t DeepPurple100 = 0xffd1c4e9;
EASY_CONSTEXPR color_t DeepPurple200 = 0xffb39ddb;
EASY_CONSTEXPR color_t DeepPurple300 = 0xff9575cd;
EASY_CONSTEXPR color_t DeepPurple400 = 0xff7e57c2;
EASY_CONSTEXPR color_t DeepPurple500 = 0xff673ab7;
EASY_CONSTEXPR color_t DeepPurple600 = 0xff5e35b1;
EASY_CONSTEXPR color_t DeepPurple700 = 0xff512da8;
EASY_CONSTEXPR color_t DeepPurple800 = 0xff4527a0;
EASY_CONSTEXPR color_t DeepPurple900 = 0xff311b92;
EASY_CONSTEXPR color_t DeepPurpleA100 = 0xffb388ff;
EASY_CONSTEXPR color_t DeepPurpleA200 = 0xff7c4dff;
EASY_CONSTEXPR color_t DeepPurpleA400 = 0xff651fff;
EASY_CONSTEXPR color_t DeepPurpleA700 = 0xff6200ea;
EASY_CONSTEXPR color_t Indigo50 = 0xffe8eaf6;
EASY_CONSTEXPR color_t Indigo100 = 0xffc5cae9;
EASY_CONSTEXPR color_t Indigo200 = 0xff9fa8da;
EASY_CONSTEXPR color_t Indigo300 = 0xff7986cb;
EASY_CONSTEXPR color_t Indigo400 = 0xff5c6bc0;
EASY_CONSTEXPR color_t Indigo500 = 0xff3f51b5;
EASY_CONSTEXPR color_t Indigo600 = 0xff3949ab;
EASY_CONSTEXPR color_t Indigo700 = 0xff303f9f;
EASY_CONSTEXPR color_t Indigo800 = 0xff283593;
EASY_CONSTEXPR color_t Indigo900 = 0xff1a237e;
EASY_CONSTEXPR color_t IndigoA100 = 0xff8c9eff;
EASY_CONSTEXPR color_t IndigoA200 = 0xff536dfe;
EASY_CONSTEXPR color_t IndigoA400 = 0xff3d5afe;
EASY_CONSTEXPR color_t IndigoA700 = 0xff304ffe;
EASY_CONSTEXPR color_t Blue50 = 0xffe3f2fd;
EASY_CONSTEXPR color_t Blue100 = 0xffbbdefb;
EASY_CONSTEXPR color_t Blue200 = 0xff90caf9;
EASY_CONSTEXPR color_t Blue300 = 0xff64b5f6;
EASY_CONSTEXPR color_t Blue400 = 0xff42a5f5;
EASY_CONSTEXPR color_t Blue500 = 0xff2196f3;
EASY_CONSTEXPR color_t Blue600 = 0xff1e88e5;
EASY_CONSTEXPR color_t Blue700 = 0xff1976d2;
EASY_CONSTEXPR color_t Blue800 = 0xff1565c0;
EASY_CONSTEXPR color_t Blue900 = 0xff0d47a1;
EASY_CONSTEXPR color_t BlueA100 = 0xff82b1ff;
EASY_CONSTEXPR color_t BlueA200 = 0xff448aff;
EASY_CONSTEXPR color_t BlueA400 = 0xff2979ff;
EASY_CONSTEXPR color_t BlueA700 = 0xff2962ff;
EASY_CONSTEXPR color_t LightBlue50 = 0xffe1f5fe;
EASY_CONSTEXPR color_t LightBlue100 = 0xffb3e5fc;
EASY_CONSTEXPR color_t LightBlue200 = 0xff81d4fa;
EASY_CONSTEXPR color_t LightBlue300 = 0xff4fc3f7;
EASY_CONSTEXPR color_t LightBlue400 = 0xff29b6f6;
EASY_CONSTEXPR color_t LightBlue500 = 0xff03a9f4;
EASY_CONSTEXPR color_t LightBlue600 = 0xff039be5;
EASY_CONSTEXPR color_t LightBlue700 = 0xff0288d1;
EASY_CONSTEXPR color_t LightBlue800 = 0xff0277bd;
EASY_CONSTEXPR color_t LightBlue900 = 0xff01579b;
EASY_CONSTEXPR color_t LightBlueA100 = 0xff80d8ff;
EASY_CONSTEXPR color_t LightBlueA200 = 0xff40c4ff;
EASY_CONSTEXPR color_t LightBlueA400 = 0xff00b0ff;
EASY_CONSTEXPR color_t LightBlueA700 = 0xff0091ea;
EASY_CONSTEXPR color_t Cyan50 = 0xffe0f7fa;
EASY_CONSTEXPR color_t Cyan100 = 0xffb2ebf2;
EASY_CONSTEXPR color_t Cyan200 = 0xff80deea;
EASY_CONSTEXPR color_t Cyan300 = 0xff4dd0e1;
EASY_CONSTEXPR color_t Cyan400 = 0xff26c6da;
EASY_CONSTEXPR color_t Cyan500 = 0xff00bcd4;
EASY_CONSTEXPR color_t Cyan600 = 0xff00acc1;
EASY_CONSTEXPR color_t Cyan700 = 0xff0097a7;
EASY_CONSTEXPR color_t Cyan800 = 0xff00838f;
EASY_CONSTEXPR color_t Cyan900 = 0xff006064;
EASY_CONSTEXPR color_t CyanA100 = 0xff84ffff;
EASY_CONSTEXPR color_t CyanA200 = 0xff18ffff;
EASY_CONSTEXPR color_t CyanA400 = 0xff00e5ff;
EASY_CONSTEXPR color_t CyanA700 = 0xff00b8d4;
EASY_CONSTEXPR color_t Teal50 = 0xffe0f2f1;
EASY_CONSTEXPR color_t Teal100 = 0xffb2dfdb;
EASY_CONSTEXPR color_t Teal200 = 0xff80cbc4;
EASY_CONSTEXPR color_t Teal300 = 0xff4db6ac;
EASY_CONSTEXPR color_t Teal400 = 0xff26a69a;
EASY_CONSTEXPR color_t Teal500 = 0xff009688;
EASY_CONSTEXPR color_t Teal600 = 0xff00897b;
EASY_CONSTEXPR color_t Teal700 = 0xff00796b;
EASY_CONSTEXPR color_t Teal800 = 0xff00695c;
EASY_CONSTEXPR color_t Teal900 = 0xff004d40;
EASY_CONSTEXPR color_t TealA100 = 0xffa7ffeb;
EASY_CONSTEXPR color_t TealA200 = 0xff64ffda;
EASY_CONSTEXPR color_t TealA400 = 0xff1de9b6;
EASY_CONSTEXPR color_t TealA700 = 0xff00bfa5;
EASY_CONSTEXPR color_t Green50 = 0xffe8f5e9;
EASY_CONSTEXPR color_t Green100 = 0xffc8e6c9;
EASY_CONSTEXPR color_t Green200 = 0xffa5d6a7;
EASY_CONSTEXPR color_t Green300 = 0xff81c784;
EASY_CONSTEXPR color_t Green400 = 0xff66bb6a;
EASY_CONSTEXPR color_t Green500 = 0xff4caf50;
EASY_CONSTEXPR color_t Green600 = 0xff43a047;
EASY_CONSTEXPR color_t Green700 = 0xff388e3c;
EASY_CONSTEXPR color_t Green800 = 0xff2e7d32;
EASY_CONSTEXPR color_t Green900 = 0xff1b5e20;
EASY_CONSTEXPR color_t GreenA100 = 0xffb9f6ca;
EASY_CONSTEXPR color_t GreenA200 = 0xff69f0ae;
EASY_CONSTEXPR color_t GreenA400 = 0xff00e676;
EASY_CONSTEXPR color_t GreenA700 = 0xff00c853;
EASY_CONSTEXPR color_t LightGreen50 = 0xfff1f8e9;
EASY_CONSTEXPR color_t LightGreen100 = 0xffdcedc8;
EASY_CONSTEXPR color_t LightGreen200 = 0xffc5e1a5;
EASY_CONSTEXPR color_t LightGreen300 = 0xffaed581;
EASY_CONSTEXPR color_t LightGreen400 = 0xff9ccc65;
EASY_CONSTEXPR color_t LightGreen500 = 0xff8bc34a;
EASY_CONSTEXPR color_t LightGreen600 = 0xff7cb342;
EASY_CONSTEXPR color_t LightGreen700 = 0xff689f38;
EASY_CONSTEXPR color_t LightGreen800 = 0xff558b2f;
EASY_CONSTEXPR color_t LightGreen900 = 0xff33691e;
EASY_CONSTEXPR color_t LightGreenA100 = 0xffccff90;
EASY_CONSTEXPR color_t LightGreenA200 = 0xffb2ff59;
EASY_CONSTEXPR color_t LightGreenA400 = 0xff76ff03;
EASY_CONSTEXPR color_t LightGreenA700 = 0xff64dd17;
EASY_CONSTEXPR color_t Lime50 = 0xfff9ebe7;
EASY_CONSTEXPR color_t Lime100 = 0xfff0f4c3;
EASY_CONSTEXPR color_t Lime200 = 0xffe6ee9c;
EASY_CONSTEXPR color_t Lime300 = 0xffdce775;
EASY_CONSTEXPR color_t Lime400 = 0xffd4e157;
EASY_CONSTEXPR color_t Lime500 = 0xffcddc39;
EASY_CONSTEXPR color_t Lime600 = 0xffc0ca33;
EASY_CONSTEXPR color_t Lime700 = 0xffafb42b;
EASY_CONSTEXPR color_t Lime800 = 0xff9e9d24;
EASY_CONSTEXPR color_t Lime900 = 0xff827717;
EASY_CONSTEXPR color_t LimeA100 = 0xfff4ff81;
EASY_CONSTEXPR color_t LimeA200 = 0xffeeff41;
EASY_CONSTEXPR color_t LimeA400 = 0xffc6ff00;
EASY_CONSTEXPR color_t LimeA700 = 0xffaeea00;
EASY_CONSTEXPR color_t Yellow50 = 0xfffffde7;
EASY_CONSTEXPR color_t Yellow100 = 0xfffff9c4;
EASY_CONSTEXPR color_t Yellow200 = 0xfffff59d;
EASY_CONSTEXPR color_t Yellow300 = 0xfffff176;
EASY_CONSTEXPR color_t Yellow400 = 0xffffee58;
EASY_CONSTEXPR color_t Yellow500 = 0xffffeb3b;
EASY_CONSTEXPR color_t Yellow600 = 0xfffdd835;
EASY_CONSTEXPR color_t Yellow700 = 0xfffbc02d;
EASY_CONSTEXPR color_t Yellow800 = 0xfff9a825;
EASY_CONSTEXPR color_t Yellow900 = 0xfff57f17;
EASY_CONSTEXPR color_t YellowA100 = 0xffffff8d;
EASY_CONSTEXPR color_t YellowA200 = 0xffffff00;
EASY_CONSTEXPR color_t YellowA400 = 0xffffea00;
EASY_CONSTEXPR color_t YellowA700 = 0xffffd600;
EASY_CONSTEXPR color_t Amber50 = 0xfffff8e1;
EASY_CONSTEXPR color_t Amber100 = 0xffffecb3;
EASY_CONSTEXPR color_t Amber200 = 0xffffe082;
EASY_CONSTEXPR color_t Amber300 = 0xffffd54f;
EASY_CONSTEXPR color_t Amber400 = 0xffffca28;
EASY_CONSTEXPR color_t Amber500 = 0xffffc107;
EASY_CONSTEXPR color_t Amber600 = 0xffffb300;
EASY_CONSTEXPR color_t Amber700 = 0xffffa000;
EASY_CONSTEXPR color_t Amber800 = 0xffff8f00;
EASY_CONSTEXPR color_t Amber900 = 0xffff6f00;
EASY_CONSTEXPR color_t AmberA100 = 0xffffe57f;
EASY_CONSTEXPR color_t AmberA200 = 0xffffd740;
EASY_CONSTEXPR color_t AmberA400 = 0xffffc400;
EASY_CONSTEXPR color_t AmberA700 = 0xffffab00;
EASY_CONSTEXPR color_t Orange50 = 0xfffff3e0;
EASY_CONSTEXPR color_t Orange100 = 0xffffe0b2;
EASY_CONSTEXPR color_t Orange200 = 0xffffcc80;
EASY_CONSTEXPR color_t Orange300 = 0xffffb74d;
EASY_CONSTEXPR color_t Orange400 = 0xffffa726;
EASY_CONSTEXPR color_t Orange500 = 0xffff9800;
EASY_CONSTEXPR color_t Orange600 = 0xfffb8c00;
EASY_CONSTEXPR color_t Orange700 = 0xfff57c00;
EASY_CONSTEXPR color_t Orange800 = 0xffef6c00;
EASY_CONSTEXPR color_t Orange900 = 0xffe65100;
EASY_CONSTEXPR color_t OrangeA100 = 0xffffd180;
EASY_CONSTEXPR color_t OrangeA200 = 0xffffab40;
EASY_CONSTEXPR color_t OrangeA400 = 0xffff9100;
EASY_CONSTEXPR color_t OrangeA700 = 0xffff6d00;
EASY_CONSTEXPR color_t DeepOrange50 = 0xfffbe9e7;
EASY_CONSTEXPR color_t DeepOrange100 = 0xffffccbc;
EASY_CONSTEXPR color_t DeepOrange200 = 0xffffab91;
EASY_CONSTEXPR color_t DeepOrange300 = 0xffff8a65;
EASY_CONSTEXPR color_t DeepOrange400 = 0xffff7043;
EASY_CONSTEXPR color_t DeepOrange500 = 0xffff5722;
EASY_CONSTEXPR color_t DeepOrange600 = 0xfff4511e;
EASY_CONSTEXPR color_t DeepOrange700 = 0xffe64a19;
EASY_CONSTEXPR color_t DeepOrange800 = 0xffd84315;
EASY_CONSTEXPR color_t DeepOrange900 = 0xffbf360c;
EASY_CONSTEXPR color_t DeepOrangeA100 = 0xffff9e80;
EASY_CONSTEXPR color_t DeepOrangeA200 = 0xffff6e40;
EASY_CONSTEXPR color_t DeepOrangeA400 = 0xffff3d00;
EASY_CONSTEXPR color_t DeepOrangeA700 = 0xffdd2c00;
EASY_CONSTEXPR color_t Brown50 = 0xffefebe9;
EASY_CONSTEXPR color_t Brown100 = 0xffd7ccc8;
EASY_CONSTEXPR color_t Brown200 = 0xffbcaaa4;
EASY_CONSTEXPR color_t Brown300 = 0xffa1887f;
EASY_CONSTEXPR color_t Brown400 = 0xff8d6e63;
EASY_CONSTEXPR color_t Brown500 = 0xff795548;
EASY_CONSTEXPR color_t Brown600 = 0xff6d4c41;
EASY_CONSTEXPR color_t Brown700 = 0xff5d4037;
EASY_CONSTEXPR color_t Brown800 = 0xff4e342e;
EASY_CONSTEXPR color_t Brown900 = 0xff3e2723;
EASY_CONSTEXPR color_t Grey50 = 0xfffafafa;
EASY_CONSTEXPR color_t Grey100 = 0xfff5f5f5;
EASY_CONSTEXPR color_t Grey200 = 0xffeeeeee;
EASY_CONSTEXPR color_t Grey300 = 0xffe0e0e0;
EASY_CONSTEXPR color_t Grey400 = 0xffbdbdbd;
EASY_CONSTEXPR color_t Grey500 = 0xff9e9e9e;
EASY_CONSTEXPR color_t Grey600 = 0xff757575;
EASY_CONSTEXPR color_t Grey700 = 0xff616161;
EASY_CONSTEXPR color_t Grey800 = 0xff424242;
EASY_CONSTEXPR color_t Grey900 = 0xff212121;
EASY_CONSTEXPR color_t BlueGrey50 = 0xffeceff1;
EASY_CONSTEXPR color_t BlueGrey100 = 0xffcfd8dc;
EASY_CONSTEXPR color_t BlueGrey200 = 0xffb0bec5;
EASY_CONSTEXPR color_t BlueGrey300 = 0xff90a4ae;
EASY_CONSTEXPR color_t BlueGrey400 = 0xff78909c;
EASY_CONSTEXPR color_t BlueGrey500 = 0xff607d8b;
EASY_CONSTEXPR color_t BlueGrey600 = 0xff546e7a;
EASY_CONSTEXPR color_t BlueGrey700 = 0xff455a64;
EASY_CONSTEXPR color_t BlueGrey800 = 0xff37474f;
EASY_CONSTEXPR color_t BlueGrey900 = 0xff263238;
EASY_CONSTEXPR color_t Black = 0xff000000;
EASY_CONSTEXPR color_t White = 0xffffffff;
EASY_CONSTEXPR color_t Null = 0x00000000;
EASY_CONSTEXPR color_t Red = Red500;
EASY_CONSTEXPR color_t DarkRed = Red900;
EASY_CONSTEXPR color_t Coral = Red200;
EASY_CONSTEXPR color_t RichRed = 0xffff0000;
EASY_CONSTEXPR color_t Pink = Pink500;
EASY_CONSTEXPR color_t Rose = PinkA100;
EASY_CONSTEXPR color_t Purple = Purple500;
EASY_CONSTEXPR color_t Magenta = PurpleA200;
EASY_CONSTEXPR color_t DarkMagenta = PurpleA700;
EASY_CONSTEXPR color_t DeepPurple = DeepPurple500;
EASY_CONSTEXPR color_t Indigo = Indigo500;
EASY_CONSTEXPR color_t Blue = Blue500;
EASY_CONSTEXPR color_t DarkBlue = Blue900;
EASY_CONSTEXPR color_t RichBlue = 0xff0000ff;
EASY_CONSTEXPR color_t LightBlue = LightBlue500;
EASY_CONSTEXPR color_t SkyBlue = LightBlueA100;
EASY_CONSTEXPR color_t Navy = LightBlue800;
EASY_CONSTEXPR color_t Cyan = Cyan500;
EASY_CONSTEXPR color_t DarkCyan = Cyan900;
EASY_CONSTEXPR color_t Teal = Teal500;
EASY_CONSTEXPR color_t DarkTeal = Teal900;
EASY_CONSTEXPR color_t Green = Green500;
EASY_CONSTEXPR color_t DarkGreen = Green900;
EASY_CONSTEXPR color_t RichGreen = 0xff00ff00;
EASY_CONSTEXPR color_t LightGreen = LightGreen500;
EASY_CONSTEXPR color_t Mint = LightGreen900;
EASY_CONSTEXPR color_t Lime = Lime500;
EASY_CONSTEXPR color_t Olive = Lime900;
EASY_CONSTEXPR color_t Yellow = Yellow500;
EASY_CONSTEXPR color_t RichYellow = YellowA200;
EASY_CONSTEXPR color_t Amber = Amber500;
EASY_CONSTEXPR color_t Gold = Amber300;
EASY_CONSTEXPR color_t PaleGold = AmberA100;
EASY_CONSTEXPR color_t Orange = Orange500;
EASY_CONSTEXPR color_t Skin = Orange100;
EASY_CONSTEXPR color_t DeepOrange = DeepOrange500;
EASY_CONSTEXPR color_t Brick = DeepOrange900;
EASY_CONSTEXPR color_t Brown = Brown500;
EASY_CONSTEXPR color_t DarkBrown = Brown900;
EASY_CONSTEXPR color_t CreamWhite = Orange50;
EASY_CONSTEXPR color_t Wheat = Amber100;
EASY_CONSTEXPR color_t Grey = Grey500;
EASY_CONSTEXPR color_t Dark = Grey900;
EASY_CONSTEXPR color_t Silver = Grey300;
EASY_CONSTEXPR color_t BlueGrey = BlueGrey500;
EASY_CONSTEXPR color_t Default = Wheat;
#else
EASY_CONSTEXPR color_t Default = 0xffffecb3;
#endif // #if !defined(EASY_OPTION_BUILTIN_COLORS) || EASY_OPTION_BUILTIN_COLORS == 0
} // END of namespace colors.
} // END of namespace profiler.
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_COLORS_H

View File

@ -0,0 +1,203 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_PUBLIC_TYPES_H
#define EASY_PROFILER_PUBLIC_TYPES_H
#include <easy/details/profiler_aux.h>
class NonscopedBlock;
class ProfileManager;
struct ThreadStorage;
namespace profiler {
using timestamp_t = uint64_t;
using thread_id_t = uint64_t;
using block_id_t = uint32_t;
enum class BlockType : uint8_t
{
Event = 0,
Block,
Value,
TypesCount
};
using block_type_t = BlockType;
enum Duration : uint8_t
{
TICKS = 0, ///< CPU ticks
MICROSECONDS ///< Microseconds
};
//***********************************************
#pragma pack(push,1)
class PROFILER_API BaseBlockDescriptor
{
friend ::ProfileManager;
friend ::ThreadStorage;
protected:
block_id_t m_id; ///< This descriptor id (We can afford this spending because there are much more blocks than descriptors)
int32_t m_line; ///< Line number in the source file
color_t m_color; ///< Color of the block packed into 1-byte structure
block_type_t m_type; ///< Type of the block (See BlockType)
EasyBlockStatus m_status; ///< If false then blocks with such id() will not be stored by profiler during profile session
explicit BaseBlockDescriptor(block_id_t _id, EasyBlockStatus _status, int _line, block_type_t _block_type, color_t _color) EASY_NOEXCEPT;
public:
BaseBlockDescriptor() = delete;
inline block_id_t id() const EASY_NOEXCEPT { return m_id; }
inline int32_t line() const EASY_NOEXCEPT { return m_line; }
inline color_t color() const EASY_NOEXCEPT { return m_color; }
inline block_type_t type() const EASY_NOEXCEPT { return m_type; }
inline EasyBlockStatus status() const EASY_NOEXCEPT { return m_status; }
}; // END of class BaseBlockDescriptor.
//***********************************************
class PROFILER_API Event
{
friend ::ProfileManager;
protected:
timestamp_t m_begin;
timestamp_t m_end;
public:
Event() = delete;
Event(const Event&) = default;
explicit Event(timestamp_t _begin_time) EASY_NOEXCEPT;
explicit Event(timestamp_t _begin_time, timestamp_t _end_time) EASY_NOEXCEPT;
inline timestamp_t begin() const EASY_NOEXCEPT { return m_begin; }
inline timestamp_t end() const EASY_NOEXCEPT { return m_end; }
inline timestamp_t duration() const EASY_NOEXCEPT { return m_end - m_begin; }
}; // END class Event.
class PROFILER_API BaseBlockData : public Event
{
friend ::ProfileManager;
protected:
block_id_t m_id;
public:
BaseBlockData() = delete;
BaseBlockData(const BaseBlockData&) = default;
explicit BaseBlockData(timestamp_t _begin_time, block_id_t _id) EASY_NOEXCEPT;
explicit BaseBlockData(timestamp_t _begin_time, timestamp_t _end_time, block_id_t _id) EASY_NOEXCEPT;
inline block_id_t id() const EASY_NOEXCEPT { return m_id; }
inline void setId(block_id_t _id) EASY_NOEXCEPT { m_id = _id; }
}; // END of class BaseBlockData.
#pragma pack(pop)
//***********************************************
class PROFILER_API Block : public BaseBlockData
{
friend ::ProfileManager;
friend ::ThreadStorage;
friend ::NonscopedBlock;
const char* m_name;
EasyBlockStatus m_status;
bool m_isScoped;
private:
void start();
void start(timestamp_t _time) EASY_NOEXCEPT;
void finish();
void finish(timestamp_t _time) EASY_NOEXCEPT;
inline bool finished() const EASY_NOEXCEPT { return m_end >= m_begin; }
inline EasyBlockStatus status() const EASY_NOEXCEPT { return m_status; }
inline void setStatus(EasyBlockStatus _status) EASY_NOEXCEPT { m_status = _status; }
public:
Block(const Block&) = delete;
Block& operator = (const Block&) = delete;
Block(Block&& that) EASY_NOEXCEPT;
Block(const BaseBlockDescriptor* _desc, const char* _runtimeName, bool _scoped = true) EASY_NOEXCEPT;
Block(timestamp_t _begin_time, block_id_t _id, const char* _runtimeName) EASY_NOEXCEPT;
Block(timestamp_t _begin_time, timestamp_t _end_time, block_id_t _id, const char* _runtimeName) EASY_NOEXCEPT;
~Block();
inline const char* name() const EASY_NOEXCEPT { return m_name; }
}; // END of class Block.
//***********************************************
class PROFILER_API ThreadGuard EASY_FINAL
{
friend ::ProfileManager;
thread_id_t m_id = 0;
public:
~ThreadGuard();
}; // END of class ThreadGuard.
} // END of namespace profiler.
#endif // EASY_PROFILER_PUBLIC_TYPES_H

View File

@ -0,0 +1,161 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_NET_H
#define EASY_NET_H
#include <easy/details/easy_compiler_support.h>
#include <stdint.h>
namespace profiler { namespace net {
EASY_CONSTEXPR uint32_t EASY_MESSAGE_SIGN = 20160909;
#pragma pack(push,1)
enum class MessageType : uint8_t
{
Undefined = 0,
Request_Start_Capture,
Reply_Capturing_Started,
Request_Stop_Capture,
Reply_Blocks,
Reply_Blocks_End,
Connection_Accepted,
Request_Blocks_Description,
Reply_Blocks_Description,
Reply_Blocks_Description_End,
Change_Block_Status,
Change_Event_Tracing_Status,
Change_Event_Tracing_Priority,
Ping,
Request_MainThread_FPS,
Reply_MainThread_FPS,
};
struct Message
{
uint32_t magic_number = EASY_MESSAGE_SIGN;
MessageType type = MessageType::Undefined;
bool isEasyNetMessage() const EASY_NOEXCEPT {
return EASY_MESSAGE_SIGN == magic_number;
}
explicit Message(MessageType _t) EASY_NOEXCEPT : type(_t) { }
Message() = default;
};
struct DataMessage : public Message
{
uint32_t size = 0; // bytes
explicit DataMessage(MessageType _t = MessageType::Reply_Blocks) : Message(_t) {}
explicit DataMessage(uint32_t _s, MessageType _t = MessageType::Reply_Blocks) : Message(_t), size(_s) {}
const char* data() const { return reinterpret_cast<const char*>(this) + sizeof(DataMessage); }
};
struct BlockStatusMessage : public Message
{
uint32_t id;
uint8_t status;
explicit BlockStatusMessage(uint32_t _id, uint8_t _status)
: Message(MessageType::Change_Block_Status), id(_id), status(_status) { }
BlockStatusMessage() = delete;
};
struct EasyProfilerStatus : public Message
{
bool isProfilerEnabled;
bool isEventTracingEnabled;
bool isLowPriorityEventTracing;
explicit EasyProfilerStatus(bool _enabled, bool _ETenabled, bool _ETlowp)
: Message(MessageType::Connection_Accepted)
, isProfilerEnabled(_enabled)
, isEventTracingEnabled(_ETenabled)
, isLowPriorityEventTracing(_ETlowp)
{
}
EasyProfilerStatus() = delete;
};
struct BoolMessage : public Message
{
bool flag = false;
explicit BoolMessage(MessageType _t, bool _flag = false)
: Message(_t), flag(_flag) { }
BoolMessage() = default;
};
struct TimestampMessage : public Message
{
uint32_t maxValue = 0;
uint32_t avgValue = 0;
explicit TimestampMessage(MessageType _t, uint32_t _maxValue, uint32_t _avgValue)
: Message(_t), maxValue(_maxValue), avgValue(_avgValue) { }
TimestampMessage() = default;
};
#pragma pack(pop)
}//net
}//profiler
#endif // EASY_NET_H

View File

@ -0,0 +1,130 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_SOCKET_H
#define EASY_PROFILER_SOCKET_H
#include <stdint.h>
#include <easy/details/easy_compiler_support.h>
#ifndef _WIN32
// Unix
# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
# include <stdio.h>
# include <unistd.h>
# include <fcntl.h>
# include <netinet/in.h> //for android-build
#else
// Windows
# define WIN32_LEAN_AND_MEAN
# include <winsock2.h>
# include <windows.h>
# include <ws2tcpip.h>
# include <stdlib.h>
#endif
class PROFILER_API EasySocket EASY_FINAL
{
public:
#ifdef _WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
#endif
enum class ConnectionState : int8_t
{
Disconnected = -1,
Unknown,
Connected,
Connecting
};
private:
socket_t m_socket = 0;
socket_t m_replySocket = 0;
int m_wsaret = -1;
struct hostent* m_server = nullptr;
struct sockaddr_in m_serverAddress;
ConnectionState m_state = ConnectionState::Unknown;
public:
EasySocket();
~EasySocket();
void setReceiveTimeout(int milliseconds);
int send(const void* buf, size_t nbyte);
int receive(void* buf, size_t nbyte);
int listen(int count = 5);
int accept();
int bind(uint16_t portno);
bool setAddress(const char* serv, uint16_t port);
int connect();
void flush();
void init();
ConnectionState state() const;
bool isDisconnected() const;
bool isConnected() const;
private:
void checkResult(int result);
bool checkSocket(socket_t s) const;
void setBlocking(socket_t s, bool blocking);
}; // end of class EasySocket.
#endif // EASY_PROFILER_SOCKET_H

View File

@ -0,0 +1,910 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_H
#define EASY_PROFILER_H
#include <easy/details/profiler_public_types.h>
#if defined ( __clang__ )
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
//
// BUILD_WITH_EASY_PROFILER is defined in CMakeLists.txt if your project is linked to easy_profiler.
//
//
// DISABLE_EASY_PROFILER may be defined manually in source-file before #include <easy/profiler.h>
// to disable profiler for certain source-file or project.
//
#if defined(BUILD_WITH_EASY_PROFILER) && !defined(DISABLE_EASY_PROFILER)
/**
\defgroup profiler EasyProfiler
*/
/** Indicates that EasyProfiler is used.
\ingroup profiler
*/
#define USING_EASY_PROFILER
// EasyProfiler core API:
/** Macro for beginning of a scoped block with custom name and color.
\code
#include <easy/profiler.h>
void foo()
{
// some code ...
EASY_BLOCK("Check something", profiler::OFF); // Disabled block (There is possibility to enable this block later via GUI)
if(something){
EASY_BLOCK("Calling bar()"); // Block with default color
bar();
}
else{
EASY_BLOCK("Calling baz()", profiler::colors::Red); // Red block
baz();
}
EASY_END_BLOCK; // End of "Check something" block (Even if "Check something" is disabled, this EASY_END_BLOCK will not end any other block).
EASY_BLOCK("Some another block", profiler::colors::Blue, profiler::ON_WITHOUT_CHILDREN); // Block with Blue color without
// some another code...
EASY_BLOCK("Calculate sum"); // This block will not be profiled because it's parent is ON_WITHOUT_CHILDREN
int sum = 0;
for (int i = 0; i < 10; ++i)
sum += i;
EASY_END_BLOCK; // End of "Calculate sum" block
}
\endcode
Block will be automatically completed by destructor.
\ingroup profiler
*/
# define EASY_BLOCK(name, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name), __FILE__, __LINE__, ::profiler::BlockType::Block, ::profiler::extract_color(__VA_ARGS__),\
::std::is_base_of<::profiler::ForceConstStr, decltype(name)>::value));\
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));\
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__));
/** Macro for beginning of a non-scoped block with custom name and color.
You must end such block manually with EASY_END_BLOCK.
\code
#include <easy/profiler.h>
void foo() {
EASY_NONSCOPED_BLOCK("Callback"); // Begin block which would not be finished when function returns.
// some code ...
}
void bar() {
// some another code...
EASY_END_BLOCK; // This, as always, ends last opened block. You have to take care about blocks order by yourself.
}
void baz() {
foo(); // non-scoped block begins here
// some code...
bar(); // non-scoped block ends here
}
\endcode
Block will be automatically completed by destructor.
\ingroup profiler
*/
#define EASY_NONSCOPED_BLOCK(name, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name), __FILE__, __LINE__, ::profiler::BlockType::Block, ::profiler::extract_color(__VA_ARGS__),\
::std::is_base_of<::profiler::ForceConstStr, decltype(name)>::value));\
::profiler::beginNonScopedBlock(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));
/** Macro for beginning of a block with function name and custom color.
\code
#include <easy/profiler.h>
void foo(){
EASY_FUNCTION(); // Block with name="foo" and default color
//some code...
}
void bar(){
EASY_FUNCTION(profiler::colors::Green); // Green block with name="bar"
//some code...
}
void baz(){
EASY_FUNCTION(profiler::FORCE_ON); // Force enabled block with name="baz" and default color (This block will be profiled even if it's parent is OFF_RECURSIVE)
// som code...
}
\endcode
Name of the block automatically created with function name.
\ingroup profiler
*/
# define EASY_FUNCTION(...) EASY_BLOCK(EASY_FUNC_NAME, ## __VA_ARGS__)
/** Macro for completion of last opened block explicitly.
\code
#include <easy/profiler.h>
int foo()
{
// some code ...
int sum = 0;
EASY_BLOCK("Calculating sum");
for (int i = 0; i < 10; ++i){
sum += i;
}
EASY_END_BLOCK;
// some antoher code here ...
return sum;
}
\endcode
\ingroup profiler
*/
# define EASY_END_BLOCK ::profiler::endBlock();
/** Macro for creating event marker with custom name and color.
Event marker is a block with zero duration and special type.
\warning Event marker ends immidiately and calling EASY_END_BLOCK after EASY_EVENT
will end previously opened EASY_BLOCK or EASY_FUNCTION.
\ingroup profiler
*/
# define EASY_EVENT(name, ...)\
EASY_LOCAL_STATIC_PTR(const ::profiler::BaseBlockDescriptor*, EASY_UNIQUE_DESC(__LINE__), ::profiler::registerDescription(\
::profiler::extract_enable_flag(__VA_ARGS__), EASY_UNIQUE_LINE_ID, EASY_COMPILETIME_NAME(name),\
__FILE__, __LINE__, ::profiler::BlockType::Event, ::profiler::extract_color(__VA_ARGS__),\
::std::is_base_of<::profiler::ForceConstStr, decltype(name)>::value));\
::profiler::storeEvent(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));
/** Macro for enabling profiler.
\ingroup profiler
*/
# define EASY_PROFILER_ENABLE ::profiler::setEnabled(true);
/** Macro for disabling profiler.
\ingroup profiler
*/
# define EASY_PROFILER_DISABLE ::profiler::setEnabled(false);
/** Macro for current thread registration.
\note If this thread has been already registered then nothing happens.
\ingroup profiler
*/
# define EASY_THREAD(name)\
EASY_THREAD_LOCAL static const char* EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__) = 0;\
if (!EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__))\
EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__) = ::profiler::registerThread(name);
/** Macro for current thread registration and creating a thread guard object.
\note If this thread has been already registered then nothing happens.
\note Also creates thread guard which marks thread as "expired" on it's destructor
and creates "ThreadFinished" profiler event.
\ingroup profiler
*/
# define EASY_THREAD_SCOPE(name)\
EASY_THREAD_LOCAL static const char* EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__) = 0;\
::profiler::ThreadGuard EASY_TOKEN_CONCATENATE(unique_profiler_thread_guard, __LINE__);\
if (!EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__))\
EASY_TOKEN_CONCATENATE(unique_profiler_thread_name, __LINE__) = ::profiler::registerThreadScoped(name,\
EASY_TOKEN_CONCATENATE(unique_profiler_thread_guard, __LINE__));
/** Macro for main thread registration.
This is just for user's comfort. There is no difference for EasyProfiler GUI between different threads.
\ingroup profiler
*/
# define EASY_MAIN_THREAD EASY_THREAD("Main")
/** Enable or disable event tracing (context switch events).
\note Default value is controlled by EASY_OPTION_EVENT_TRACING_ENABLED macro.
\note Change will take effect on the next call to EASY_PROFILER_ENABLE.
\sa EASY_PROFILER_ENABLE, EASY_OPTION_EVENT_TRACING_ENABLED
\ingroup profiler
*/
# define EASY_SET_EVENT_TRACING_ENABLED(isEnabled) ::profiler::setEventTracingEnabled(isEnabled);
/** Set event tracing thread priority (low or normal).
Event tracing with low priority will affect your application performance much more less, but
it can be late to gather information about thread/process (thread could be finished to the moment
when event tracing thread will be awaken) and you will not see process name and process id
information in GUI for such threads. You will still be able to see all context switch events.
Event tracing with normal priority could gather more information about processes but potentially
it could affect performance as it has more work to do. Usually you will not notice any performance
breakdown, but if you care about that then you change set event tracing priority level to low.
\sa EASY_OPTION_LOW_PRIORITY_EVENT_TRACING
\ingroup profiler
*/
# define EASY_SET_LOW_PRIORITY_EVENT_TRACING(isLowPriority) ::profiler::setLowPriorityEventTracing(isLowPriority);
/** Macro for setting temporary log-file path for Unix event tracing system.
\note Default value is "/tmp/cs_profiling_info.log".
\ingroup profiler
*/
# define EASY_EVENT_TRACING_SET_LOG(filename) ::profiler::setContextSwitchLogFilename(filename);
/** Macro returning current path to the temporary log-file for Unix event tracing system.
\ingroup profiler
*/
# define EASY_EVENT_TRACING_LOG ::profiler::getContextSwitchLogFilename();
// EasyProfiler settings:
/** If != 0 then EasyProfiler will measure time for blocks storage expansion.
If 0 then EasyProfiler will be compiled without blocks of code responsible
for measuring these events.
These are "EasyProfiler.ExpandStorage" blocks on a diagram.
\ingroup profiler
*/
# ifndef EASY_OPTION_MEASURE_STORAGE_EXPAND
# define EASY_OPTION_MEASURE_STORAGE_EXPAND 0
# endif
# if EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
/** If true then "EasyProfiler.ExpandStorage" blocks are enabled by default and will be
writed to output file or translated over the net.
If false then you need to enable these blocks via GUI if you want to see them.
\ingroup profiler
*/
# ifndef EASY_OPTION_STORAGE_EXPAND_BLOCKS_ON
# define EASY_OPTION_STORAGE_EXPAND_BLOCKS_ON true
# endif
# endif // EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
/** If true then EasyProfiler event tracing is enabled by default
and will be turned on and off when you call profiler::setEnabled().
Otherwise, it have to be turned on via GUI and then it will be
turned on/off with next calls of profiler::setEnabled().
\ingroup profiler
*/
# ifndef EASY_OPTION_EVENT_TRACING_ENABLED
# define EASY_OPTION_EVENT_TRACING_ENABLED true
# endif
/** If true then EasyProfiler.ETW thread (Event tracing for Windows) will have low priority by default.
\sa EASY_SET_LOW_PRIORITY_EVENT_TRACING
\note You can always change priority level via GUI or API while profiling session is not launched.
You don't need to rebuild or restart your application for that.
\ingroup profiler
*/
# ifndef EASY_OPTION_LOW_PRIORITY_EVENT_TRACING
# define EASY_OPTION_LOW_PRIORITY_EVENT_TRACING true
# endif
/** If != 0 then EasyProfiler will print error messages into stderr.
Otherwise, no log messages will be printed.
\ingroup profiler
*/
# ifndef EASY_OPTION_LOG_ENABLED
# define EASY_OPTION_LOG_ENABLED 0
# endif
/** If != 0 then EasyProfiler will start listening thread immidiately on ProfileManager initialization.
\sa startListen
\ingroup profiler
*/
# ifndef EASY_OPTION_START_LISTEN_ON_STARTUP
# define EASY_OPTION_START_LISTEN_ON_STARTUP 0
# endif
#else // #ifdef BUILD_WITH_EASY_PROFILER
# define EASY_BLOCK(...)
# define EASY_NONSCOPED_BLOCK(...)
# define EASY_FUNCTION(...)
# define EASY_END_BLOCK
# define EASY_PROFILER_ENABLE
# define EASY_PROFILER_DISABLE
# define EASY_EVENT(...)
# define EASY_THREAD(...)
# define EASY_THREAD_SCOPE(...)
# define EASY_MAIN_THREAD
# define EASY_SET_EVENT_TRACING_ENABLED(isEnabled)
# define EASY_SET_LOW_PRIORITY_EVENT_TRACING(isLowPriority)
# ifndef _WIN32
# define EASY_EVENT_TRACING_SET_LOG(filename)
# define EASY_EVENT_TRACING_LOG ""
# endif
# ifndef EASY_OPTION_MEASURE_STORAGE_EXPAND
# define EASY_OPTION_MEASURE_STORAGE_EXPAND 0
# endif
# ifndef EASY_OPTION_EVENT_TRACING_ENABLED
# define EASY_OPTION_EVENT_TRACING_ENABLED false
# endif
# ifndef EASY_OPTION_LOW_PRIORITY_EVENT_TRACING
# define EASY_OPTION_LOW_PRIORITY_EVENT_TRACING true
# endif
# ifndef EASY_OPTION_LOG_ENABLED
# define EASY_OPTION_LOG_ENABLED 0
# endif
# ifndef EASY_OPTION_START_LISTEN_ON_STARTUP
# define EASY_OPTION_START_LISTEN_ON_STARTUP 0
# endif
#endif // #ifndef BUILD_WITH_EASY_PROFILER
# ifndef EASY_DEFAULT_PORT
# define EASY_DEFAULT_PORT 28077
# endif
/** Alias for EASY_PROFILER_ENABLE.
Added for clarification.
\sa EASY_PROFILER_ENABLE
\ingroup profiler
*/
#define EASY_START_CAPTURE EASY_PROFILER_ENABLE
/** Alias for EASY_PROFILER_DISABLE.
Added for clarification.
\sa EASY_PROFILER_DISABLE
\ingroup profiler
*/
#define EASY_STOP_CAPTURE EASY_PROFILER_DISABLE
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
namespace profiler {
EASY_CONSTEXPR uint16_t DEFAULT_PORT = EASY_DEFAULT_PORT;
//////////////////////////////////////////////////////////////////////
// Core API
// Note: It is better to use macros defined above than a direct calls to API.
// But some API functions does not have macro wrappers...
#ifdef USING_EASY_PROFILER
extern "C" {
/** Returns current time in ticks.
You can use it if you want to store block explicitly.
\retval Current CPU time in ticks.
\ingroup profiler
*/
PROFILER_API timestamp_t currentTime();
/** Convert ticks to nanoseconds.
\retval _ticks converted to nanoseconds.
\ingroup profiler
*/
PROFILER_API timestamp_t toNanoseconds(timestamp_t _ticks);
/** Convert ticks to microseconds.
\retval _ticks converted to microseconds.
\ingroup profiler
*/
PROFILER_API timestamp_t toMicroseconds(timestamp_t _ticks);
/** Registers static description of a block.
It is general information which is common for all such blocks.
Includes color, block type (see BlockType), file-name, line-number, compile-time name of a block and enable-flag.
\note This API function is used by EASY_EVENT, EASY_BLOCK, EASY_FUNCTION macros.
There is no need to invoke this function explicitly.
\retval Pointer to registered block description.
\ingroup profiler
*/
PROFILER_API const BaseBlockDescriptor* registerDescription(EasyBlockStatus _status, const char* _autogenUniqueId, const char* _compiletimeName, const char* _filename, int _line, block_type_t _block_type, color_t _color, bool _copyName = false);
/** Stores event in the blocks list.
An event ends instantly and has zero duration.
\note There is no need to invoke this function explicitly - use EASY_EVENT macro instead.
\param _desc Reference to the previously registered description.
\param _runtimeName Standard zero-terminated string which will be copied to the events buffer.
\note _runtimeName must be an empty string ("") if you do not want to set name to the event at run-time.
\ingroup profiler
*/
PROFILER_API void storeEvent(const BaseBlockDescriptor* _desc, const char* _runtimeName = "");
/** Stores block explicitly in the blocks list.
Use this function for additional flexibility if you want to set block duration manually.
\param _desc Reference to the previously registered description.
\param _runtimeName Standard zero-terminated string which will be copied to the events buffer.
\param _beginTime begin time of the block
\param _endTime end time of the block
\note _runtimeName must be an empty string ("") if you do not want to set name to the block at run-time.
\ingroup profiler
*/
PROFILER_API void storeBlock(const BaseBlockDescriptor* _desc, const char* _runtimeName, timestamp_t _beginTime, timestamp_t _endTime);
/** Begins scoped block.
\ingroup profiler
*/
PROFILER_API void beginBlock(Block& _block);
/** Begins non-scoped block.
\param _desc Reference to the previously registered description (see registerDescription).
\param _runtimeName Standard zero-terminated string which will be copied to the block buffer when block will end.
\note There is no need to invoke this function explicitly - use EASY_NONSCOPED_BLOCK macro instead.
EASY_NONSCOPED_BLOCK macro could be used for higher flexibility if you have to begin block in one
function and end it in another one.
\note _runtimeName must be an empty string ("") if you do not want to set name to the block at run-time.
\note _runtimeName is copied only when block ends so you must ensure it's validity until block end.
\warning You have to end this block explicitly.
\ingroup profiler
*/
PROFILER_API void beginNonScopedBlock(const BaseBlockDescriptor* _desc, const char* _runtimeName = "");
/** Ends last started block.
Use this only if you want to finish block explicitly.
\ingroup profiler
*/
PROFILER_API void endBlock();
/** Enable or disable profiler.
AKA start or stop profiling (capturing blocks).
\ingroup profiler
*/
PROFILER_API void setEnabled(bool _isEnable);
PROFILER_API bool isEnabled();
/** Save all gathered blocks into file.
\note This also disables profiler.
\retval Number of saved blocks. If 0 then nothing was profiled or an error occured.
\ingroup profiler
*/
PROFILER_API uint32_t dumpBlocksToFile(const char* _filename);
/** Register current thread and give it a name.
Also creates a scoped ThreadGuard which would unregister thread on it's destructor.
This helps for memory management while using an old compiler whitout thread_local support.
\note Only first call of registerThread() for the current thread will have an effect.
\note Use this function if you want to build your source code with an old compiler (MSVC < 2013, GCC < 4.8, Clang < 3.3).
Otherwise there is no need in this function because a thread_local ThreadGuard created inside.
\retval Registered name of the thread. It may differ from _name if the thread was registered before.
\sa registerThread, ThreadGuard
\ingroup profiler
*/
PROFILER_API const char* registerThreadScoped(const char* _name, ThreadGuard&);
/** Register current thread and give it a name.
\note Only first call of registerThread() for the current thread will have an effect.
\retval Registered name of the thread. It may differ from _name if the thread was registered before.
\ingroup profiler
*/
PROFILER_API const char* registerThread(const char* _name);
/** Enable or disable event tracing.
\note This change will take an effect on the next call of setEnabled(true);
\sa setEnabled, EASY_SET_EVENT_TRACING_ENABLED
\ingroup profiler
*/
PROFILER_API void setEventTracingEnabled(bool _isEnable);
PROFILER_API bool isEventTracingEnabled();
/** Set event tracing thread priority (low or normal).
\note This change will take effect on the next call of setEnabled(true);
\sa setEnabled, EASY_SET_LOW_PRIORITY_EVENT_TRACING
\ingroup profiler
*/
PROFILER_API void setLowPriorityEventTracing(bool _isLowPriority);
PROFILER_API bool isLowPriorityEventTracing();
/** Set temporary log-file path for Unix event tracing system.
\note Default value is "/tmp/cs_profiling_info.log".
\ingroup profiler
*/
PROFILER_API void setContextSwitchLogFilename(const char* _name);
/** Returns current path to the temporary log-file for Unix event tracing system.
\ingroup profiler
*/
PROFILER_API const char* getContextSwitchLogFilename();
/** Start listening for network commands.
Launches a separate listening thread which would listen to the network commands (start, stop, etc.).
The listening thread sends all profiled blocks via network after receiving network command 'stop'.
\ingroup profiler
*/
PROFILER_API void startListen(uint16_t _port = ::profiler::DEFAULT_PORT);
/** Stops listening thread.
\note This would be invoked automatically on application exit.
\note Does not send any messages to the network, just stops thread.
\ingroup profiler
*/
PROFILER_API void stopListen();
/** Check if listening thread launched.
\ingroup profiler
*/
PROFILER_API bool isListening();
/** Returns current major version.
\ingroup profiler
*/
PROFILER_API uint8_t versionMajor();
/** Returns current minor version.
\ingroup profiler
*/
PROFILER_API uint8_t versionMinor();
/** Returns current version patch.
\ingroup profiler
*/
PROFILER_API uint16_t versionPatch();
/** Returns current version in 32-bit integer format.
\note Format is: 0x MAJ-MAJ MIN-MIN PATCH-PATCH-PATCH-PATCH
For example v1.3.0 is: 0x01030000
\ingroup profiler
*/
PROFILER_API uint32_t version();
/** Returns current version string.
Example: "v1.3.0"
\ingroup profiler
*/
PROFILER_API const char* versionName();
/** Returns true if current thread has been marked as Main.
Otherwise, returns false.
\ingroup profiler
*/
PROFILER_API bool isMainThread();
/** Returns last frame duration for current thread.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t this_thread_frameTime(Duration _durationCast = ::profiler::MICROSECONDS);
/** Returns local max of frame duration for current thread.
Local max is maximum frame duration since last frameTimeLocalMax() call.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t this_thread_frameTimeLocalMax(Duration _durationCast = ::profiler::MICROSECONDS);
/** Returns local average of frame duration for current thread.
Local average is average frame duration since last frameTimeLocalAvg() call.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t this_thread_frameTimeLocalAvg(Duration _durationCast = ::profiler::MICROSECONDS);
/** Returns last frame duration for main thread.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t main_thread_frameTime(Duration _durationCast = ::profiler::MICROSECONDS);
/** Returns local max of frame duration for main thread.
Local max is maximum frame duration since last frameTimeLocalMax() call.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t main_thread_frameTimeLocalMax(Duration _durationCast = ::profiler::MICROSECONDS);
/** Returns local average of frame duration for main thread.
Local average is average frame duration since last frameTimeLocalAvg() call.
\param _durationCast desired duration units (could be cpu-ticks or microseconds)
\ingroup profiler
*/
PROFILER_API timestamp_t main_thread_frameTimeLocalAvg(Duration _durationCast = ::profiler::MICROSECONDS);
}
#else
inline timestamp_t currentTime() { return 0; }
inline timestamp_t toNanoseconds(timestamp_t) { return 0; }
inline timestamp_t toMicroseconds(timestamp_t) { return 0; }
inline const BaseBlockDescriptor* registerDescription(EasyBlockStatus, const char*, const char*, const char*, int, block_type_t, color_t, bool = false)
{ return reinterpret_cast<const BaseBlockDescriptor*>(0xbad); }
inline void endBlock() { }
inline void setEnabled(bool) { }
inline bool isEnabled() { return false; }
inline void storeEvent(const BaseBlockDescriptor*, const char* = "") { }
inline void storeBlock(const BaseBlockDescriptor*, const char*, timestamp_t, timestamp_t) { }
inline void beginBlock(Block&) { }
inline void beginNonScopedBlock(const BaseBlockDescriptor*, const char* = "") { }
inline uint32_t dumpBlocksToFile(const char*) { return 0; }
inline const char* registerThreadScoped(const char*, ThreadGuard&) { return ""; }
inline const char* registerThread(const char*) { return ""; }
inline void setEventTracingEnabled(bool) { }
inline bool isEventTracingEnabled() { return false; }
inline void setLowPriorityEventTracing(bool) { }
inline bool isLowPriorityEventTracing() { return false; }
inline void setContextSwitchLogFilename(const char*) { }
inline const char* getContextSwitchLogFilename() { return ""; }
inline void startListen(uint16_t = ::profiler::DEFAULT_PORT) { }
inline void stopListen() { }
inline bool isListening() { return false; }
inline uint8_t versionMajor() { return 0; }
inline uint8_t versionMinor() { return 0; }
inline uint16_t versionPatch() { return 0; }
inline uint32_t version() { return 0; }
inline const char* versionName() { return "v0.0.0_disabled"; }
inline bool isMainThread() { return false; }
inline timestamp_t this_thread_frameTime(Duration = ::profiler::MICROSECONDS) { return 0; }
inline timestamp_t this_thread_frameTimeLocalMax(Duration = ::profiler::MICROSECONDS) { return 0; }
inline timestamp_t this_thread_frameTimeLocalAvg(Duration = ::profiler::MICROSECONDS) { return 0; }
inline timestamp_t main_thread_frameTime(Duration = ::profiler::MICROSECONDS) { return 0; }
inline timestamp_t main_thread_frameTimeLocalMax(Duration = ::profiler::MICROSECONDS) { return 0; }
inline timestamp_t main_thread_frameTimeLocalAvg(Duration = ::profiler::MICROSECONDS) { return 0; }
#endif
/** API functions binded to current thread.
\ingroup profiler
*/
namespace this_thread {
inline const char* registrate(const char* _name) {
return ::profiler::registerThread(_name);
}
inline const char* registrate(const char* _name, ThreadGuard& _threadGuard) {
return ::profiler::registerThreadScoped(_name, _threadGuard);
}
inline timestamp_t frameTime(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::this_thread_frameTime(_durationCast);
}
inline timestamp_t frameTimeLocalMax(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::this_thread_frameTimeLocalMax(_durationCast);
}
inline timestamp_t frameTimeLocalAvg(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::this_thread_frameTimeLocalAvg(_durationCast);
}
inline bool isMain() {
return ::profiler::isMainThread();
}
} // END of namespace this_thread.
/** API functions binded to main thread.
Could be called from any thread.
\ingroup profiler
*/
namespace main_thread {
inline timestamp_t frameTime(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::main_thread_frameTime(_durationCast);
}
inline timestamp_t frameTimeLocalMax(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::main_thread_frameTimeLocalMax(_durationCast);
}
inline timestamp_t frameTimeLocalAvg(Duration _durationCast = ::profiler::MICROSECONDS) {
return ::profiler::main_thread_frameTimeLocalAvg(_durationCast);
}
/** Always returns true.
*/
inline EASY_CONSTEXPR_FCN bool isMain() {
return true;
}
} // END of namespace main_thread.
/** Alias for isEnabled().
Added for clarification.
\sa isEnabled
\ingroup profiler
*/
EASY_FORCE_INLINE bool isCapturing() { return isEnabled(); }
/** Alias for EASY_PROFILER_ENABLE.
Added for clarification.
\sa EASY_PROFILER_ENABLE
\ingroup profiler
*/
EASY_FORCE_INLINE void startCapture() { EASY_PROFILER_ENABLE; }
/** Alias for EASY_PROFILER_DISABLE.
Added for clarification.
\sa EASY_PROFILER_DISABLE
\ingroup profiler
*/
EASY_FORCE_INLINE void stopCapture() { EASY_PROFILER_DISABLE; }
//////////////////////////////////////////////////////////////////////
} // END of namespace profiler.
#if defined ( __clang__ )
# pragma clang diagnostic pop
#endif
#endif // EASY_PROFILER_H

View File

@ -0,0 +1,428 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef PROFILER_READER____H
#define PROFILER_READER____H
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <easy/serialized_block.h>
#include <easy/details/arbitrary_value_public_types.h>
#include <easy/utility.h>
#include <unordered_map>
#include <vector>
#include <string>
#include <atomic>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace profiler {
using calls_number_t = uint32_t;
using block_index_t = uint32_t;
#pragma pack(push, 1)
struct BlockStatistics EASY_FINAL
{
::profiler::timestamp_t total_duration; ///< Total duration of all block calls
::profiler::timestamp_t total_children_duration; ///< Total duration of all children of all block calls
::profiler::block_index_t min_duration_block; ///< Will be used in GUI to jump to the block with min duration
::profiler::block_index_t max_duration_block; ///< Will be used in GUI to jump to the block with max duration
::profiler::block_index_t parent_block; ///< Index of block which is "parent" for "per_parent_stats" or "frame" for "per_frame_stats" or thread-id for "per_thread_stats"
::profiler::calls_number_t calls_number; ///< Block calls number
explicit BlockStatistics(::profiler::timestamp_t _duration, ::profiler::block_index_t _block_index, ::profiler::block_index_t _parent_index)
: total_duration(_duration)
, total_children_duration(0)
, min_duration_block(_block_index)
, max_duration_block(_block_index)
, parent_block(_parent_index)
, calls_number(1)
{
}
//BlockStatistics() = default;
inline ::profiler::timestamp_t average_duration() const
{
return total_duration / calls_number;
}
}; // END of struct BlockStatistics.
#pragma pack(pop)
extern "C" PROFILER_API void release_stats(BlockStatistics*& _stats);
//////////////////////////////////////////////////////////////////////////
class BlocksTree EASY_FINAL
{
using This = BlocksTree;
public:
using blocks_t = ::std::vector<This>;
using children_t = ::std::vector<::profiler::block_index_t>;
children_t children; ///< List of children blocks. May be empty.
union {
::profiler::SerializedBlock* node; ///< Pointer to serialized data for regular block (id, name, begin, end etc.)
::profiler::SerializedCSwitch* cs; ///< Pointer to serialized data for context switch (thread_id, name, begin, end etc.)
::profiler::ArbitraryValue* value; ///< Pointer to serialized data for arbitrary value
};
::profiler::BlockStatistics* per_parent_stats; ///< Pointer to statistics for this block within the parent (may be nullptr for top-level blocks)
::profiler::BlockStatistics* per_frame_stats; ///< Pointer to statistics for this block within the frame (may be nullptr for top-level blocks)
::profiler::BlockStatistics* per_thread_stats; ///< Pointer to statistics for this block within the bounds of all frames per current thread
uint8_t depth; ///< Maximum number of sublevels (maximum children depth)
BlocksTree(const This&) = delete;
This& operator = (const This&) = delete;
BlocksTree() EASY_NOEXCEPT
: node(nullptr)
, per_parent_stats(nullptr)
, per_frame_stats(nullptr)
, per_thread_stats(nullptr)
, depth(0)
{
}
BlocksTree(This&& that) EASY_NOEXCEPT
: BlocksTree()
{
make_move(::std::forward<This&&>(that));
}
This& operator = (This&& that) EASY_NOEXCEPT
{
make_move(::std::forward<This&&>(that));
return *this;
}
~BlocksTree() EASY_NOEXCEPT
{
release_stats(per_thread_stats);
release_stats(per_parent_stats);
release_stats(per_frame_stats);
}
bool operator < (const This& other) const EASY_NOEXCEPT
{
if (node == nullptr || other.node == nullptr)
return false;
return node->begin() < other.node->begin();
}
void shrink_to_fit() EASY_NOEXCEPT
{
//for (auto& child : children)
// child.shrink_to_fit();
// shrink version 1:
//children.shrink_to_fit();
// shrink version 2:
//children_t new_children;
//new_children.reserve(children.size());
//::std::move(children.begin(), children.end(), ::std::back_inserter(new_children));
//new_children.swap(children);
}
private:
void make_move(This&& that) EASY_NOEXCEPT
{
if (per_thread_stats != that.per_thread_stats)
release_stats(per_thread_stats);
if (per_parent_stats != that.per_parent_stats)
release_stats(per_parent_stats);
if (per_frame_stats != that.per_frame_stats)
release_stats(per_frame_stats);
children = ::std::move(that.children);
node = that.node;
per_parent_stats = that.per_parent_stats;
per_frame_stats = that.per_frame_stats;
per_thread_stats = that.per_thread_stats;
depth = that.depth;
that.node = nullptr;
that.per_parent_stats = nullptr;
that.per_frame_stats = nullptr;
that.per_thread_stats = nullptr;
}
}; // END of class BlocksTree.
//////////////////////////////////////////////////////////////////////////
class BlocksTreeRoot EASY_FINAL
{
using This = BlocksTreeRoot;
public:
BlocksTree::children_t children; ///< List of children indexes
BlocksTree::children_t sync; ///< List of context-switch events
BlocksTree::children_t events; ///< List of events indexes
std::string thread_name; ///< Name of this thread
::profiler::timestamp_t profiled_time; ///< Profiled time of this thread (sum of all children duration)
::profiler::timestamp_t wait_time; ///< Wait time of this thread (sum of all context switches)
::profiler::thread_id_t thread_id; ///< System Id of this thread
::profiler::block_index_t frames_number; ///< Total frames number (top-level blocks)
::profiler::block_index_t blocks_number; ///< Total blocks number including their children
uint8_t depth; ///< Maximum stack depth (number of levels)
BlocksTreeRoot(const This&) = delete;
This& operator = (const This&) = delete;
BlocksTreeRoot() EASY_NOEXCEPT
: profiled_time(0), wait_time(0), thread_id(0), frames_number(0), blocks_number(0), depth(0)
{
}
BlocksTreeRoot(This&& that) EASY_NOEXCEPT
: children(::std::move(that.children))
, sync(::std::move(that.sync))
, events(::std::move(that.events))
, thread_name(::std::move(that.thread_name))
, profiled_time(that.profiled_time)
, wait_time(that.wait_time)
, thread_id(that.thread_id)
, frames_number(that.frames_number)
, blocks_number(that.blocks_number)
, depth(that.depth)
{
}
This& operator = (This&& that) EASY_NOEXCEPT
{
children = ::std::move(that.children);
sync = ::std::move(that.sync);
events = ::std::move(that.events);
thread_name = ::std::move(that.thread_name);
profiled_time = that.profiled_time;
wait_time = that.wait_time;
thread_id = that.thread_id;
frames_number = that.frames_number;
blocks_number = that.blocks_number;
depth = that.depth;
return *this;
}
inline bool got_name() const EASY_NOEXCEPT
{
return !thread_name.empty();
}
inline const char* name() const EASY_NOEXCEPT
{
return thread_name.c_str();
}
bool operator < (const This& other) const EASY_NOEXCEPT
{
return thread_id < other.thread_id;
}
}; // END of class BlocksTreeRoot.
using blocks_t = ::profiler::BlocksTree::blocks_t;
using thread_blocks_tree_t = ::std::unordered_map<::profiler::thread_id_t, ::profiler::BlocksTreeRoot, ::estd::hash<::profiler::thread_id_t> >;
//////////////////////////////////////////////////////////////////////////
class PROFILER_API SerializedData EASY_FINAL
{
char* m_data;
size_t m_size;
public:
SerializedData(const SerializedData&) = delete;
SerializedData& operator = (const SerializedData&) = delete;
SerializedData() : m_data(nullptr), m_size(0)
{
}
SerializedData(SerializedData&& that) : m_data(that.m_data), m_size(that.m_size)
{
that.m_data = nullptr;
that.m_size = 0;
}
~SerializedData()
{
clear();
}
void set(uint64_t _size);
void extend(uint64_t _size);
SerializedData& operator = (SerializedData&& that)
{
set(that.m_data, that.m_size);
that.m_data = nullptr;
that.m_size = 0;
return *this;
}
char* operator [] (uint64_t i)
{
return m_data + i;
}
const char* operator [] (uint64_t i) const
{
return m_data + i;
}
bool empty() const
{
return m_size == 0;
}
uint64_t size() const
{
return m_size;
}
char* data()
{
return m_data;
}
const char* data() const
{
return m_data;
}
void clear()
{
set(nullptr, 0);
}
void swap(SerializedData& other)
{
char* d = other.m_data;
uint64_t sz = other.m_size;
other.m_data = m_data;
other.m_size = m_size;
m_data = d;
m_size = (size_t)sz;
}
private:
void set(char* _data, uint64_t _size);
}; // END of class SerializedData.
//////////////////////////////////////////////////////////////////////////
using descriptors_list_t = ::std::vector<SerializedBlockDescriptor*>;
} // END of namespace profiler.
extern "C" {
PROFILER_API ::profiler::block_index_t fillTreesFromFile(::std::atomic<int>& progress, const char* filename,
::profiler::SerializedData& serialized_blocks,
::profiler::SerializedData& serialized_descriptors,
::profiler::descriptors_list_t& descriptors,
::profiler::blocks_t& _blocks,
::profiler::thread_blocks_tree_t& threaded_trees,
uint32_t& total_descriptors_number,
uint32_t& version,
bool gather_statistics,
::std::stringstream& _log);
PROFILER_API ::profiler::block_index_t fillTreesFromStream(::std::atomic<int>& progress, ::std::stringstream& str,
::profiler::SerializedData& serialized_blocks,
::profiler::SerializedData& serialized_descriptors,
::profiler::descriptors_list_t& descriptors,
::profiler::blocks_t& _blocks,
::profiler::thread_blocks_tree_t& threaded_trees,
uint32_t& total_descriptors_number,
uint32_t& version,
bool gather_statistics,
::std::stringstream& _log);
PROFILER_API bool readDescriptionsFromStream(::std::atomic<int>& progress, ::std::stringstream& str,
::profiler::SerializedData& serialized_descriptors,
::profiler::descriptors_list_t& descriptors,
::std::stringstream& _log);
}
inline ::profiler::block_index_t fillTreesFromFile(const char* filename, ::profiler::SerializedData& serialized_blocks,
::profiler::SerializedData& serialized_descriptors,
::profiler::descriptors_list_t& descriptors, ::profiler::blocks_t& _blocks,
::profiler::thread_blocks_tree_t& threaded_trees,
uint32_t& total_descriptors_number,
uint32_t& version,
bool gather_statistics,
::std::stringstream& _log)
{
::std::atomic<int> progress = ATOMIC_VAR_INIT(0);
return fillTreesFromFile(progress, filename, serialized_blocks, serialized_descriptors, descriptors, _blocks, threaded_trees, total_descriptors_number, version, gather_statistics, _log);
}
inline bool readDescriptionsFromStream(::std::stringstream& str,
::profiler::SerializedData& serialized_descriptors,
::profiler::descriptors_list_t& descriptors,
::std::stringstream& _log)
{
::std::atomic<int> progress = ATOMIC_VAR_INIT(0);
return readDescriptionsFromStream(progress, str, serialized_descriptors, descriptors, _log);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // PROFILER_READER____H

View File

@ -0,0 +1,289 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_SERIALIZED_BLOCK_H
#define EASY_PROFILER_SERIALIZED_BLOCK_H
#include <easy/details/profiler_public_types.h>
#include <easy/details/arbitrary_value_public_types.h>
class CSwitchBlock;
namespace profiler {
template <DataType dataType, bool isArray>
struct Value;
template <bool isArray>
struct Value<DataType::TypesCount, isArray>;
//////////////////////////////////////////////////////////////////////////
class PROFILER_API SerializedBlock EASY_FINAL : public BaseBlockData
{
friend ::ProfileManager;
friend ::ThreadStorage;
public:
inline const char* data() const { return reinterpret_cast<const char*>(this); }
///< Run-time block name is stored right after main BaseBlockData data
inline const char* name() const { return data() + sizeof(BaseBlockData); }
SerializedBlock(const SerializedBlock&) = delete;
SerializedBlock& operator = (const SerializedBlock&) = delete;
SerializedBlock(SerializedBlock&&) = delete;
SerializedBlock& operator = (SerializedBlock&&) = delete;
~SerializedBlock() = delete;
private:
explicit SerializedBlock(const Block& block, uint16_t name_length);
}; // END of SerializedBlock.
//////////////////////////////////////////////////////////////////////////
#pragma pack(push, 1)
class PROFILER_API CSwitchEvent : public Event
{
thread_id_t m_thread_id;
public:
CSwitchEvent() = default;
CSwitchEvent(const CSwitchEvent&) = default;
explicit CSwitchEvent(timestamp_t _begin_time, thread_id_t _tid) EASY_NOEXCEPT;
inline thread_id_t tid() const EASY_NOEXCEPT { return m_thread_id; }
}; // END of class CSwitchEvent.
#pragma pack(pop)
class PROFILER_API SerializedCSwitch EASY_FINAL : public CSwitchEvent
{
friend ::ProfileManager;
friend ::ThreadStorage;
public:
inline const char* data() const { return reinterpret_cast<const char*>(this); }
///< Run-time block name is stored right after main CSwitchEvent data
inline const char* name() const { return data() + sizeof(CSwitchEvent); }
SerializedCSwitch(const SerializedCSwitch&) = delete;
SerializedCSwitch& operator = (const SerializedCSwitch&) = delete;
SerializedCSwitch(SerializedCSwitch&&) = delete;
SerializedCSwitch& operator = (SerializedCSwitch&&) = delete;
~SerializedCSwitch() = delete;
private:
explicit SerializedCSwitch(const CSwitchBlock& block, uint16_t name_length);
}; // END of SerializedCSwitch.
//////////////////////////////////////////////////////////////////////////
#pragma pack(push, 1)
class PROFILER_API SerializedBlockDescriptor EASY_FINAL : public BaseBlockDescriptor
{
uint16_t m_nameLength; ///< Length of the name including trailing '\0' sybmol
public:
inline const char* data() const {
return reinterpret_cast<const char*>(this);
}
///< Name is stored right after m_nameLength
inline const char* name() const {
static const auto shift = sizeof(BaseBlockDescriptor) + sizeof(decltype(m_nameLength));
return data() + shift;
}
///< File name is stored right after the name
inline const char* file() const {
return name() + m_nameLength;
}
inline void setStatus(EasyBlockStatus _status) EASY_NOEXCEPT {
m_status = _status;
}
// Instances of this class can not be created or destroyed directly
SerializedBlockDescriptor() = delete;
SerializedBlockDescriptor(const SerializedBlockDescriptor&) = delete;
SerializedBlockDescriptor& operator = (const SerializedBlockDescriptor&) = delete;
SerializedBlockDescriptor(SerializedBlockDescriptor&&) = delete;
SerializedBlockDescriptor& operator = (SerializedBlockDescriptor&&) = delete;
~SerializedBlockDescriptor() = delete;
}; // END of SerializedBlockDescriptor.
//#pragma pack(pop)
//////////////////////////////////////////////////////////////////////////
//#pragma pack(push, 1)
class PROFILER_API ArbitraryValue : protected BaseBlockData
{
friend ::ThreadStorage;
protected:
char m_nameStub; ///< Artificial padding which is used to imitate SerializedBlock::name() == 0 behavior
char m_padding; ///< Padding to the bound of 2 bytes
uint16_t m_size;
DataType m_type;
bool m_isArray;
vin_t m_value_id;
explicit ArbitraryValue(timestamp_t _timestamp, vin_t _vin, block_id_t _id,
uint16_t _size, DataType _type, bool _isArray)
: BaseBlockData(_timestamp, _timestamp, _id)
, m_nameStub(0)
, m_padding(0)
, m_size(_size)
, m_type(_type)
, m_isArray(_isArray)
, m_value_id(_vin)
{
}
public:
using BaseBlockData::id;
using Event::begin;
~ArbitraryValue() = delete;
const char* data() const {
return reinterpret_cast<const char*>(this) + sizeof(ArbitraryValue);
}
vin_t value_id() const {
return m_value_id;
}
DataType type() const {
return m_type;
}
bool isArray() const {
return m_isArray;
}
template <DataType dataType>
const Value<dataType, false>* toValue() const {
return m_type == dataType ? static_cast<const Value<dataType, false>*>(this) : nullptr;
}
template <class T>
const Value<StdToDataType<T>::data_type, false>* toValue() const {
static_assert(StdToDataType<T>::data_type != DataType::TypesCount,
"You should use standard builtin scalar types as profiler::Value type!");
return toValue<StdToDataType<T>::data_type>();
}
template <DataType dataType>
const Value<dataType, true>* toArray() const {
return m_isArray && m_type == dataType ? static_cast<const Value<dataType, true>*>(this) : nullptr;
}
template <class T>
const Value<StdToDataType<T>::data_type, true>* toArray() const {
static_assert(StdToDataType<T>::data_type != DataType::TypesCount,
"You should use standard builtin scalar types as profiler::Value type!");
return toArray<StdToDataType<T>::data_type>();
}
}; // end of class ArbitraryValue.
#pragma pack(pop)
//////////////////////////////////////////////////////////////////////////
template <DataType dataType>
struct Value<dataType, false> EASY_FINAL : public ArbitraryValue {
using value_type = typename StdType<dataType>::value_type;
value_type value() const { return *reinterpret_cast<const value_type*>(data()); }
~Value() = delete;
};
template <DataType dataType>
struct Value<dataType, true> EASY_FINAL : public ArbitraryValue {
using value_type = typename StdType<dataType>::value_type;
const value_type* value() const { return reinterpret_cast<const value_type*>(data()); }
uint16_t size() const { return m_size / sizeof(value_type); }
value_type operator [] (int i) const { return value()[i]; }
value_type at(int i) const { return value()[i]; }
~Value() = delete;
};
template <>
struct Value<DataType::String, true> EASY_FINAL : public ArbitraryValue {
using value_type = char;
const char* value() const { return data(); }
uint16_t size() const { return m_size; }
char operator [] (int i) const { return data()[i]; }
char at(int i) const { return data()[i]; }
const char* c_str() const { return data(); }
~Value() = delete;
};
//////////////////////////////////////////////////////////////////////////
template <DataType dataType>
using SingleValue = Value<dataType, false>;
template <DataType dataType>
using ArrayValue = Value<dataType, true>;
using StringValue = Value<DataType::String, true>;
//////////////////////////////////////////////////////////////////////////
} // END of namespace profiler.
#endif // EASY_PROFILER_SERIALIZED_BLOCK_H

View File

@ -0,0 +1,63 @@
#ifndef EASY_PROFILER_UTILITY_H
#define EASY_PROFILER_UTILITY_H
#include <easy/details/easy_compiler_support.h>
#include <algorithm>
#include <utility>
#include <math.h>
namespace estd {
//////////////////////////////////////////////////////////////////////////
namespace detail {
template <class T, bool BiggerThanPtr> struct hasher {
using type = const T&;
EASY_FORCE_INLINE size_t operator () (type value) const { return ::std::hash<T> {}(value); } };
template <class T> struct hasher<T, false> {
using type = T;
EASY_FORCE_INLINE size_t operator () (type value) const { return static_cast<size_t>(value); } };
}
template <class T> struct hash EASY_FINAL : public ::estd::detail::hasher<T, (sizeof(T) > sizeof(void*))> {
using ::estd::detail::hasher<T, (sizeof(T) > sizeof(void*))>::operator();
};
template <class T> struct hash<T*> EASY_FINAL {
EASY_FORCE_INLINE size_t operator () (const T* value) const { return reinterpret_cast<size_t>(value); } };
template <class T> struct hash<const T*> EASY_FINAL {
EASY_FORCE_INLINE size_t operator () (const T* value) const { return reinterpret_cast<size_t>(value); } };
//////////////////////////////////////////////////////////////////////////
template <class T, class Q, class W>
inline EASY_CONSTEXPR_FCN Q clamp(T min_value, Q value, W max_value) {
return static_cast<Q>(min_value < value ? (value < max_value ? value : max_value) : min_value);
}
template <class T>
EASY_FORCE_INLINE EASY_CONSTEXPR_FCN T sqr(T value) {
return value * value;
}
template <class T>
EASY_FORCE_INLINE EASY_CONSTEXPR_FCN int sign(T value) { return value < 0 ? -1 : 1; }
template <class T>
inline EASY_CONSTEXPR_FCN T absmin(T a, T b) { return abs(a) < abs(b) ? a : b; }
template <int N, class T>
inline T logn(T value) {
EASY_STATIC_CONSTEXPR double div = 1.0 / log2((double)N);
return log2(value) * div;
}
//////////////////////////////////////////////////////////////////////////
} // end of namespace estd.
#endif // EASY_PROFILER_UTILITY_H

View File

@ -0,0 +1,92 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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 "nonscoped_block.h"
#include <cstring>
#include <cstdlib>
NonscopedBlock::NonscopedBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, bool)
: profiler::Block(_desc, _runtimeName, false), m_runtimeName(nullptr)
{
}
NonscopedBlock::~NonscopedBlock()
{
// Actually destructor should not be invoked because StackBuffer do manual memory management
m_end = m_begin; // to restrict profiler::Block to invoke profiler::endBlock() on destructor.
free(m_runtimeName);
}
void NonscopedBlock::copyname()
{
// Here we need to copy m_name to m_runtimeName to ensure that
// it would be alive to the moment we will serialize the block
if ((m_status & profiler::ON) == 0)
return;
if (*m_name != 0)
{
auto len = strlen(m_name);
m_runtimeName = static_cast<char*>(malloc(len + 1));
// memcpy should be faster than strncpy because we know
// actual bytes number and both strings have the same size
memcpy(m_runtimeName, m_name, len);
m_runtimeName[len] = 0;
m_name = m_runtimeName;
}
else
{
m_name = "";
}
}
void NonscopedBlock::destroy()
{
// free memory used by m_runtimeName
free(m_runtimeName);
m_name = "";
}

View File

@ -0,0 +1,73 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_NONSCOPED_BLOCK_H
#define EASY_PROFILER_NONSCOPED_BLOCK_H
#include <easy/details/profiler_public_types.h>
class NonscopedBlock : public profiler::Block
{
char* m_runtimeName; ///< A copy of _runtimeName to make it safe to begin block in one function and end it in another
public:
NonscopedBlock() = delete;
NonscopedBlock(const NonscopedBlock&) = delete;
NonscopedBlock(NonscopedBlock&&) = delete;
NonscopedBlock& operator = (const NonscopedBlock&) = delete;
NonscopedBlock& operator = (NonscopedBlock&&) = delete;
NonscopedBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, bool = false);
~NonscopedBlock();
/** Copy string from m_name to m_runtimeName to make it safe to end block in another function.
Performs any work if block is ON and m_name != ""
*/
void copyname();
void destroy();
}; // END of class NonscopedBlock.
#endif // EASY_PROFILER_NONSCOPED_BLOCK_H

View File

@ -0,0 +1,115 @@
/************************************************************************
* file name : outstream.h
* ----------------- :
* creation time : 2016/09/11
* authors : Sergey Yagovtsev, Victor Zarubkin
* emails : yse.sey@gmail.com, v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains definition of output stream helpers.
* ----------------- :
* change log : * 2016/09/11 Victor Zarubkin: Initial commit. Moved sources from profiler_manager.h/.cpp
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER__OUTPUT_STREAM__H_
#define EASY_PROFILER__OUTPUT_STREAM__H_
#include <sstream>
#include <string.h>
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
namespace profiler {
class OStream
{
::std::stringstream m_stream;
public:
explicit OStream() : m_stream(std::ios_base::out | std::ios_base::binary)
{
}
template <typename T> void write(const char* _data, T _size)
{
m_stream.write(_data, _size);
}
template <class T> void write(const T& _data)
{
m_stream.write((const char*)&_data, sizeof(T));
}
::std::stringstream& stream()
{
return m_stream;
}
const ::std::stringstream& stream() const
{
return m_stream;
}
void clear()
{
#if defined(__GNUC__) && __GNUC__ < 5
// gcc 4 has a known bug which has been solved in gcc 5:
// std::stringstream has no swap() method :(
m_stream.str(::std::string());
#else
::std::stringstream().swap(m_stream);
#endif
}
}; // END of class OStream.
} // END of namespace profiler.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER__OUTPUT_STREAM__H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,211 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_MANAGER_H
#define EASY_PROFILER_MANAGER_H
#include <easy/details/profiler_public_types.h>
#ifdef _WIN32
// Do not move this include to other place!
// It should be included before Windows.h which is included in spin_lock.h
# include <easy/easy_socket.h>
#endif // _WIN32
#include "spin_lock.h"
#include "outstream.h"
#include "hashed_cstr.h"
#include "thread_storage.h"
#include <map>
#include <vector>
#include <unordered_map>
#include <thread>
#include <atomic>
#include <type_traits>
//////////////////////////////////////////////////////////////////////////
typedef uint64_t processid_t;
class BlockDescriptor;
namespace profiler { class ValueId; }
class ProfileManager
{
#ifndef EASY_MAGIC_STATIC_AVAILABLE
friend class ProfileManagerInstance;
#endif
ProfileManager();
typedef profiler::guard_lock<profiler::spin_lock> guard_lock_t;
typedef std::map<profiler::thread_id_t, ThreadStorage> map_of_threads_stacks;
typedef std::vector<BlockDescriptor*> block_descriptors_t;
#ifdef EASY_PROFILER_HASHED_CSTR_DEFINED
typedef std::unordered_map<profiler::hashed_cstr, profiler::block_id_t> descriptors_map_t;
#else
typedef std::unordered_map<profiler::hashed_stdstring, profiler::block_id_t> descriptors_map_t;
#endif
const processid_t m_processId;
map_of_threads_stacks m_threads;
block_descriptors_t m_descriptors;
descriptors_map_t m_descriptorsMap;
uint64_t m_usedMemorySize;
profiler::timestamp_t m_beginTime;
profiler::timestamp_t m_endTime;
std::atomic<profiler::timestamp_t> m_frameMax;
std::atomic<profiler::timestamp_t> m_frameAvg;
std::atomic<profiler::timestamp_t> m_frameCur;
profiler::spin_lock m_spin;
profiler::spin_lock m_storedSpin;
profiler::spin_lock m_dumpSpin;
std::atomic<profiler::thread_id_t> m_mainThreadId;
std::atomic<char> m_profilerStatus;
std::atomic_bool m_isEventTracingEnabled;
std::atomic_bool m_isAlreadyListening;
std::atomic_bool m_frameMaxReset;
std::atomic_bool m_frameAvgReset;
std::atomic_bool m_stopDumping;
std::string m_csInfoFilename = "/tmp/cs_profiling_info.log";
uint32_t dumpBlocksToStream(profiler::OStream& _outputStream, bool _lockSpin, bool _async);
void setBlockStatus(profiler::block_id_t _id, profiler::EasyBlockStatus _status);
std::thread m_listenThread;
void listen(uint16_t _port);
std::atomic_bool m_stopListen;
public:
ProfileManager(const ProfileManager&) = delete;
ProfileManager(ProfileManager&&) = delete;
ProfileManager& operator = (const ProfileManager&) = delete;
ProfileManager& operator = (ProfileManager&&) = delete;
static ProfileManager& instance();
~ProfileManager();
const profiler::BaseBlockDescriptor* addBlockDescriptor(profiler::EasyBlockStatus _defaultStatus,
const char* _autogenUniqueId,
const char* _name,
const char* _filename,
int _line,
profiler::block_type_t _block_type,
profiler::color_t _color,
bool _copyName = false);
void storeValue(const profiler::BaseBlockDescriptor* _desc, profiler::DataType _type, const void* _data, size_t _size, bool _isArray, profiler::ValueId _vin);
bool storeBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName);
bool storeBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, profiler::timestamp_t _beginTime, profiler::timestamp_t _endTime);
void beginBlock(profiler::Block& _block);
void beginNonScopedBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName);
void endBlock();
profiler::timestamp_t maxFrameDuration();
profiler::timestamp_t avgFrameDuration();
profiler::timestamp_t curFrameDuration() const;
void setEnabled(bool isEnable);
bool isEnabled() const;
void setEventTracingEnabled(bool _isEnable);
bool isEventTracingEnabled() const;
uint32_t dumpBlocksToFile(const char* filename);
const char* registerThread(const char* name, profiler::ThreadGuard& threadGuard);
const char* registerThread(const char* name);
void setContextSwitchLogFilename(const char* name)
{
m_csInfoFilename = name;
}
const char* getContextSwitchLogFilename() const
{
return m_csInfoFilename.c_str();
}
void beginContextSwitch(profiler::thread_id_t _thread_id, profiler::timestamp_t _time, profiler::thread_id_t _target_thread_id, const char* _target_process, bool _lockSpin = true);
void endContextSwitch(profiler::thread_id_t _thread_id, processid_t _process_id, profiler::timestamp_t _endtime, bool _lockSpin = true);
void startListen(uint16_t _port);
void stopListen();
bool isListening() const;
private:
void registerThread();
void beginFrame();
void endFrame();
void enableEventTracer();
void disableEventTracer();
static char checkThreadExpired(ThreadStorage& _registeredThread);
void storeBlockForce(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, ::profiler::timestamp_t& _timestamp);
void storeBlockForce2(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, ::profiler::timestamp_t _timestamp);
void storeBlockForce2(ThreadStorage& _registeredThread, const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, ::profiler::timestamp_t _timestamp);
ThreadStorage& _threadStorage(profiler::thread_id_t _thread_id);
ThreadStorage* _findThreadStorage(profiler::thread_id_t _thread_id);
inline ThreadStorage& threadStorage(profiler::thread_id_t _thread_id)
{
guard_lock_t lock(m_spin);
return _threadStorage(_thread_id);
}
inline ThreadStorage* findThreadStorage(profiler::thread_id_t _thread_id)
{
guard_lock_t lock(m_spin);
return _findThreadStorage(_thread_id);
}
}; // END of class ProfileManager.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_MANAGER_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
1 VERSIONINFO
# define EASY_STRINGIFY(a) #a
# define EASY_STRINGIFICATION(a) EASY_STRINGIFY(a)
#define EASY_PROFILER_PRODUCT_VERSION "v" EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MAJOR) "." \
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MINOR) "." \
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_PATCH)
FILEVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
PRODUCTVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "EasySolutions"
VALUE "FileDescription", "Lightweight profiler library for c++"
VALUE "LegalCopyright", "Copyright (C) 2016-2017 Victor Zarubkin, Sergey Yagovtsev"
VALUE "LegalTrademarks1", "All Rights Reserved"
VALUE "LegalTrademarks2", "All Rights Reserved"
VALUE "ProductName", "easy_profiler lib"
VALUE "ProductVersion", EASY_PROFILER_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1200
END
END

View File

@ -0,0 +1,126 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_SPIN_LOCK_H
#define EASY_PROFILER_SPIN_LOCK_H
#define EASY_USE_CRITICAL_SECTION // Use CRITICAL_SECTION instead of std::atomic_flag
#if defined(_WIN32) && defined(EASY_USE_CRITICAL_SECTION)
#include <Windows.h>
#else
#include <atomic>
#endif
namespace profiler {
#if defined(_WIN32) && defined(EASY_USE_CRITICAL_SECTION)
// std::atomic_flag on Windows works slower than critical section, so we will use it instead of std::atomic_flag...
// By the way, Windows critical sections are slower than std::atomic_flag on Unix.
class spin_lock { CRITICAL_SECTION m_lock; public:
void lock() {
EnterCriticalSection(&m_lock);
}
void unlock() {
LeaveCriticalSection(&m_lock);
}
spin_lock() {
InitializeCriticalSection(&m_lock);
}
~spin_lock() {
DeleteCriticalSection(&m_lock);
}
};
#else
// std::atomic_flag on Unix works fine and very fast (almost instant!)
class spin_lock { ::std::atomic_flag m_lock; public:
void lock() {
while (m_lock.test_and_set(::std::memory_order_acquire));
}
void unlock() {
m_lock.clear(::std::memory_order_release);
}
spin_lock() {
m_lock.clear();
}
};
#endif
template <class T>
class guard_lock
{
T& m_lock;
bool m_isLocked = false;
public:
explicit guard_lock(T& m) : m_lock(m) {
m_lock.lock();
m_isLocked = true;
}
~guard_lock() {
unlock();
}
inline void unlock() {
if (m_isLocked) {
m_lock.unlock();
m_isLocked = false;
}
}
};
} // END of namespace profiler.
#ifdef EASY_USE_CRITICAL_SECTION
# undef EASY_USE_CRITICAL_SECTION
#endif
#endif // EASY_PROFILER_SPIN_LOCK_H

View File

@ -0,0 +1,140 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_STACK_BUFFER_H
#define EASY_PROFILER_STACK_BUFFER_H
#include "nonscoped_block.h"
#include <list>
#include <algorithm>
#include <cstdlib>
#ifdef max
#undef max
#endif
template <class T>
inline void destroy_elem(T*)
{
}
inline void destroy_elem(NonscopedBlock* _elem)
{
_elem->destroy();
}
template <class T>
class StackBuffer
{
struct chunk { int8_t data[sizeof(T)]; };
std::list<chunk> m_overflow; ///< List of additional stack elements if current capacity of buffer is not enough
T* m_buffer; ///< Contiguous buffer used for stack
uint32_t m_size; ///< Current size of stack
uint32_t m_capacity; ///< Current capacity of m_buffer
uint32_t m_maxcapacity; ///< Maximum used capacity including m_buffer and m_overflow
public:
StackBuffer() = delete;
StackBuffer(const StackBuffer&) = delete;
StackBuffer(StackBuffer&&) = delete;
explicit StackBuffer(uint32_t N)
: m_buffer(static_cast<T*>(malloc(N * sizeof(T))))
, m_size(0)
, m_capacity(N)
, m_maxcapacity(N)
{
}
~StackBuffer()
{
for (uint32_t i = 0; i < m_size; ++i)
destroy_elem(m_buffer + i);
free(m_buffer);
for (auto& elem : m_overflow)
destroy_elem(reinterpret_cast<T*>(elem.data + 0));
}
template <class ... TArgs>
T& push(TArgs ... _args)
{
if (m_size < m_capacity)
return *(::new (m_buffer + m_size++) T(_args...));
m_overflow.emplace_back();
const uint32_t cap = m_capacity + static_cast<uint32_t>(m_overflow.size());
if (m_maxcapacity < cap)
m_maxcapacity = cap;
return *(::new (m_overflow.back().data + 0) T(_args...));
}
void pop()
{
if (m_overflow.empty())
{
// m_size should not be equal to 0 here because ProfileManager behavior does not allow such situation
destroy_elem(m_buffer + --m_size);
if (m_size == 0 && m_maxcapacity > m_capacity)
{
// When stack gone empty we can resize buffer to use enough space in the future
free(m_buffer);
m_maxcapacity = m_capacity = std::max(m_maxcapacity, m_capacity << 1);
m_buffer = static_cast<T*>(malloc(m_capacity * sizeof(T)));
}
return;
}
destroy_elem(reinterpret_cast<T*>(m_overflow.back().data + 0));
m_overflow.pop_back();
}
}; // END of class StackBuffer.
#endif // EASY_PROFILER_STACK_BUFFER_H

View File

@ -0,0 +1,157 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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 "thread_storage.h"
#include "current_thread.h"
#include "current_time.h"
ThreadStorage::ThreadStorage()
: nonscopedBlocks(16)
, frameStartTime(0)
, id(getCurrentThreadId())
, stackSize(0)
, allowChildren(true)
, named(false)
, guarded(false)
, frameOpened(false)
, halt(false)
{
expired = ATOMIC_VAR_INIT(0);
profiledFrameOpened = ATOMIC_VAR_INIT(false);
}
void ThreadStorage::storeValue(profiler::timestamp_t _timestamp, profiler::block_id_t _id, profiler::DataType _type, const void* _data, size_t _size, bool _isArray, profiler::ValueId _vin)
{
const uint16_t serializedDataSize = static_cast<uint16_t>(sizeof(profiler::ArbitraryValue) + _size);
void* data = blocks.closedList.allocate(serializedDataSize);
::new (data) profiler::ArbitraryValue(_timestamp, _vin.m_id, _id, static_cast<uint16_t>(_size), _type, _isArray);
char* cdata = reinterpret_cast<char*>(data);
memcpy(cdata + sizeof(profiler::ArbitraryValue), _data, _size);
blocks.usedMemorySize += serializedDataSize;
}
void ThreadStorage::storeBlock(const profiler::Block& block)
{
#if EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
EASY_LOCAL_STATIC_PTR(const BaseBlockDescriptor*, desc, \
MANAGER.addBlockDescriptor(EASY_OPTION_STORAGE_EXPAND_BLOCKS_ON ? profiler::ON : profiler::OFF, EASY_UNIQUE_LINE_ID, "EasyProfiler.ExpandStorage", \
__FILE__, __LINE__, profiler::BlockType::Block, EASY_COLOR_INTERNAL_EVENT));
EASY_THREAD_LOCAL static profiler::timestamp_t beginTime = 0ULL;
EASY_THREAD_LOCAL static profiler::timestamp_t endTime = 0ULL;
#endif
uint16_t nameLength = static_cast<uint16_t>(strlen(block.name()));
uint16_t serializedDataSize = static_cast<uint16_t>(sizeof(profiler::BaseBlockData) + nameLength + 1);
#if EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
const bool expanded = (desc->m_status & profiler::ON) && blocks.closedList.need_expand(serializedDataSize);
if (expanded) beginTime = getCurrentTime();
#endif
void* data = blocks.closedList.allocate(serializedDataSize);
#if EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
if (expanded) endTime = getCurrentTime();
#endif
::new (data) profiler::SerializedBlock(block, nameLength);
blocks.usedMemorySize += serializedDataSize;
#if EASY_OPTION_MEASURE_STORAGE_EXPAND != 0
if (expanded)
{
profiler::Block b(beginTime, desc->id(), "");
b.finish(endTime);
serializedDataSize = static_cast<uint16_t>(sizeof(profiler::BaseBlockData) + 1);
data = blocks.closedList.allocate(serializedDataSize);
::new (data) profiler::SerializedBlock(b, 0);
blocks.usedMemorySize += serializedDataSize;
}
#endif
}
void ThreadStorage::storeCSwitch(const CSwitchBlock& block)
{
uint16_t nameLength = static_cast<uint16_t>(strlen(block.name()));
uint16_t serializedDataSize = static_cast<uint16_t>(sizeof(profiler::CSwitchEvent) + nameLength + 1);
void* data = sync.closedList.allocate(serializedDataSize);
::new (data) profiler::SerializedCSwitch(block, nameLength);
sync.usedMemorySize += serializedDataSize;
}
void ThreadStorage::clearClosed()
{
blocks.clearClosed();
sync.clearClosed();
}
void ThreadStorage::popSilent()
{
if (!blocks.openedList.empty())
{
profiler::Block& top = blocks.openedList.back();
top.m_end = top.m_begin;
if (!top.m_isScoped)
nonscopedBlocks.pop();
blocks.openedList.pop_back();
}
}
void ThreadStorage::beginFrame()
{
if (!frameOpened)
{
frameStartTime = getCurrentTime();
frameOpened = true;
}
}
profiler::timestamp_t ThreadStorage::endFrame()
{
frameOpened = false;
return getCurrentTime() - frameStartTime;
}

View File

@ -0,0 +1,134 @@
/**
Lightweight profiler library for c++
Copyright(C) 2016-2017 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.
**/
#ifndef EASY_PROFILER_THREAD_STORAGE_H
#define EASY_PROFILER_THREAD_STORAGE_H
#include <easy/details/profiler_public_types.h>
#include <easy/details/arbitrary_value_public_types.h>
#include <easy/serialized_block.h>
#include <vector>
#include <string>
#include <atomic>
#include <functional>
#include "stack_buffer.h"
#include "chunk_allocator.h"
//////////////////////////////////////////////////////////////////////////
template <class T, const uint16_t N>
struct BlocksList
{
BlocksList() = default;
std::vector<T> openedList;
chunk_allocator<N> closedList;
uint64_t usedMemorySize = 0;
void clearClosed() {
//closedList.clear();
usedMemorySize = 0;
}
private:
BlocksList(const BlocksList&) = delete;
BlocksList(BlocksList&&) = delete;
}; // END of struct BlocksList.
//////////////////////////////////////////////////////////////////////////
class CSwitchBlock : public profiler::CSwitchEvent
{
const char* m_name;
public:
CSwitchBlock(profiler::timestamp_t _begin_time, profiler::thread_id_t _tid, const char* _runtimeName) EASY_NOEXCEPT;
inline const char* name() const EASY_NOEXCEPT { return m_name; }
};
//////////////////////////////////////////////////////////////////////////
const uint16_t SIZEOF_BLOCK = sizeof(profiler::BaseBlockData) + 1 + sizeof(uint16_t); // SerializedBlock stores BaseBlockData + at least 1 character for name ('\0') + 2 bytes for size of serialized data
const uint16_t SIZEOF_CSWITCH = sizeof(profiler::CSwitchEvent) + 1 + sizeof(uint16_t); // SerializedCSwitch also stores additional 4 bytes to be able to save 64-bit thread_id
struct ThreadStorage EASY_FINAL
{
StackBuffer<NonscopedBlock> nonscopedBlocks;
BlocksList<std::reference_wrapper<profiler::Block>, SIZEOF_BLOCK * (uint16_t)128U> blocks;
BlocksList<CSwitchBlock, SIZEOF_CSWITCH * (uint16_t)128U> sync;
std::string name; ///< Thread name
profiler::timestamp_t frameStartTime; ///< Current frame start time. Used to calculate FPS.
const profiler::thread_id_t id; ///< Thread ID
std::atomic<char> expired; ///< Is thread expired
std::atomic_bool profiledFrameOpened; ///< Is new profiled frame opened (this is true when profiling is enabled and there is an opened frame) \sa frameOpened
int32_t stackSize; ///< Current thread stack depth. Used when switching profiler state to begin collecting blocks only when new frame would be opened.
bool allowChildren; ///< False if one of previously opened blocks has OFF_RECURSIVE or ON_WITHOUT_CHILDREN status
bool named; ///< True if thread name was set
bool guarded; ///< True if thread has been registered using ThreadGuard
bool frameOpened; ///< Is new frame opened (this does not depend on profiling status) \sa profiledFrameOpened
bool halt; ///< This is set to true when new frame started while dumping blocks. Used to restrict collecting blocks during dumping process.
void storeValue(profiler::timestamp_t _timestamp, profiler::block_id_t _id, profiler::DataType _type, const void* _data, size_t _size, bool _isArray, profiler::ValueId _vin);
void storeBlock(const profiler::Block& _block);
void storeCSwitch(const CSwitchBlock& _block);
void clearClosed();
void popSilent();
void beginFrame();
profiler::timestamp_t endFrame();
ThreadStorage();
private:
ThreadStorage(const ThreadStorage&) = delete;
ThreadStorage(ThreadStorage&&) = delete;
}; // END of struct ThreadStorage.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_THREAD_STORAGE_H

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/alex/Work/C++Projects/easyprofiler")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/alex/Work/C++Projects/easyprofiler")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1,59 @@
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_CXX
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/qrc_resources.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals_qobjects.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/main.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/profiler_gui_automoc.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o"
"/home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.cpp" "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o"
)
set(CMAKE_CXX_COMPILER_ID "GNU")
# Preprocessor definitions for this target.
set(CMAKE_TARGET_DEFINITIONS_CXX
"BUILD_WITH_EASY_PROFILER=1"
"EASY_DEFAULT_PORT=28077"
"EASY_PROFILER_VERSION_MAJOR=1"
"EASY_PROFILER_VERSION_MINOR=3"
"EASY_PROFILER_VERSION_PATCH=0"
"QT_CORE_LIB"
"QT_GUI_LIB"
"QT_NO_DEBUG"
"QT_WIDGETS_LIB"
)
# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
"profiler_gui"
"/home/alex/Work/Qt/5.8/gcc_64/include"
"/home/alex/Work/Qt/5.8/gcc_64/include/QtWidgets"
"/home/alex/Work/Qt/5.8/gcc_64/include/QtGui"
"/home/alex/Work/Qt/5.8/gcc_64/include/QtCore"
"/home/alex/Work/Qt/5.8/gcc_64/./mkspecs/linux-g++"
"easy_profiler_core/include"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
"/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/CMakeFiles/easy_profiler.dir/DependInfo.cmake"
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@ -0,0 +1,603 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/alex/Work/C++Projects/easyprofiler
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/alex/Work/C++Projects/easyprofiler
# Include any dependencies generated for this target.
include profiler_gui/CMakeFiles/profiler_gui.dir/depend.make
# Include the progress variables for this target.
include profiler_gui/CMakeFiles/profiler_gui.dir/progress.make
# Include the compile flags for this target's objects.
include profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o: profiler_gui/main.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/main.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/main.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main.cpp > CMakeFiles/profiler_gui.dir/main.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/main.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main.cpp -o CMakeFiles/profiler_gui.dir/main.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o: profiler_gui/arbitrary_value_inspector.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.cpp > CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.cpp -o CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o: profiler_gui/blocks_graphics_view.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.cpp > CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.cpp -o CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o: profiler_gui/blocks_tree_widget.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.cpp > CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.cpp -o CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o: profiler_gui/common_functions.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/common_functions.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/common_functions.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.cpp > CMakeFiles/profiler_gui.dir/common_functions.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/common_functions.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.cpp -o CMakeFiles/profiler_gui.dir/common_functions.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o: profiler_gui/descriptors_tree_widget.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.cpp > CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.cpp -o CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o: profiler_gui/easy_chronometer_item.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.cpp > CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.cpp -o CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o: profiler_gui/easy_frame_rate_viewer.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.cpp > CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.cpp -o CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o: profiler_gui/easy_graphics_item.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.cpp > CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.cpp -o CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o: profiler_gui/easy_graphics_scrollbar.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.cpp > CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.cpp -o CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o: profiler_gui/easy_qtimer.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.cpp > CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.cpp -o CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o: profiler_gui/globals.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/globals.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/globals.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.cpp > CMakeFiles/profiler_gui.dir/globals.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/globals.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.cpp -o CMakeFiles/profiler_gui.dir/globals.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o: profiler_gui/globals_qobjects.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_13) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals_qobjects.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals_qobjects.cpp > CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals_qobjects.cpp -o CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o: profiler_gui/main_window.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_14) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/main_window.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/main_window.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.cpp > CMakeFiles/profiler_gui.dir/main_window.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/main_window.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.cpp -o CMakeFiles/profiler_gui.dir/main_window.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o: profiler_gui/tree_widget_item.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_15) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.cpp > CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.cpp -o CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o: profiler_gui/tree_widget_loader.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_16) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.cpp > CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.cpp -o CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o: profiler_gui/treeview_first_column_delegate.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_17) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.cpp > CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.cpp -o CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o: profiler_gui/profiler_gui_automoc.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_18) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/profiler_gui_automoc.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/profiler_gui_automoc.cpp > CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/profiler_gui_automoc.cpp -o CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/flags.make
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o: profiler_gui/CMakeFiles/profiler_gui.dir/qrc_resources.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_19) "Building CXX object profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o -c /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/qrc_resources.cpp
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.i"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/qrc_resources.cpp > CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.i
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.s"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/qrc_resources.cpp -o CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.s
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.requires:
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.provides: profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.requires
$(MAKE) -f profiler_gui/CMakeFiles/profiler_gui.dir/build.make profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.provides.build
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.provides
profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.provides.build: profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o
# Object files for target profiler_gui
profiler_gui_OBJECTS = \
"CMakeFiles/profiler_gui.dir/main.cpp.o" \
"CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o" \
"CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o" \
"CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o" \
"CMakeFiles/profiler_gui.dir/common_functions.cpp.o" \
"CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o" \
"CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o" \
"CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o" \
"CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o" \
"CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o" \
"CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o" \
"CMakeFiles/profiler_gui.dir/globals.cpp.o" \
"CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o" \
"CMakeFiles/profiler_gui.dir/main_window.cpp.o" \
"CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o" \
"CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o" \
"CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o" \
"CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o" \
"CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o"
# External object files for target profiler_gui
profiler_gui_EXTERNAL_OBJECTS =
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/build.make
bin/profiler_gui: /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Widgets.so.5.8.0
bin/profiler_gui: bin/libeasy_profiler.so
bin/profiler_gui: /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Gui.so.5.8.0
bin/profiler_gui: /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Core.so.5.8.0
bin/profiler_gui: profiler_gui/CMakeFiles/profiler_gui.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_20) "Linking CXX executable ../bin/profiler_gui"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/profiler_gui.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
profiler_gui/CMakeFiles/profiler_gui.dir/build: bin/profiler_gui
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/build
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/main.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/common_functions.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/globals.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/main_window.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o.requires
profiler_gui/CMakeFiles/profiler_gui.dir/requires: profiler_gui/CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o.requires
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/requires
profiler_gui/CMakeFiles/profiler_gui.dir/clean:
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && $(CMAKE_COMMAND) -P CMakeFiles/profiler_gui.dir/cmake_clean.cmake
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/clean
profiler_gui/CMakeFiles/profiler_gui.dir/depend:
cd /home/alex/Work/C++Projects/easyprofiler && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/profiler_gui /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/profiler_gui /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : profiler_gui/CMakeFiles/profiler_gui.dir/depend

View File

@ -0,0 +1,30 @@
file(REMOVE_RECURSE
"profiler_gui_automoc.cpp"
"CMakeFiles/profiler_gui.dir/qrc_resources.cpp"
"CMakeFiles/profiler_gui.dir/main.cpp.o"
"CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o"
"CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o"
"CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o"
"CMakeFiles/profiler_gui.dir/common_functions.cpp.o"
"CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o"
"CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o"
"CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o"
"CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o"
"CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o"
"CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o"
"CMakeFiles/profiler_gui.dir/globals.cpp.o"
"CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o"
"CMakeFiles/profiler_gui.dir/main_window.cpp.o"
"CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o"
"CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o"
"CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o"
"CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o"
"CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o"
"../bin/profiler_gui.pdb"
"../bin/profiler_gui"
)
# Per-language clean rules from dependency scanning.
foreach(lang CXX)
include(CMakeFiles/profiler_gui.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

View File

@ -0,0 +1,2 @@
# Empty dependencies file for profiler_gui.
# This may be replaced when dependencies are built.

View File

@ -0,0 +1,10 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# compile CXX with /usr/bin/c++
CXX_FLAGS = -O3 -DNDEBUG -fPIC -DEASY_CHRONO_STEADY_CLOCK=0 -DEASY_CHRONO_HIGHRES_CLOCK=0 -DEASY_OPTION_START_LISTEN_ON_STARTUP=0 -DEASY_OPTION_MEASURE_STORAGE_EXPAND=0 -DEASY_OPTION_STORAGE_EXPAND_BLOCKS_ON=0 -DEASY_OPTION_IMPLICIT_THREAD_REGISTRATION=1 -DEASY_OPTION_REMOVE_EMPTY_UNGUARDED_THREADS=0 -DEASY_OPTION_LOG_ENABLED=0 -DEASY_OPTION_PRETTY_PRINT_FUNCTIONS=0 -DEASY_OPTION_BUILTIN_COLORS=1 -std=gnu++11 -std=gnu++11
CXX_DEFINES = -DBUILD_WITH_EASY_PROFILER=1 -DEASY_DEFAULT_PORT=28077 -DEASY_PROFILER_VERSION_MAJOR=1 -DEASY_PROFILER_VERSION_MINOR=3 -DEASY_PROFILER_VERSION_PATCH=0 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB
CXX_INCLUDES = -I/home/alex/Work/C++Projects/easyprofiler/profiler_gui -isystem /home/alex/Work/Qt/5.8/gcc_64/include -isystem /home/alex/Work/Qt/5.8/gcc_64/include/QtWidgets -isystem /home/alex/Work/Qt/5.8/gcc_64/include/QtGui -isystem /home/alex/Work/Qt/5.8/gcc_64/include/QtCore -isystem /home/alex/Work/Qt/5.8/gcc_64/./mkspecs/linux-g++ -I/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include

View File

@ -0,0 +1 @@
/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/profiler_gui.dir/main.cpp.o CMakeFiles/profiler_gui.dir/arbitrary_value_inspector.cpp.o CMakeFiles/profiler_gui.dir/blocks_graphics_view.cpp.o CMakeFiles/profiler_gui.dir/blocks_tree_widget.cpp.o CMakeFiles/profiler_gui.dir/common_functions.cpp.o CMakeFiles/profiler_gui.dir/descriptors_tree_widget.cpp.o CMakeFiles/profiler_gui.dir/easy_chronometer_item.cpp.o CMakeFiles/profiler_gui.dir/easy_frame_rate_viewer.cpp.o CMakeFiles/profiler_gui.dir/easy_graphics_item.cpp.o CMakeFiles/profiler_gui.dir/easy_graphics_scrollbar.cpp.o CMakeFiles/profiler_gui.dir/easy_qtimer.cpp.o CMakeFiles/profiler_gui.dir/globals.cpp.o CMakeFiles/profiler_gui.dir/globals_qobjects.cpp.o CMakeFiles/profiler_gui.dir/main_window.cpp.o CMakeFiles/profiler_gui.dir/tree_widget_item.cpp.o CMakeFiles/profiler_gui.dir/tree_widget_loader.cpp.o CMakeFiles/profiler_gui.dir/treeview_first_column_delegate.cpp.o CMakeFiles/profiler_gui.dir/profiler_gui_automoc.cpp.o CMakeFiles/profiler_gui.dir/CMakeFiles/profiler_gui.dir/qrc_resources.cpp.o -o ../bin/profiler_gui -rdynamic /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Widgets.so.5.8.0 ../bin/libeasy_profiler.so /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Gui.so.5.8.0 /home/alex/Work/Qt/5.8/gcc_64/lib/libQt5Core.so.5.8.0 -lpthread -Wl,-rpath,/home/alex/Work/Qt/5.8/gcc_64/lib:/home/alex/Work/C++Projects/easyprofiler/bin:

View File

@ -0,0 +1,21 @@
CMAKE_PROGRESS_1 = 9
CMAKE_PROGRESS_2 = 10
CMAKE_PROGRESS_3 = 11
CMAKE_PROGRESS_4 = 12
CMAKE_PROGRESS_5 = 13
CMAKE_PROGRESS_6 = 14
CMAKE_PROGRESS_7 = 15
CMAKE_PROGRESS_8 = 16
CMAKE_PROGRESS_9 = 17
CMAKE_PROGRESS_10 = 18
CMAKE_PROGRESS_11 = 19
CMAKE_PROGRESS_12 = 20
CMAKE_PROGRESS_13 = 21
CMAKE_PROGRESS_14 = 22
CMAKE_PROGRESS_15 = 23
CMAKE_PROGRESS_16 = 24
CMAKE_PROGRESS_17 = 25
CMAKE_PROGRESS_18 = 26
CMAKE_PROGRESS_19 = 27
CMAKE_PROGRESS_20 = 28

View File

@ -0,0 +1,29 @@
set(AM_SOURCES "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/main.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals_qobjects.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.cpp;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.cpp" )
set(AM_RCC_SOURCES "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/resources.qrc" )
set(AM_RCC_INPUTS "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/logo.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-up-hover.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/radio-indicator.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/settings.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/reload.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/open-folder2.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-up-disabled.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/statistics.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/lan_on.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/wifi.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/check-disabled.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/close-white.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/maximize-white-pressed.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/save.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/play.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/close-white-hover.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/collapse.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/reload-folder2.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/list.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/search-prev.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/off.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-down-disabled.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/radio-indicator-disabled.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/search-next.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-up.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/maximize-white.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/check.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/lan.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/maximize-white-hover.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/lan.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/minimize-white.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/stop.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/minimize-white-pressed.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/delete.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-down.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/wifi_on.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/lan_on.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/expand.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/close-white-pressed.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/arrow-down-hover.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/minimize-white-hover.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/images/default/statistics2.svg@list_sep@/home/alex/Work/C++Projects/easyprofiler/profiler_gui/themes/default.css")
set(AM_SKIP_MOC "" )
set(AM_SKIP_UIC )
set(AM_HEADERS "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/arbitrary_value_inspector.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_graphics_view.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/blocks_tree_widget.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_functions.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/common_types.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/descriptors_tree_widget.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_chronometer_item.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_frame_rate_viewer.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_item.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_graphics_scrollbar.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/easy_qtimer.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/globals.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/main_window.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_item.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/tree_widget_loader.h;/home/alex/Work/C++Projects/easyprofiler/profiler_gui/treeview_first_column_delegate.h" )
set(AM_MOC_COMPILE_DEFINITIONS "BUILD_WITH_EASY_PROFILER=1;EASY_DEFAULT_PORT=28077;EASY_PROFILER_VERSION_MAJOR=1;EASY_PROFILER_VERSION_MINOR=3;EASY_PROFILER_VERSION_PATCH=0;QT_CORE_LIB;QT_GUI_LIB;QT_NO_DEBUG;QT_WIDGETS_LIB")
set(AM_MOC_INCLUDES "/home/alex/Work/C++Projects/easyprofiler/profiler_gui;/home/alex/Work/Qt/5.8/gcc_64/include;/home/alex/Work/Qt/5.8/gcc_64/include/QtWidgets;/home/alex/Work/Qt/5.8/gcc_64/include/QtGui;/home/alex/Work/Qt/5.8/gcc_64/include/QtCore;/home/alex/Work/Qt/5.8/gcc_64/./mkspecs/linux-g++;/home/alex/Work/C++Projects/easyprofiler/easy_profiler_core/include;/usr/include")
set(AM_MOC_OPTIONS "")
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "")
set(AM_CMAKE_BINARY_DIR "/home/alex/Work/C++Projects/easyprofiler/")
set(AM_CMAKE_SOURCE_DIR "/home/alex/Work/C++Projects/easyprofiler/")
set(AM_QT_MOC_EXECUTABLE "/home/alex/Work/Qt/5.8/gcc_64/bin/moc")
set(AM_QT_UIC_EXECUTABLE "")
set(AM_QT_RCC_EXECUTABLE "/home/alex/Work/Qt/5.8/gcc_64/bin/rcc")
if(DEFINED ENV{DEB_BUILD_MULTIARCH} AND DEFINED ENV{DEB_HOST_MULTIARCH} AND "/home/alex/Work/Qt/5.8/gcc_64/bin/moc" MATCHES "/usr/lib/$ENV{DEB_HOST_MULTIARCH}/qt5/bin/moc")
set(AM_QT_MOC_EXECUTABLE "/usr/lib/$ENV{DEB_BUILD_MULTIARCH}/qt5/bin/moc")
endif()
set(AM_CMAKE_CURRENT_SOURCE_DIR "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/")
set(AM_CMAKE_CURRENT_BINARY_DIR "/home/alex/Work/C++Projects/easyprofiler/profiler_gui/")
set(AM_QT_VERSION_MAJOR "5")
set(AM_TARGET_NAME "profiler_gui_automoc")
set(AM_ORIGIN_TARGET_NAME "profiler_gui")
set(AM_RELAXED_MODE "FALSE")
set(AM_UIC_TARGET_OPTIONS )
set(AM_UIC_OPTIONS_FILES )
set(AM_UIC_OPTIONS_OPTIONS )
set(AM_RCC_OPTIONS_FILES "")
set(AM_RCC_OPTIONS_OPTIONS "")

View File

@ -0,0 +1,11 @@
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
)
# The set of files for implicit dependencies of each language:
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@ -0,0 +1,77 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/alex/Work/C++Projects/easyprofiler
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/alex/Work/C++Projects/easyprofiler
# Utility rule file for profiler_gui_automoc.
# Include the progress variables for this target.
include profiler_gui/CMakeFiles/profiler_gui_automoc.dir/progress.make
profiler_gui/CMakeFiles/profiler_gui_automoc:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/alex/Work/C++Projects/easyprofiler/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Automatic moc and rcc for target profiler_gui"
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && /usr/bin/cmake -E cmake_autogen /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui_automoc.dir/ Release
profiler_gui_automoc: profiler_gui/CMakeFiles/profiler_gui_automoc
profiler_gui_automoc: profiler_gui/CMakeFiles/profiler_gui_automoc.dir/build.make
.PHONY : profiler_gui_automoc
# Rule to build all files generated by this target.
profiler_gui/CMakeFiles/profiler_gui_automoc.dir/build: profiler_gui_automoc
.PHONY : profiler_gui/CMakeFiles/profiler_gui_automoc.dir/build
profiler_gui/CMakeFiles/profiler_gui_automoc.dir/clean:
cd /home/alex/Work/C++Projects/easyprofiler/profiler_gui && $(CMAKE_COMMAND) -P CMakeFiles/profiler_gui_automoc.dir/cmake_clean.cmake
.PHONY : profiler_gui/CMakeFiles/profiler_gui_automoc.dir/clean
profiler_gui/CMakeFiles/profiler_gui_automoc.dir/depend:
cd /home/alex/Work/C++Projects/easyprofiler && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/profiler_gui /home/alex/Work/C++Projects/easyprofiler /home/alex/Work/C++Projects/easyprofiler/profiler_gui /home/alex/Work/C++Projects/easyprofiler/profiler_gui/CMakeFiles/profiler_gui_automoc.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : profiler_gui/CMakeFiles/profiler_gui_automoc.dir/depend

View File

@ -0,0 +1,10 @@
file(REMOVE_RECURSE
"profiler_gui_automoc.cpp"
"CMakeFiles/profiler_gui.dir/qrc_resources.cpp"
"CMakeFiles/profiler_gui_automoc"
)
# Per-language clean rules from dependency scanning.
foreach(lang )
include(CMakeFiles/profiler_gui_automoc.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

View File

@ -0,0 +1,2 @@
CMAKE_PROGRESS_1 = 29

View File

@ -0,0 +1 @@
29

View File

@ -0,0 +1,70 @@
#set(CMAKE_PREFIX_PATH f:/qt/5.5/5.6/msvc2013_64/lib/cmake)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Widgets)
if (Qt5Widgets_FOUND)
if (NOT("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") AND WIN32)
set(APPLICATION_PLATFORM WIN32)
endif ()
add_executable(profiler_gui ${APPLICATION_PLATFORM}
main.cpp
arbitrary_value_inspector.h
arbitrary_value_inspector.cpp
blocks_graphics_view.h
blocks_graphics_view.cpp
blocks_tree_widget.h
blocks_tree_widget.cpp
common_functions.h
common_functions.cpp
common_types.h
descriptors_tree_widget.h
descriptors_tree_widget.cpp
easy_chronometer_item.h
easy_chronometer_item.cpp
easy_frame_rate_viewer.h
easy_frame_rate_viewer.cpp
easy_graphics_item.h
easy_graphics_item.cpp
easy_graphics_scrollbar.h
easy_graphics_scrollbar.cpp
easy_qtimer.h
easy_qtimer.cpp
globals.h
globals.cpp
globals_qobjects.cpp
main_window.h
main_window.cpp
tree_widget_item.h
tree_widget_item.cpp
tree_widget_loader.h
tree_widget_loader.cpp
treeview_first_column_delegate.h
treeview_first_column_delegate.cpp
resources.qrc
resources.rc
)
target_link_libraries(profiler_gui Qt5::Widgets easy_profiler)
if (WIN32)
target_compile_definitions(profiler_gui PRIVATE -D_WIN32_WINNT=0x0600)
endif ()
if (MINGW)
target_compile_definitions(profiler_gui PRIVATE -DSTRSAFE_NO_DEPRECATE)
endif ()
install(
TARGETS
profiler_gui
RUNTIME
DESTINATION
bin
)
set_property(TARGET profiler_gui PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
else ()
message(STATUS "INFO\n\n\tQt5 not found! Generating EasyProfiler projects without GUI.\n")
endif ()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,299 @@
/************************************************************************
* file name : arbitrary_value_inspector.h
* ----------------- :
* creation time : 2017/11/30
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of .
* ----------------- :
* change log : * 2017/11/30 Victor Zarubkin: initial commit.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H
#define EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H
#include <QWidget>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QGraphicsItem>
#include <QGraphicsView>
#include <QTimer>
#include <QPointF>
#include <QList>
#include <easy/serialized_block.h>
#include <easy/reader.h>
#include <easy/utility.h>
#include <unordered_map>
#include <vector>
#include <string>
#include <thread>
#include <atomic>
#include <memory>
//////////////////////////////////////////////////////////////////////////
using Points = std::vector<QPointF>;
using ArbitraryValues = std::vector<const profiler::ArbitraryValue*>;
using ArbitraryValuesMap = std::unordered_map<profiler::thread_id_t, ArbitraryValues, estd::hash<profiler::thread_id_t> >;
class ArbitraryValuesCollection EASY_FINAL
{
public:
enum JobStatus : uint8_t { Idle = 0, Ready, InProgress };
enum JobType : uint8_t { None = 0, ValuesJob = 1 << 0, PointsJob = 1 << 1 };
private:
using This = ArbitraryValuesCollection;
ArbitraryValuesMap m_values;
Points m_points;
std::thread m_collectorThread;
profiler::timestamp_t m_beginTime;
qreal m_minValue;
qreal m_maxValue;
std::atomic<uint8_t> m_status;
std::atomic_bool m_bInterrupt;
uint8_t m_jobType;
public:
explicit ArbitraryValuesCollection();
~ArbitraryValuesCollection();
const ArbitraryValuesMap& valuesMap() const;
const Points& points() const;
JobStatus status() const;
size_t size() const;
qreal minValue() const;
qreal maxValue() const;
void collectValues(profiler::thread_id_t _threadId, profiler::vin_t _valueId, const char* _valueName);
void collectValues(profiler::thread_id_t _threadId, profiler::vin_t _valueId, const char* _valueName, profiler::timestamp_t _beginTime);
bool calculatePoints(profiler::timestamp_t _beginTime);
void interrupt();
private:
void setStatus(JobStatus _status);
void collectById(profiler::thread_id_t _threadId, profiler::vin_t _valueId);
void collectByName(profiler::thread_id_t _threadId, const std::string _valueName);
bool collectByIdForThread(const profiler::BlocksTreeRoot& _threadRoot, profiler::vin_t _valueId, bool _calculatePoints);
bool collectByNameForThread(const profiler::BlocksTreeRoot& _threadRoot, const std::string& _valueName, bool _calculatePoints);
QPointF point(const profiler::ArbitraryValue& _value) const;
}; // end of class ArbitraryValuesCollection.
enum class ChartType : uint8_t
{
Line = 0,
Points
};
struct EasyCollectionPaintData EASY_FINAL
{
const ArbitraryValuesCollection* ptr;
QRgb color;
ChartType chartType;
bool selected;
};
using Collections = std::vector<EasyCollectionPaintData>;
//////////////////////////////////////////////////////////////////////////
class EasyArbitraryValuesChartItem : public QGraphicsItem
{
using Parent = QGraphicsItem;
using This = EasyArbitraryValuesChartItem;
Collections m_collections;
QRectF m_boundingRect;
public:
explicit EasyArbitraryValuesChartItem();
~EasyArbitraryValuesChartItem() override;
void paint(QPainter* _painter, const QStyleOptionGraphicsItem* _option, QWidget* _widget = nullptr) override;
QRectF boundingRect() const override;
void setBoundingRect(const QRectF& _rect);
void setBoundingRect(qreal _left, qreal _top, qreal _width, qreal _height);
void update(Collections _collections);
void update(const ArbitraryValuesCollection* _selected);
}; // end of class EasyArbitraryValuesChartItem.
class EasyGraphicsChart : public QGraphicsView
{
Q_OBJECT
private:
using Parent = QGraphicsView;
using This = EasyGraphicsChart;
EasyArbitraryValuesChartItem* m_chartItem;
qreal m_left;
qreal m_right;
qreal m_offset;
qreal m_xscale;
qreal m_visibleRegionWidth;
bool m_bBindMode;
public:
explicit EasyGraphicsChart(QWidget* _parent = nullptr);
~EasyGraphicsChart() override;
void resizeEvent(QResizeEvent* _event) override;
void clear();
bool bindMode() const;
qreal xscale() const;
qreal left() const;
qreal right() const;
qreal range() const;
qreal offset() const;
qreal region() const;
void setOffset(qreal _offset);
void setRange(qreal _left, qreal _right);
void setRegion(qreal _visibleRegionWidth);
void update(Collections _collections);
void update(const ArbitraryValuesCollection* _selected);
private slots:
void onSceneSizeChanged();
void onWindowSizeChanged(qreal _width, qreal _height);
}; // end of class EasyGraphicsChart.
//////////////////////////////////////////////////////////////////////////
class EasyArbitraryTreeWidgetItem : public QTreeWidgetItem
{
using Parent = QTreeWidgetItem;
using This = EasyArbitraryTreeWidgetItem;
using CollectionPtr = std::unique_ptr<ArbitraryValuesCollection>;
CollectionPtr m_collection;
profiler::vin_t m_vin;
profiler::color_t m_color;
int m_widthHint;
public:
explicit EasyArbitraryTreeWidgetItem(QTreeWidgetItem* _parent, profiler::color_t _color, profiler::vin_t _vin = 0);
~EasyArbitraryTreeWidgetItem() override;
QVariant data(int _column, int _role) const override;
void setWidthHint(int _width);
const ArbitraryValuesCollection* collection() const;
void collectValues(profiler::thread_id_t _threadId);
void interrupt();
profiler::color_t color() const;
}; // end of class EasyArbitraryTreeWidgetItem.
//////////////////////////////////////////////////////////////////////////
class EasyArbitraryValuesWidget : public QWidget
{
Q_OBJECT
using Parent = QWidget;
using This = EasyArbitraryValuesWidget;
QTimer m_timer;
QTimer m_collectionsTimer;
QList<EasyArbitraryTreeWidgetItem*> m_checkedItems;
QTreeWidget* m_treeWidget;
EasyGraphicsChart* m_chart;
public:
explicit EasyArbitraryValuesWidget(QWidget* _parent = nullptr);
~EasyArbitraryValuesWidget() override;
void clear();
public slots:
void rebuild();
private slots:
void onSelectedThreadChanged(profiler::thread_id_t _id);
void onSelectedBlockChanged(uint32_t _block_index);
void onSelectedBlockIdChanged(profiler::block_id_t _id);
void onItemDoubleClicked(QTreeWidgetItem* _item, int _column);
void onItemChanged(QTreeWidgetItem* _item, int _column);
void onCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*);
void onCollectionsTimeout();
private:
void buildTree(profiler::thread_id_t _threadId, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId);
QTreeWidgetItem* buildTreeForThread(const profiler::BlocksTreeRoot& _threadRoot, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId);
}; // end of class EasyArbitraryValuesWidget.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
/************************************************************************
* file name : blocks_graphics_view.h
* ----------------- :
* creation time : 2016/06/26
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of GraphicsScene and GraphicsView and
* : it's auxiliary classes for displyaing easy_profiler blocks tree.
* ----------------- :
* change log : * 2016/06/26 Victor Zarubkin: moved sources from graphics_view.h
* : and renamed classes from My* to Prof*.
* :
* : * 2016/06/29 Victor Zarubkin: Highly optimized painting performance and memory consumption.
* :
* : * 2016/06/30 Victor Zarubkin: Replaced doubles with floats (in ProfBlockItem) for less memory consumption.
* :
* : * 2016/09/15 Victor Zarubkin: Moved sources of EasyGraphicsItem and EasyChronometerItem to separate files.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_GRAPHICS_VIEW_H
#define EASY_GRAPHICS_VIEW_H
#include <stdlib.h>
#include <unordered_set>
#include <QGraphicsView>
#include <QGraphicsItem>
#include <QPoint>
#include <QRectF>
#include <QTimer>
#include <QLabel>
#include <easy/reader.h>
#include "common_functions.h"
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
class QGraphicsProxyWidget;
class EasyGraphicsView;
class EasyGraphicsItem;
class EasyGraphicsScrollbar;
class EasyChronometerItem;
//////////////////////////////////////////////////////////////////////////
#define EASY_QGRAPHICSITEM(ClassName) \
class ClassName : public QGraphicsItem { \
QRectF m_boundingRect; \
public: \
ClassName() : QGraphicsItem() {} \
virtual ~ClassName() {} \
void paint(QPainter* _painter, const QStyleOptionGraphicsItem* _option, QWidget* _widget = nullptr) override; \
QRectF boundingRect() const override { return m_boundingRect; } \
void setBoundingRect(qreal x, qreal y, qreal w, qreal h) { m_boundingRect.setRect(x, y, w, h); } \
void setBoundingRect(const QRectF& _rect) { m_boundingRect = _rect; } \
}
EASY_QGRAPHICSITEM(EasyBackgroundItem);
EASY_QGRAPHICSITEM(EasyTimelineIndicatorItem);
EASY_QGRAPHICSITEM(EasyThreadNameItem);
#undef EASY_QGRAPHICSITEM
//////////////////////////////////////////////////////////////////////////
struct EasyBoldLabel : public QLabel {
EasyBoldLabel(const QString& _text, QWidget* _parent = nullptr);
virtual ~EasyBoldLabel();
};
//////////////////////////////////////////////////////////////////////////
class EasyGraphicsView : public QGraphicsView
{
Q_OBJECT
private:
using Parent = QGraphicsView;
using This = EasyGraphicsView;
using Items = ::std::vector<EasyGraphicsItem*>;
//using Keys = ::std::unordered_set<int, ::estd::hash<int> >;
Items m_items; ///< Array of all EasyGraphicsItem items
//Keys m_keys; ///< Pressed keyboard keys
::profiler_gui::TreeBlocks m_selectedBlocks; ///< Array of items which were selected by selection zone (EasyChronometerItem)
QTimer m_flickerTimer; ///< Timer for flicking behavior
QTimer m_idleTimer; ///<
QRectF m_visibleSceneRect; ///< Visible scene rectangle
::profiler::timestamp_t m_beginTime; ///< Begin time of profiler session. Used to reduce values of all begin and end times of profiler blocks.
qreal m_sceneWidth; ///<
qreal m_scale; ///< Current scale
qreal m_offset; ///< Have to use manual offset for all scene content instead of using scrollbars because QScrollBar::value is 32-bit integer :(
qreal m_timelineStep; ///<
uint64_t m_idleTime; ///<
QPoint m_mousePressPos; ///< Last mouse global position (used by mousePressEvent and mouseMoveEvent)
QPoint m_mouseMovePath; ///< Mouse move path between press and release of any button
Qt::MouseButtons m_mouseButtons; ///< Pressed mouse buttons
EasyGraphicsScrollbar* m_pScrollbar; ///< Pointer to the graphics scrollbar widget
EasyChronometerItem* m_chronometerItem; ///< Pointer to the EasyChronometerItem which is displayed when you press right mouse button and move mouse left or right. This item is used to select blocks to display in tree widget.
EasyChronometerItem* m_chronometerItemAux; ///< Pointer to the EasyChronometerItem which is displayed when you double click left mouse button and move mouse left or right. This item is used only to measure time.
QGraphicsProxyWidget* m_popupWidget; ///<
int m_flickerSpeedX; ///< Current flicking speed x
int m_flickerSpeedY; ///< Current flicking speed y
int m_flickerCounterX;
int m_flickerCounterY;
bool m_bDoubleClick; ///< Is mouse buttons double clicked
bool m_bUpdatingRect; ///< Stub flag which is used to avoid excess calculations on some scene update (flicking, scaling and so on)
bool m_bEmpty; ///< Indicates whether scene is empty and has no items
public:
explicit EasyGraphicsView(QWidget* _parent = nullptr);
virtual ~EasyGraphicsView();
// Public virtual methods
void wheelEvent(QWheelEvent* _event) override;
void mousePressEvent(QMouseEvent* _event) override;
void mouseDoubleClickEvent(QMouseEvent* _event) override;
void mouseReleaseEvent(QMouseEvent* _event) override;
void mouseMoveEvent(QMouseEvent* _event) override;
void keyPressEvent(QKeyEvent* _event) override;
void keyReleaseEvent(QKeyEvent* _event) override;
void resizeEvent(QResizeEvent* _event) override;
void dragEnterEvent(QDragEnterEvent*) override {}
public:
// Public non-virtual methods
qreal sceneWidth() const;
qreal chronoTime() const;
qreal chronoTimeAux() const;
void setScrollbar(EasyGraphicsScrollbar* _scrollbar);
void clear();
void setTree(const ::profiler::thread_blocks_tree_t& _blocksTree);
const Items& getItems() const;
signals:
// Signals
void sceneUpdated();
void treeChanged();
void intervalChanged(const ::profiler_gui::TreeBlocks& _blocks, ::profiler::timestamp_t _session_begin_time, ::profiler::timestamp_t _left, ::profiler::timestamp_t _right, bool _strict);
private:
// Private non-virtual methods
void removePopup(bool _removeFromScene = false);
EasyChronometerItem* createChronometer(bool _main = true);
bool moveChrono(EasyChronometerItem* _chronometerItem, qreal _mouseX);
void initMode();
int updateVisibleSceneRect();
void updateTimelineStep(qreal _windowWidth);
void scaleTo(qreal _scale);
void scrollTo(const EasyGraphicsItem* _item);
void onWheel(qreal _mouseX, int _wheelDelta);
qreal setTree(EasyGraphicsItem* _item, const ::profiler::BlocksTree::children_t& _children, qreal& _height, uint32_t& _maxDepthChild, qreal _y, short _level);
private slots:
// Private Slots
void repaintScene();
void onGraphicsScrollbarWheel(qreal _mouseX, int _wheelDelta);
void onScrollbarValueChange(int);
void onGraphicsScrollbarValueChange(qreal);
void onFlickerTimeout();
void onIdleTimeout();
void onHierarchyFlagChange(bool _value);
void onSelectedThreadChange(::profiler::thread_id_t _id);
void onSelectedBlockChange(unsigned int _block_index);
void onRefreshRequired();
void onThreadViewChanged();
public:
// Public inline methods
inline qreal scale() const
{
return m_scale;
}
inline qreal offset() const
{
return m_offset;
}
inline const QRectF& visibleSceneRect() const
{
return m_visibleSceneRect;
}
inline qreal timelineStep() const
{
return m_timelineStep;
}
inline qreal time2position(const profiler::timestamp_t& _time) const
{
return PROF_MICROSECONDS(qreal(_time - m_beginTime));
//return PROF_MILLISECONDS(qreal(_time - m_beginTime));
}
inline ::profiler::timestamp_t position2time(qreal _pos) const
{
return PROF_FROM_MICROSECONDS(_pos);
//return PROF_FROM_MILLISECONDS(_pos);
}
}; // END of class EasyGraphicsView.
//////////////////////////////////////////////////////////////////////////
class EasyThreadNamesWidget : public QGraphicsView
{
Q_OBJECT
private:
typedef QGraphicsView Parent;
typedef EasyThreadNamesWidget This;
QTimer m_idleTimer; ///<
uint64_t m_idleTime; ///<
EasyGraphicsView* m_view; ///<
QGraphicsProxyWidget* m_popupWidget; ///<
int m_maxLength; ///<
const int m_additionalHeight; ///<
public:
explicit EasyThreadNamesWidget(EasyGraphicsView* _view, int _additionalHeight, QWidget* _parent = nullptr);
virtual ~EasyThreadNamesWidget();
void mousePressEvent(QMouseEvent* _event) override;
void mouseDoubleClickEvent(QMouseEvent* _event) override;
void mouseReleaseEvent(QMouseEvent* _event) override;
void mouseMoveEvent(QMouseEvent* _event) override;
void keyPressEvent(QKeyEvent* _event) override;
void keyReleaseEvent(QKeyEvent* _event) override;
void wheelEvent(QWheelEvent* _event) override;
void dragEnterEvent(QDragEnterEvent*) override {}
void clear();
const EasyGraphicsView* view() const
{
return m_view;
}
private:
void removePopup(bool _removeFromScene = false);
private slots:
void setVerticalScrollbarRange(int _minValue, int _maxValue);
void onTreeChange();
void onIdleTimeout();
void repaintScene();
}; // END of class EasyThreadNamesWidget.
//////////////////////////////////////////////////////////////////////////
class EasyGraphicsViewWidget : public QWidget
{
Q_OBJECT
private:
EasyGraphicsScrollbar* m_scrollbar;
EasyGraphicsView* m_view;
EasyThreadNamesWidget* m_threadNamesWidget;
public:
explicit EasyGraphicsViewWidget(QWidget* _parent = nullptr);
virtual ~EasyGraphicsViewWidget();
EasyGraphicsView* view();
void clear();
private:
void initWidget();
}; // END of class EasyGraphicsViewWidget.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_GRAPHICS_VIEW_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
/************************************************************************
* file name : blocks_tree_widget.h
* ----------------- :
* creation time : 2016/06/26
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of EasyTreeWidget and it's auxiliary classes
* : for displyaing EasyProfiler blocks tree.
* ----------------- :
* change log : * 2016/06/26 Victor Zarubkin: moved sources from tree_view.h
* : and renamed classes from My* to Prof*.
* :
* : * 2016/06/27 Victor Zarubkin: Added possibility to colorize rows
* : with profiler blocks' colors.
* :
* : * 2016/06/29 Victor Zarubkin: Added clearSilent() method.
* :
* : * 2016/08/18 Victor Zarubkin: Added loading blocks hierarchy in separate thread;
* : Moved sources of TreeWidgetItem into tree_widget_item.h/.cpp
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_TREE_WIDGET_H
#define EASY_TREE_WIDGET_H
#include <QTreeWidget>
#include <QTimer>
#include "tree_widget_loader.h"
#include "tree_widget_item.h"
#include <easy/reader.h>
//////////////////////////////////////////////////////////////////////////
class EasyTreeWidget : public QTreeWidget
{
Q_OBJECT
typedef QTreeWidget Parent;
typedef EasyTreeWidget This;
protected:
EasyTreeWidgetLoader m_hierarchyBuilder;
Items m_items;
RootsMap m_roots;
::profiler_gui::TreeBlocks m_inputBlocks;
QTimer m_fillTimer;
QString m_lastSearch;
QTreeWidgetItem* m_lastFound;
::profiler::timestamp_t m_beginTime;
class QProgressDialog* m_progress;
class QLabel* m_hintLabel;
EasyTreeMode m_mode;
bool m_bLocked;
bool m_bSilentExpandCollapse;
char m_columnsHiddenStatus[COL_COLUMNS_NUMBER];
public:
explicit EasyTreeWidget(QWidget* _parent = nullptr);
virtual ~EasyTreeWidget();
void contextMenuEvent(QContextMenuEvent* _event) override;
void clearSilent(bool _global = false);
int findNext(const QString& _str, Qt::MatchFlags _flags);
int findPrev(const QString& _str, Qt::MatchFlags _flags);
public slots:
void setTree(const unsigned int _blocksNumber, const ::profiler::thread_blocks_tree_t& _blocksTree);
void setTreeBlocks(const ::profiler_gui::TreeBlocks& _blocks, ::profiler::timestamp_t _session_begin_time, ::profiler::timestamp_t _left, ::profiler::timestamp_t _right, bool _strict);
protected:
void resizeEvent(QResizeEvent* _event) override;
void moveEvent(QMoveEvent* _event) override;
private slots:
void onJumpToItemClicked(bool);
void onCollapseAllClicked(bool);
void onExpandAllClicked(bool);
void onCollapseAllChildrenClicked(bool);
void onExpandAllChildrenClicked(bool);
void onItemExpand(QTreeWidgetItem* _item);
void onItemCollapse(QTreeWidgetItem* _item);
void onCurrentItemChange(QTreeWidgetItem* _item, QTreeWidgetItem*);
void onSelectedThreadChange(::profiler::thread_id_t _id);
void onSelectedBlockChange(uint32_t _block_index);
void onBlockStatusChangeClicked(bool);
void resizeColumnsToContents();
void onHideShowColumn(bool);
void onModeChange(bool);
void onFillTimerTimeout();
protected:
void loadSettings();
void saveSettings();
void alignProgressBar();
private:
void destroyProgressDialog();
void createProgressDialog();
}; // END of class EasyTreeWidget.
//////////////////////////////////////////////////////////////////////////
class EasyHierarchyWidget : public QWidget
{
Q_OBJECT
typedef QWidget Parent;
typedef EasyHierarchyWidget This;
private:
EasyTreeWidget* m_tree;
class QLineEdit* m_searchBox;
class QLabel* m_foundNumber;
class QAction* m_searchButton;
bool m_bCaseSensitiveSearch;
public:
// Public virtual methods
explicit EasyHierarchyWidget(QWidget* _parent = nullptr);
virtual ~EasyHierarchyWidget();
void keyPressEvent(QKeyEvent* _event) override;
void contextMenuEvent(QContextMenuEvent* _event) override;
public:
// Public non-virtual methods
EasyTreeWidget* tree();
void clear(bool _global = false);
private slots:
// Private slots
void onSeachBoxReturnPressed();
void findNext(bool);
void findPrev(bool);
void findNextFromMenu(bool);
void findPrevFromMenu(bool);
private:
// Private non-virtual methods
void loadSettings();
void saveSettings();
}; // END of class EasyHierarchyWidget.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_TREE_WIDGET_H

View File

@ -0,0 +1,54 @@
# Install script for directory: /home/alex/Work/C++Projects/easyprofiler/profiler_gui
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui"
RPATH "$ORIGIN:/home/alex/Work/Qt/5.8/gcc_64/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/home/alex/Work/C++Projects/easyprofiler/bin/profiler_gui")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui"
OLD_RPATH "/home/alex/Work/Qt/5.8/gcc_64/lib:/home/alex/Work/C++Projects/easyprofiler/bin:"
NEW_RPATH "$ORIGIN:/home/alex/Work/Qt/5.8/gcc_64/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/profiler_gui")
endif()
endif()
endif()

View File

@ -0,0 +1,345 @@
/************************************************************************
* file name : common_functions.cpp
* ----------------- :
* creation time : 2017/12/06
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains implementaion of common functions used by different UI widgets.
* ----------------- :
* change log : * 2017/12/06 Victor Zarubkin: Initial commit. Moved sources from common_types.h
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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 "common_functions.h"
namespace profiler_gui {
//////////////////////////////////////////////////////////////////////////
qreal timeFactor(qreal _interval)
{
if (_interval < 1) // interval in nanoseconds
return 1e3;
if (_interval < 1e3) // interval in microseconds
return 1;
if (_interval < 1e6) // interval in milliseconds
return 1e-3;
// interval in seconds
return 1e-6;
}
//////////////////////////////////////////////////////////////////////////
QString autoTimeStringReal(qreal _interval, int _precision)
{
if (_interval < 1) // interval in nanoseconds
return QString("%1 ns").arg(static_cast<quint64>(_interval * 1e3));
if (_interval < 1e3) // interval in microseconds
return QString("%1 us").arg(_interval, 0, 'f', _precision);
if (_interval < 1e6) // interval in milliseconds
return QString("%1 ms").arg(_interval * 1e-3, 0, 'f', _precision);
// interval in seconds
return QString("%1 s").arg(_interval * 1e-6, 0, 'f', _precision);
}
QString autoTimeStringInt(qreal _interval)
{
if (_interval < 1) // interval in nanoseconds
return QString("%1 ns").arg(static_cast<quint64>(_interval * 1e3 + 0.5));
if (_interval < 1e3) // interval in microseconds
return QString("%1 us").arg(static_cast<quint32>(_interval + 0.5));
if (_interval < 1e6) // interval in milliseconds
return QString("%1 ms").arg(static_cast<quint32>(_interval * 1e-3 + 0.5));
// interval in seconds
return QString("%1 s").arg(static_cast<quint32>(_interval * 1e-6 + 0.5));
}
QString autoTimeStringRealNs(::profiler::timestamp_t _interval, int _precision)
{
if (_interval < 1000) // interval in nanoseconds
return QString("%1 ns").arg(_interval);
if (_interval < 1000000) // interval in microseconds
return QString("%1 us").arg(_interval * 1e-3, 0, 'f', _precision);
if (_interval < 1000000000U) // interval in milliseconds
return QString("%1 ms").arg(_interval * 1e-6, 0, 'f', _precision);
// interval in seconds
return QString("%1 s").arg(_interval * 1e-9, 0, 'f', _precision);
}
QString autoTimeStringIntNs(::profiler::timestamp_t _interval)
{
if (_interval < 1000) // interval in nanoseconds
return QString("%1 ns").arg(_interval);
if (_interval < 1000000) // interval in microseconds
return QString("%1 us").arg(static_cast<quint32>(_interval * 1e-3 + 0.5));
if (_interval < 1000000000U) // interval in milliseconds
return QString("%1 ms").arg(static_cast<quint32>(_interval * 1e-6 + 0.5));
// interval in seconds
return QString("%1 s").arg(static_cast<quint32>(_interval * 1e-9 + 0.5));
}
//////////////////////////////////////////////////////////////////////////
QString timeStringReal(TimeUnits _units, qreal _interval, int _precision)
{
switch (_units)
{
case TimeUnits_ms:{
const char fmt = _interval <= 1 ? 'g' : 'f';
return QString("%1 ms").arg(_interval * 1e-3, 0, fmt, _precision);
}
case TimeUnits_us:
return QString("%1 us").arg(_interval, 0, 'f', _precision);
case TimeUnits_ns:
return QString("%1 ns").arg(static_cast<quint64>(_interval * 1e3 + 0.5));
case TimeUnits_auto:
default:
return autoTimeStringReal(_interval, _precision);
}
}
QString timeStringRealNs(TimeUnits _units, ::profiler::timestamp_t _interval, int _precision)
{
switch (_units)
{
case TimeUnits_ms:{
const char fmt = _interval <= 1000 ? 'g' : 'f';
return QString("%1 ms").arg(_interval * 1e-6, 0, fmt, _precision);
}
case TimeUnits_us:
return QString("%1 us").arg(_interval * 1e-3, 0, 'f', _precision);
case TimeUnits_ns:
return QString("%1 ns").arg(_interval);
case TimeUnits_auto:
default:
return autoTimeStringRealNs(_interval, _precision);
}
}
QString timeStringInt(TimeUnits _units, qreal _interval)
{
switch (_units)
{
case TimeUnits_ms:
return QString("%1 ms").arg(static_cast<quint32>(_interval * 1e-3 + 0.5));
case TimeUnits_us:
return QString("%1 us").arg(static_cast<quint32>(_interval + 0.5));
case TimeUnits_ns:
return QString("%1 ns").arg(static_cast<quint64>(_interval * 1e3 + 0.5));
case TimeUnits_auto:
default:
return autoTimeStringInt(_interval);
}
}
QString timeStringIntNs(TimeUnits _units, ::profiler::timestamp_t _interval)
{
switch (_units)
{
case TimeUnits_ms:
return QString("%1 ms").arg(static_cast<quint32>(_interval * 1e-6 + 0.5));
case TimeUnits_us:
return QString("%1 us").arg(static_cast<quint32>(_interval * 1e-3 + 0.5));
case TimeUnits_ns:
return QString("%1 ns").arg(_interval);
case TimeUnits_auto:
default:
return autoTimeStringIntNs(_interval);
}
}
//////////////////////////////////////////////////////////////////////////
QFont EFont(QFont::StyleHint _hint, const char* _family, int _size, int _weight)
{
QFont f;
f.setStyleHint(_hint, QFont::PreferMatch);
f.setFamily(_family);
f.setPointSize(_size);
f.setWeight(_weight);
return f;
}
//////////////////////////////////////////////////////////////////////////
QString valueTypeString(::profiler::DataType _dataType)
{
switch (_dataType)
{
case ::profiler::DataType::Bool: return QStringLiteral("bool");
case ::profiler::DataType::Char: return QStringLiteral("char");
case ::profiler::DataType::Int8: return QStringLiteral("int8");
case ::profiler::DataType::Uint8: return QStringLiteral("unsigned int8");
case ::profiler::DataType::Int16: return QStringLiteral("int16");
case ::profiler::DataType::Uint16: return QStringLiteral("unsigned int16");
case ::profiler::DataType::Int32: return QStringLiteral("int32");
case ::profiler::DataType::Uint32: return QStringLiteral("unsigned int32");
case ::profiler::DataType::Int64: return QStringLiteral("int64");
case ::profiler::DataType::Uint64: return QStringLiteral("unsigned int64");
case ::profiler::DataType::Float: return QStringLiteral("float");
case ::profiler::DataType::Double: return QStringLiteral("double");
case ::profiler::DataType::String: return QStringLiteral("string");
default: return QStringLiteral("unknown");
}
}
QString valueTypeString(const ::profiler::ArbitraryValue& _serializedValue)
{
const auto type = _serializedValue.type();
if (_serializedValue.isArray() && type != ::profiler::DataType::String)
return valueTypeString(type) + QStringLiteral("[]");
return valueTypeString(type);
}
QString valueString(const ::profiler::ArbitraryValue& _serializedValue)
{
if (_serializedValue.isArray())
{
if (_serializedValue.type() == ::profiler::DataType::String)
return _serializedValue.data();
return QStringLiteral("[...] array");
}
switch (_serializedValue.type())
{
case ::profiler::DataType::Bool: return _serializedValue.toValue<bool>()->value() ? QStringLiteral("true") : QStringLiteral("false");
case ::profiler::DataType::Char: return QChar(_serializedValue.toValue<char>()->value());
case ::profiler::DataType::Int8: return QChar(_serializedValue.toValue<int8_t>()->value());
case ::profiler::DataType::Uint8: return QString::number(_serializedValue.toValue<uint8_t>()->value());
case ::profiler::DataType::Int16: return QString::number(_serializedValue.toValue<int16_t>()->value());
case ::profiler::DataType::Uint16: return QString::number(_serializedValue.toValue<uint16_t>()->value());
case ::profiler::DataType::Int32: return QString::number(_serializedValue.toValue<int32_t>()->value());
case ::profiler::DataType::Uint32: return QString::number(_serializedValue.toValue<uint32_t>()->value());
case ::profiler::DataType::Int64: return QString::number(_serializedValue.toValue<int64_t>()->value());
case ::profiler::DataType::Uint64: return QString::number(_serializedValue.toValue<uint64_t>()->value());
case ::profiler::DataType::Float: return QString::number(_serializedValue.toValue<float>()->value());
case ::profiler::DataType::Double: return QString::number(_serializedValue.toValue<double>()->value());
case ::profiler::DataType::String: return _serializedValue.data();
default: return QStringLiteral("Unknown");
}
}
double value2real(const ::profiler::ArbitraryValue& _serializedValue, int _index)
{
if (_serializedValue.isArray())
{
switch (_serializedValue.type())
{
case ::profiler::DataType::Bool:
{
const auto value = _serializedValue.toArray<bool>()->at(_index);
return value ? 1 : 0;
}
case ::profiler::DataType::Char: return static_cast<double>(_serializedValue.toArray<char>()->at(_index));
case ::profiler::DataType::Int8: return static_cast<double>(_serializedValue.toArray<int8_t>()->at(_index));
case ::profiler::DataType::Uint8: return static_cast<double>(_serializedValue.toArray<uint8_t>()->at(_index));
case ::profiler::DataType::Int16: return static_cast<double>(_serializedValue.toArray<int16_t>()->at(_index));
case ::profiler::DataType::Uint16: return static_cast<double>(_serializedValue.toArray<uint16_t>()->at(_index));
case ::profiler::DataType::Int32: return static_cast<double>(_serializedValue.toArray<int32_t>()->at(_index));
case ::profiler::DataType::Uint32: return static_cast<double>(_serializedValue.toArray<uint32_t>()->at(_index));
case ::profiler::DataType::Int64: return static_cast<double>(_serializedValue.toArray<int64_t>()->at(_index));
case ::profiler::DataType::Uint64: return static_cast<double>(_serializedValue.toArray<uint64_t>()->at(_index));
case ::profiler::DataType::Float: return static_cast<double>(_serializedValue.toArray<float>()->at(_index));
case ::profiler::DataType::Double: return _serializedValue.toArray<double>()->at(_index);
case ::profiler::DataType::String: return static_cast<double>(_serializedValue.data()[_index]);
default: return 0;
}
}
switch (_serializedValue.type())
{
case ::profiler::DataType::Bool:
{
const auto value = _serializedValue.toValue<bool>()->value();
return value ? 1 : 0;
}
case ::profiler::DataType::Char: return static_cast<double>(_serializedValue.toValue<char>()->value());
case ::profiler::DataType::Int8: return static_cast<double>(_serializedValue.toValue<int8_t>()->value());
case ::profiler::DataType::Uint8: return static_cast<double>(_serializedValue.toValue<uint8_t>()->value());
case ::profiler::DataType::Int16: return static_cast<double>(_serializedValue.toValue<int16_t>()->value());
case ::profiler::DataType::Uint16: return static_cast<double>(_serializedValue.toValue<uint16_t>()->value());
case ::profiler::DataType::Int32: return static_cast<double>(_serializedValue.toValue<int32_t>()->value());
case ::profiler::DataType::Uint32: return static_cast<double>(_serializedValue.toValue<uint32_t>()->value());
case ::profiler::DataType::Int64: return static_cast<double>(_serializedValue.toValue<int64_t>()->value());
case ::profiler::DataType::Uint64: return static_cast<double>(_serializedValue.toValue<uint64_t>()->value());
case ::profiler::DataType::Float: return static_cast<double>(_serializedValue.toValue<float>()->value());
case ::profiler::DataType::Double: return _serializedValue.toValue<double>()->value();
case ::profiler::DataType::String: return static_cast<double>(_serializedValue.data()[_index]);
default: return 0;
}
}
//////////////////////////////////////////////////////////////////////////
} // end of namespace profiler_gui.

View File

@ -0,0 +1,205 @@
/************************************************************************
* file name : common_functions.h
* ----------------- :
* creation time : 2017/12/06
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains common functions used by different UI widgets.
* ----------------- :
* change log : * 2017/12/06 Victor Zarubkin: Initial commit. Moved sources from common_types.h
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER_GUI_COMMON_FUNCTIONS_H
#define EASY_PROFILER_GUI_COMMON_FUNCTIONS_H
#include <QRgb>
#include <QString>
#include <QFont>
#include <type_traits>
#include "common_types.h"
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#define PROF_MICROSECONDS(timestamp) ((timestamp) * 1e-3)
//#define PROF_MICROSECONDS(timestamp) (timestamp)
#define PROF_FROM_MICROSECONDS(to_timestamp) ((to_timestamp) * 1e3)
//#define PROF_FROM_MICROSECONDS(to_timestamp) (to_timestamp)
#define PROF_MILLISECONDS(timestamp) ((timestamp) * 1e-6)
//#define PROF_MILLISECONDS(timestamp) ((timestamp) * 1e-3)
#define PROF_FROM_MILLISECONDS(to_timestamp) ((to_timestamp) * 1e6)
//#define PROF_FROM_MILLISECONDS(to_timestamp) ((to_timestamp) * 1e3)
#define PROF_NANOSECONDS(timestamp) (timestamp)
//#define PROF_NANOSECONDS(timestamp) ((timestamp) * 1000)
//////////////////////////////////////////////////////////////////////////
EASY_FORCE_INLINE qreal units2microseconds(qreal _value) {
return _value;
//return _value * 1e3;
}
EASY_FORCE_INLINE qreal microseconds2units(qreal _value) {
return _value;
//return _value * 1e-3;
}
#ifdef EASY_CONSTEXPR_AVAILABLE
template <class TEnum>
EASY_FORCE_INLINE EASY_CONSTEXPR_FCN typename ::std::underlying_type<TEnum>::type int_cast(TEnum _enumValue) {
return static_cast<typename ::std::underlying_type<TEnum>::type>(_enumValue);
}
#else
# define int_cast(_enumValue) static_cast<::std::underlying_type<decltype(_enumValue)>::type>(_enumValue)
#endif
//////////////////////////////////////////////////////////////////////////
namespace profiler_gui {
//////////////////////////////////////////////////////////////////////////
template <class T> inline
EASY_CONSTEXPR_FCN T numeric_max() {
return ::std::numeric_limits<T>::max();
}
template <class T> inline
EASY_CONSTEXPR_FCN T numeric_max(T) {
return ::std::numeric_limits<T>::max();
}
template <class T> inline
EASY_CONSTEXPR_FCN bool is_max(const T& _value) {
return _value == ::std::numeric_limits<T>::max();
}
template <class T> inline
void set_max(T& _value) {
_value = ::std::numeric_limits<T>::max();
}
//////////////////////////////////////////////////////////////////////////
inline EASY_CONSTEXPR_FCN QRgb toRgb(uint32_t _red, uint32_t _green, uint32_t _blue) {
return (_red << 16) + (_green << 8) + _blue;
}
inline EASY_CONSTEXPR_FCN QRgb fromProfilerRgb(uint32_t _red, uint32_t _green, uint32_t _blue) {
return _red == 0 && _green == 0 && _blue == 0 ? ::profiler::colors::Default : toRgb(_red, _green, _blue) | 0x00141414;
}
EASY_FORCE_INLINE EASY_CONSTEXPR_FCN qreal colorSum(::profiler::color_t _color) {
return 255. - (((_color & 0x00ff0000) >> 16) * 0.299 + ((_color & 0x0000ff00) >> 8) * 0.587 + (_color & 0x000000ff) * 0.114);
}
inline EASY_CONSTEXPR_FCN bool isLightColor(::profiler::color_t _color) {
return colorSum(_color) < 76.5 || ((_color & 0xff000000) >> 24) < 0x80;
}
inline EASY_CONSTEXPR_FCN bool isLightColor(::profiler::color_t _color, qreal _maxSum) {
return colorSum(_color) < _maxSum || ((_color & 0xff000000) >> 24) < 0x80;
}
inline EASY_CONSTEXPR_FCN ::profiler::color_t textColorForFlag(bool _is_light) {
return _is_light ? ::profiler::colors::Dark : ::profiler::colors::CreamWhite;
}
inline EASY_CONSTEXPR_FCN ::profiler::color_t textColorForRgb(::profiler::color_t _color) {
return isLightColor(_color) ? ::profiler::colors::Dark : ::profiler::colors::CreamWhite;
}
//////////////////////////////////////////////////////////////////////////
qreal timeFactor(qreal _interval);
QString autoTimeStringReal(qreal _interval, int _precision = 1);
QString autoTimeStringInt(qreal _interval);
QString autoTimeStringRealNs(::profiler::timestamp_t _interval, int _precision = 1);
QString autoTimeStringIntNs(::profiler::timestamp_t _interval);
QString timeStringReal(TimeUnits _units, qreal _interval, int _precision = 1);
QString timeStringRealNs(TimeUnits _units, ::profiler::timestamp_t _interval, int _precision = 1);
QString timeStringInt(TimeUnits _units, qreal _interval);
QString timeStringIntNs(TimeUnits _units, ::profiler::timestamp_t _interval);
//////////////////////////////////////////////////////////////////////////
inline double percentReal(::profiler::timestamp_t _partial, ::profiler::timestamp_t _total) {
return _total != 0 ? 100. * static_cast<double>(_partial) / static_cast<double>(_total) : 0.;
}
inline int percent(::profiler::timestamp_t _partial, ::profiler::timestamp_t _total) {
return static_cast<int>(0.5 + percentReal(_partial, _total));
}
//////////////////////////////////////////////////////////////////////////
QFont EFont(QFont::StyleHint _hint, const char* _family, int _size, int _weight = -1);
inline QFont EFont(const char* _family, int _size, int _weight = -1) {
return EFont(QFont::Helvetica, _family, _size, _weight);
}
//////////////////////////////////////////////////////////////////////////
QString valueTypeString(::profiler::DataType _dataType);
QString valueTypeString(const ::profiler::ArbitraryValue& _serializedValue);
QString valueString(const ::profiler::ArbitraryValue& _serializedValue);
double value2real(const ::profiler::ArbitraryValue& _serializedValue, int _index = 0);
//////////////////////////////////////////////////////////////////////////
} // END of namespace profiler_gui.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER_GUI_COMMON_FUNCTIONS_H

View File

@ -0,0 +1,205 @@
/************************************************************************
* file name : common_types.h
* ----------------- :
* creation time : 2016/07/31
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of common types for both GraphicsView
* : and TreeWidget.
* ----------------- :
* change log : * 2016/07/31 Victor Zarubkin: initial commit.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_PROFILER__GUI_COMMON_TYPES_H
#define EASY_PROFILER__GUI_COMMON_TYPES_H
#include <vector>
#include <easy/reader.h>
#include <QObject>
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
namespace profiler_gui {
#define EASY_GRAPHICS_ITEM_RECURSIVE_PAINT
//#undef EASY_GRAPHICS_ITEM_RECURSIVE_PAINT
#pragma pack(push, 1)
struct EasyBlockItem Q_DECL_FINAL
{
qreal x; ///< x coordinate of the item (this is made qreal=double to avoid mistakes on very wide scene)
float w; ///< Width of the item
::profiler::block_index_t block; ///< Index of profiler block
#ifndef EASY_GRAPHICS_ITEM_RECURSIVE_PAINT
::profiler::block_index_t neighbours; ///< Number of neighbours (parent.children.size())
uint32_t children_begin; ///< Index of first child item on the next sublevel
int8_t state; ///< 0 = no change, 1 = paint, -1 = do not paint
#else
::profiler::block_index_t max_depth_child; ///< Index of child with maximum tree depth
uint32_t children_begin; ///< Index of first child item on the next sublevel
#endif
// Possible optimizations:
// 1) We can save 1 more byte per block if we will use char instead of short + real time calculations for "totalHeight" var;
// 2) We can save 12 bytes per block if "x" and "w" vars will be removed (all this information exist inside BlocksTree),
// but this requires runtime x-coodinate calculation because BlocksTree has x value in nanoseconds.
inline void setPos(qreal _x, float _w) { x = _x; w = _w; }
inline qreal left() const { return x; }
inline qreal right() const { return x + w; }
inline float width() const { return w; }
}; // END of struct EasyBlockItem.
//#define EASY_TREE_WIDGET__USE_VECTOR
struct EasyBlock Q_DECL_FINAL
{
::profiler::BlocksTree tree;
#ifdef EASY_TREE_WIDGET__USE_VECTOR
uint32_t tree_item;
#endif
uint32_t graphics_item_index;
uint8_t graphics_item_level;
uint8_t graphics_item;
bool expanded;
EasyBlock() = default;
EasyBlock(EasyBlock&& that)
: tree(::std::move(that.tree))
#ifdef EASY_TREE_WIDGET__USE_VECTOR
, tree_item(that.tree_item)
#endif
, graphics_item_index(that.graphics_item_index)
, graphics_item_level(that.graphics_item_level)
, graphics_item(that.graphics_item)
, expanded(that.expanded)
{
}
private:
EasyBlock(const EasyBlock&) = delete;
};
#pragma pack(pop)
typedef ::std::vector<EasyBlockItem> EasyItems;
typedef ::std::vector<EasyBlock> EasyBlocks;
//////////////////////////////////////////////////////////////////////////
struct EasySelectedBlock Q_DECL_FINAL
{
const ::profiler::BlocksTreeRoot* root;
::profiler::block_index_t tree;
EasySelectedBlock() : root(nullptr), tree(0xffffffff)
{
}
EasySelectedBlock(const ::profiler::BlocksTreeRoot* _root, const ::profiler::block_index_t _tree)
: root(_root)
, tree(_tree)
{
}
}; // END of struct EasySelectedBlock.
typedef ::std::vector<EasySelectedBlock> TreeBlocks;
//////////////////////////////////////////////////////////////////////////
enum TimeUnits : int8_t
{
TimeUnits_ms = 0,
TimeUnits_us,
TimeUnits_ns,
TimeUnits_auto
}; // END of enum TimeUnits.
//////////////////////////////////////////////////////////////////////////
} // END of namespace profiler_gui.
template <typename ... Args>
struct Overload
{
template <typename TClass, typename TReturn>
static EASY_CONSTEXPR_FCN auto of(TReturn (TClass::*method)(Args...)) -> decltype(method)
{
return method;
}
template <typename TReturn>
static EASY_CONSTEXPR_FCN auto of(TReturn (*func)(Args...)) -> decltype(func)
{
return func;
}
};
template <>
struct Overload<void>
{
template <typename TClass, typename TReturn>
static EASY_CONSTEXPR_FCN auto of(TReturn (TClass::*method)()) -> decltype(method)
{
return method;
}
template <typename TReturn>
static EASY_CONSTEXPR_FCN auto of(TReturn (*func)()) -> decltype(func)
{
return func;
}
};
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#endif // EASY_PROFILER__GUI_COMMON_TYPES_H

View File

@ -0,0 +1,982 @@
/************************************************************************
* file name : descriptors_tree_widget.cpp
* ----------------- :
* creation time : 2016/09/17
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains implementation of EasyDescTreeWidget and it's auxiliary classes
* : for displyaing EasyProfiler blocks descriptors tree.
* ----------------- :
* change log : * 2016/09/17 Victor Zarubkin: initial commit.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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 <QMenu>
#include <QAction>
#include <QActionGroup>
#include <QHeaderView>
#include <QString>
#include <QContextMenuEvent>
#include <QKeyEvent>
#include <QSignalBlocker>
#include <QSettings>
#include <QLabel>
#include <QLineEdit>
#include <QToolBar>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QVariant>
#include <QTimer>
#include <thread>
#include "descriptors_tree_widget.h"
#include "arbitrary_value_inspector.h"
#include "treeview_first_column_delegate.h"
#include "globals.h"
#ifdef _WIN32
#include <Windows.h>
#ifdef __MINGW32__
#include <processthreadsapi.h>
#endif
#endif
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
//////////////////////////////////////////////////////////////////////////
enum DescColumns
{
DESC_COL_FILE_LINE = 0,
DESC_COL_TYPE,
DESC_COL_NAME,
DESC_COL_STATUS,
DESC_COL_COLUMNS_NUMBER
};
//////////////////////////////////////////////////////////////////////////
::profiler::EasyBlockStatus nextStatus(::profiler::EasyBlockStatus _status)
{
switch (_status)
{
case ::profiler::OFF:
return ::profiler::ON;
case ::profiler::ON:
return ::profiler::FORCE_ON;
case ::profiler::FORCE_ON:
return ::profiler::OFF_RECURSIVE;
case ::profiler::OFF_RECURSIVE:
return ::profiler::ON_WITHOUT_CHILDREN;
case ::profiler::ON_WITHOUT_CHILDREN:
return ::profiler::FORCE_ON_WITHOUT_CHILDREN;
case ::profiler::FORCE_ON_WITHOUT_CHILDREN:
return ::profiler::OFF;
}
return ::profiler::OFF;
}
const char* statusText(::profiler::EasyBlockStatus _status)
{
switch (_status)
{
case ::profiler::OFF:
return "OFF";
case ::profiler::ON:
return "ON";
case ::profiler::FORCE_ON:
return "FORCE_ON";
case ::profiler::OFF_RECURSIVE:
return "OFF_RECURSIVE";
case ::profiler::ON_WITHOUT_CHILDREN:
return "ON_WITHOUT_CHILDREN";
case ::profiler::FORCE_ON_WITHOUT_CHILDREN:
return "FORCE_ON_WITHOUT_CHILDREN";
}
return "";
}
::profiler::color_t statusColor(::profiler::EasyBlockStatus _status)
{
switch (_status)
{
case ::profiler::OFF:
return ::profiler::colors::Red900;
case ::profiler::ON:
return ::profiler::colors::LightGreen900;
case ::profiler::FORCE_ON:
return ::profiler::colors::LightGreen900;
case ::profiler::OFF_RECURSIVE:
return ::profiler::colors::Red900;
case ::profiler::ON_WITHOUT_CHILDREN:
return ::profiler::colors::Lime900;
case ::profiler::FORCE_ON_WITHOUT_CHILDREN:
return ::profiler::colors::Lime900;
}
return ::profiler::colors::Black;
}
//////////////////////////////////////////////////////////////////////////
EasyDescWidgetItem::EasyDescWidgetItem(::profiler::block_id_t _desc, Parent* _parent)
: Parent(_parent, QTreeWidgetItem::UserType)
, m_desc(_desc)
, m_type(EasyDescWidgetItem::Type::File)
{
}
EasyDescWidgetItem::~EasyDescWidgetItem()
{
}
bool EasyDescWidgetItem::operator < (const Parent& _other) const
{
const auto col = treeWidget()->sortColumn();
switch (col)
{
case DESC_COL_FILE_LINE:
{
if (parent() != nullptr)
return data(col, Qt::UserRole).toInt() < _other.data(col, Qt::UserRole).toInt();
}
}
return Parent::operator < (_other);
}
QVariant EasyDescWidgetItem::data(int _column, int _role) const
{
if (_column == DESC_COL_TYPE)
{
if (_role == Qt::ToolTipRole)
{
switch (m_type)
{
case Type::File: return QStringLiteral("File");
case Type::Event: return QStringLiteral("Event");
case Type::Block: return QStringLiteral("Block");
case Type::Value: return QStringLiteral("Arbitrary Value");
}
}
else if (_role == Qt::DisplayRole)
{
switch (m_type)
{
case Type::File: return QStringLiteral("F");
case Type::Event: return QStringLiteral("E");
case Type::Block: return QStringLiteral("B");
case Type::Value: return QStringLiteral("V");
}
}
}
return QTreeWidgetItem::data(_column, _role);
}
//////////////////////////////////////////////////////////////////////////
EasyDescTreeWidget::EasyDescTreeWidget(QWidget* _parent)
: Parent(_parent)
, m_lastFound(nullptr)
, m_lastSearchColumn(-1)
, m_searchColumn(DESC_COL_NAME)
, m_bLocked(false)
{
setAutoFillBackground(false);
setAlternatingRowColors(true);
setItemsExpandable(true);
setAnimated(true);
setSortingEnabled(false);
setColumnCount(DESC_COL_COLUMNS_NUMBER);
setSelectionBehavior(QAbstractItemView::SelectRows);
auto header_item = new QTreeWidgetItem();
header_item->setText(DESC_COL_FILE_LINE, "File/Line");
header_item->setText(DESC_COL_TYPE, "Type");
header_item->setText(DESC_COL_NAME, "Name");
header_item->setText(DESC_COL_STATUS, "Status");
setHeaderItem(header_item);
connect(&EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::selectedBlockChanged, this, &This::onSelectedBlockChange);
connect(&EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::blockStatusChanged, this, &This::onBlockStatusChange);
connect(this, &Parent::itemExpanded, this, &This::onItemExpand);
connect(this, &Parent::itemDoubleClicked, this, &This::onDoubleClick);
connect(this, &Parent::currentItemChanged, this, &This::onCurrentItemChange);
loadSettings();
setItemDelegateForColumn(0, new EasyTreeViewFirstColumnItemDelegate(this));
}
EasyDescTreeWidget::~EasyDescTreeWidget()
{
if (::profiler_gui::is_max(EASY_GLOBALS.selected_block) && !::profiler_gui::is_max(EASY_GLOBALS.selected_block_id))
{
::profiler_gui::set_max(EASY_GLOBALS.selected_block_id);
emit EASY_GLOBALS.events.refreshRequired();
}
saveSettings();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::setSearchColumn(int column)
{
m_searchColumn = column;
}
int EasyDescTreeWidget::searchColumn() const
{
return m_searchColumn;
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::contextMenuEvent(QContextMenuEvent* _event)
{
_event->accept();
QMenu menu;
menu.setToolTipsVisible(true);
auto action = menu.addAction("Expand all");
action->setIcon(QIcon(imagePath("expand")));
connect(action, &QAction::triggered, this, &This::expandAll);
action = menu.addAction("Collapse all");
action->setIcon(QIcon(imagePath("collapse")));
connect(action, &QAction::triggered, this, &This::collapseAll);
auto item = currentItem();
if (item != nullptr && item->parent() != nullptr && currentColumn() >= DESC_COL_TYPE)
{
const auto& desc = easyDescriptor(static_cast<EasyDescWidgetItem*>(item)->desc());
menu.addSeparator();
auto submenu = menu.addMenu("Change status");
submenu->setToolTipsVisible(true);
#define ADD_STATUS_ACTION(NameValue, StatusValue, ToolTipValue)\
action = submenu->addAction(NameValue);\
action->setCheckable(true);\
action->setChecked(desc.status() == StatusValue);\
action->setData(static_cast<quint32>(StatusValue));\
action->setToolTip(ToolTipValue);\
connect(action, &QAction::triggered, this, &This::onBlockStatusChangeClicked)
ADD_STATUS_ACTION("Off", ::profiler::OFF, "Do not profile this block.");
ADD_STATUS_ACTION("On", ::profiler::ON, "Profile this block\nif parent enabled children.");
ADD_STATUS_ACTION("Force-On", ::profiler::FORCE_ON, "Always profile this block even\nif it's parent disabled children.");
ADD_STATUS_ACTION("Off-recursive", ::profiler::OFF_RECURSIVE, "Do not profile neither this block\nnor it's children.");
ADD_STATUS_ACTION("On-without-children", ::profiler::ON_WITHOUT_CHILDREN, "Profile this block, but\ndo not profile it's children.");
ADD_STATUS_ACTION("Force-On-without-children", ::profiler::FORCE_ON_WITHOUT_CHILDREN, "Always profile this block, but\ndo not profile it's children.");
#undef ADD_STATUS_ACTION
submenu->setEnabled(EASY_GLOBALS.connected);
if (!EASY_GLOBALS.connected)
submenu->setTitle(QString("%1 (connection needed)").arg(submenu->title()));
}
menu.exec(QCursor::pos());
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::clearSilent(bool _global)
{
const QSignalBlocker b(this);
setSortingEnabled(false);
m_lastFound = nullptr;
m_lastSearch.clear();
m_highlightItems.clear();
m_items.clear();
::std::vector<QTreeWidgetItem*> topLevelItems;
topLevelItems.reserve(topLevelItemCount());
for (int i = topLevelItemCount() - 1; i >= 0; --i)
{
const bool expanded = !_global && topLevelItem(i)->isExpanded();
auto item = takeTopLevelItem(i);
if (expanded)
m_expandedFilesTemp.insert(item->text(DESC_COL_FILE_LINE).toStdString());
topLevelItems.push_back(item);
}
auto deleter_thread = ::std::thread([](decltype(topLevelItems) _items)
{
#ifdef _WIN32
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST);
#endif
for (auto item : _items)
delete item;
}, ::std::move(topLevelItems));
deleter_thread.detach();
//clear();
}
//////////////////////////////////////////////////////////////////////////
struct FileItems
{
using Items = ::std::unordered_map<int, EasyDescWidgetItem*, ::estd::hash<int> >;
Items children;
QTreeWidgetItem* item = nullptr;
};
void EasyDescTreeWidget::build()
{
auto f = font();
f.setBold(true);
typedef ::std::unordered_map<::std::string, FileItems> Files;
Files fileItems;
m_items.resize(EASY_GLOBALS.descriptors.size());
memset(m_items.data(), 0, sizeof(void*) * m_items.size());
const QSignalBlocker b(this);
::profiler::block_id_t id = 0;
for (auto desc : EASY_GLOBALS.descriptors)
{
if (desc != nullptr)
{
auto& p = fileItems[desc->file()];
if (p.item == nullptr)
{
auto item = new EasyDescWidgetItem(0);
item->setText(DESC_COL_FILE_LINE, QString(desc->file()).remove(QRegExp("^(\\.{2}\\\\+|\\/+)+")));
item->setType(EasyDescWidgetItem::Type::File);
p.item = item;
}
auto it = p.children.find(desc->line());
if (it == p.children.end())
{
auto item = new EasyDescWidgetItem(desc->id(), p.item);
item->setText(DESC_COL_FILE_LINE, QString::number(desc->line()));
item->setData(DESC_COL_FILE_LINE, Qt::UserRole, desc->line());
item->setText(DESC_COL_NAME, desc->name());
switch (desc->type())
{
case ::profiler::BlockType::Block:
item->setType(EasyDescWidgetItem::Type::Block);
break;
case ::profiler::BlockType::Event:
item->setType(EasyDescWidgetItem::Type::Event);
break;
case ::profiler::BlockType::Value:
item->setType(EasyDescWidgetItem::Type::Value);
break;
}
item->setFont(DESC_COL_STATUS, f);
item->setText(DESC_COL_STATUS, statusText(desc->status()));
item->setForeground(DESC_COL_STATUS, QColor::fromRgba(statusColor(desc->status())));
m_items[id] = item;
p.children.insert(::std::make_pair(desc->line(), item));
}
else
{
m_items[id] = it->second;
}
}
++id;
}
for (auto& p : fileItems)
{
addTopLevelItem(p.second.item);
if (m_expandedFilesTemp.find(p.first) != m_expandedFilesTemp.end())
p.second.item->setExpanded(true);
}
m_expandedFilesTemp.clear();
setSortingEnabled(true);
sortByColumn(DESC_COL_FILE_LINE, Qt::AscendingOrder);
resizeColumnsToContents();
QTimer::singleShot(100, [this](){ onSelectedBlockChange(EASY_GLOBALS.selected_block); });
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onItemExpand(QTreeWidgetItem*)
{
resizeColumnsToContents();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onDoubleClick(QTreeWidgetItem* _item, int _column)
{
if (!EASY_GLOBALS.connected)
return;
if (_column >= DESC_COL_TYPE && _item->parent() != nullptr)
{
auto item = static_cast<EasyDescWidgetItem*>(_item);
auto& desc = easyDescriptor(item->desc());
desc.setStatus(nextStatus(desc.status()));
item->setText(DESC_COL_STATUS, statusText(desc.status()));
item->setForeground(DESC_COL_STATUS, QColor::fromRgba(statusColor(desc.status())));
m_bLocked = true;
emit EASY_GLOBALS.events.blockStatusChanged(desc.id(), desc.status());
m_bLocked = false;
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onCurrentItemChange(QTreeWidgetItem* _item, QTreeWidgetItem* _prev)
{
if (_prev != nullptr)
{
auto f = font();
for (int i = 0; i < DESC_COL_STATUS; ++i)
_prev->setFont(i, f);
}
if (_item != nullptr)
{
auto f = font();
f.setBold(true);
for (int i = 0; i < DESC_COL_STATUS; ++i)
_item->setFont(i, f);
if (::profiler_gui::is_max(EASY_GLOBALS.selected_block) && _item->parent() != nullptr)
{
const auto id = static_cast<EasyDescWidgetItem*>(_item)->desc();
if (EASY_GLOBALS.selected_block_id != id)
{
EASY_GLOBALS.selected_block_id = id;
emit EASY_GLOBALS.events.selectedBlockIdChanged(id);
}
}
}
else if (::profiler_gui::is_max(EASY_GLOBALS.selected_block) && !::profiler_gui::is_max(EASY_GLOBALS.selected_block_id))
{
::profiler_gui::set_max(EASY_GLOBALS.selected_block_id);
emit EASY_GLOBALS.events.selectedBlockIdChanged(EASY_GLOBALS.selected_block_id);
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onBlockStatusChangeClicked(bool _checked)
{
if (!_checked || !EASY_GLOBALS.connected)
return;
auto item = currentItem();
if (item == nullptr || item->parent() == nullptr)
return;
auto action = qobject_cast<QAction*>(sender());
if (action != nullptr)
{
auto& desc = easyDescriptor(static_cast<EasyDescWidgetItem*>(item)->desc());
desc.setStatus(static_cast<::profiler::EasyBlockStatus>(action->data().toUInt()));
item->setText(DESC_COL_STATUS, statusText(desc.status()));
item->setForeground(DESC_COL_STATUS, QColor::fromRgba(statusColor(desc.status())));
m_bLocked = true;
emit EASY_GLOBALS.events.blockStatusChanged(desc.id(), desc.status());
m_bLocked = false;
}
}
void EasyDescTreeWidget::onBlockStatusChange(::profiler::block_id_t _id, ::profiler::EasyBlockStatus _status)
{
if (m_bLocked)
return;
auto item = m_items[_id];
if (item == nullptr)
return;
auto& desc = easyDescriptor(item->desc());
item->setText(DESC_COL_STATUS, statusText(desc.status()));
item->setForeground(DESC_COL_STATUS, QColor::fromRgba(statusColor(desc.status())));
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::resizeColumnsToContents()
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
resizeColumnToContents(i);
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onSelectedBlockChange(uint32_t _block_index)
{
if (::profiler_gui::is_max(_block_index))
{
setCurrentItem(nullptr);
return;
}
auto item = m_items[easyBlocksTree(_block_index).node->id()];
if (item == nullptr)
return;
scrollToItem(item, QAbstractItemView::PositionAtCenter);
setCurrentItem(item);
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::resetHighlight()
{
for (auto item : m_highlightItems) {
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackground(i, Qt::NoBrush);
}
m_highlightItems.clear();
}
void EasyDescTreeWidget::loadSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
auto val = settings.value("searchColumn");
if (!val.isNull())
m_searchColumn = val.toInt();
settings.endGroup();
}
void EasyDescTreeWidget::saveSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
settings.setValue("searchColumn", m_searchColumn);
settings.endGroup();
}
//////////////////////////////////////////////////////////////////////////
int EasyDescTreeWidget::findNext(const QString& _str, Qt::MatchFlags _flags)
{
if (_str.isEmpty())
{
resetHighlight();
m_lastSearchColumn = m_searchColumn;
return 0;
}
const bool isNewSearch = (m_lastSearchColumn != m_searchColumn || m_lastSearch != _str);
auto itemsList = findItems(_str, Qt::MatchContains | Qt::MatchRecursive | _flags, m_searchColumn);
if (!isNewSearch)
{
if (!itemsList.empty())
{
bool stop = false;
decltype(m_lastFound) next = nullptr;
for (auto item : itemsList)
{
if (stop)
{
next = item;
break;
}
stop = item == m_lastFound;
}
m_lastFound = next == nullptr ? itemsList.front() : next;
}
else
{
m_lastFound = nullptr;
}
}
else
{
resetHighlight();
m_lastSearchColumn = m_searchColumn;
m_lastSearch = _str;
m_lastFound = !itemsList.empty() ? itemsList.front() : nullptr;
for (auto item : itemsList)
{
m_highlightItems.push_back(item);
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackgroundColor(i, QColor::fromRgba(0x80000000 | (0x00ffffff & ::profiler::colors::Yellow)));
}
}
if (m_lastFound != nullptr)
{
scrollToItem(m_lastFound, QAbstractItemView::PositionAtCenter);
setCurrentItem(m_lastFound);
}
return itemsList.size();
}
int EasyDescTreeWidget::findPrev(const QString& _str, Qt::MatchFlags _flags)
{
if (_str.isEmpty())
{
resetHighlight();
m_lastSearchColumn = m_searchColumn;
return 0;
}
const bool isNewSearch = (m_lastSearchColumn != m_searchColumn || m_lastSearch != _str);
auto itemsList = findItems(_str, Qt::MatchContains | Qt::MatchRecursive | _flags, m_searchColumn);
if (!isNewSearch)
{
if (!itemsList.empty())
{
decltype(m_lastFound) prev = nullptr;
for (auto item : itemsList)
{
if (item == m_lastFound)
break;
prev = item;
}
m_lastFound = prev == nullptr ? itemsList.back() : prev;
}
else
{
m_lastFound = nullptr;
}
}
else
{
resetHighlight();
m_lastSearchColumn = m_searchColumn;
m_lastSearch = _str;
m_lastFound = !itemsList.empty() ? itemsList.front() : nullptr;
m_highlightItems.reserve(itemsList.size());
for (auto item : itemsList)
{
m_highlightItems.push_back(item);
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackgroundColor(i, QColor::fromRgba(0x80000000 | (0x00ffffff & ::profiler::colors::Yellow)));
}
}
if (m_lastFound != nullptr)
{
scrollToItem(m_lastFound, QAbstractItemView::PositionAtCenter);
setCurrentItem(m_lastFound);
}
return itemsList.size();
}
//////////////////////////////////////////////////////////////////////////
EasyDescWidget::EasyDescWidget(QWidget* _parent) : Parent(_parent)
, m_tree(new EasyDescTreeWidget(this))
, m_values(new EasyArbitraryValuesWidget(this))
, m_searchBox(new QLineEdit(this))
, m_foundNumber(new QLabel("Found 0 matches", this))
, m_searchButton(nullptr)
, m_bCaseSensitiveSearch(false)
{
loadSettings();
m_searchBox->setFixedWidth(300);
m_searchBox->setContentsMargins(5, 0, 0, 0);
auto tb = new QToolBar(this);
tb->setIconSize(::profiler_gui::ICONS_SIZE);
auto refreshButton = tb->addAction(QIcon(imagePath("reload")), tr("Refresh blocks list"));
refreshButton->setEnabled(EASY_GLOBALS.connected);
refreshButton->setToolTip(tr("Refresh blocks list.\nConnection needed."));
connect(refreshButton, &QAction::triggered, &EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::blocksRefreshRequired);
auto menu = new QMenu(this);
m_searchButton = menu->menuAction();
m_searchButton->setText("Find next");
m_searchButton->setIcon(QIcon(imagePath("find-next")));
m_searchButton->setData(true);
connect(m_searchButton, &QAction::triggered, this, &This::findNext);
auto actionGroup = new QActionGroup(this);
actionGroup->setExclusive(true);
auto a = new QAction(tr("Find next"), actionGroup);
a->setCheckable(true);
a->setChecked(true);
connect(a, &QAction::triggered, this, &This::findNextFromMenu);
menu->addAction(a);
a = new QAction(tr("Find previous"), actionGroup);
a->setCheckable(true);
connect(a, &QAction::triggered, this, &This::findPrevFromMenu);
menu->addAction(a);
a = menu->addAction("Case sensitive");
a->setCheckable(true);
a->setChecked(m_bCaseSensitiveSearch);
connect(a, &QAction::triggered, [this](bool _checked){ m_bCaseSensitiveSearch = _checked; });
menu->addAction(a);
menu->addSeparator();
auto headerItem = m_tree->headerItem();
actionGroup = new QActionGroup(this);
actionGroup->setExclusive(true);
for (int i = 0; i < DESC_COL_STATUS; ++i)
{
if (i == DESC_COL_TYPE)
continue;
a = new QAction(QStringLiteral("Search by ") + headerItem->text(i), actionGroup);
a->setData(i);
a->setCheckable(true);
if (i == m_tree->searchColumn())
a->setChecked(true);
connect(a, &QAction::triggered, this, &This::onSearchColumnChange);
menu->addAction(a);
}
tb->addSeparator();
tb->addAction(m_searchButton);
tb->addWidget(m_searchBox);
auto searchbox = new QHBoxLayout();
searchbox->setContentsMargins(0, 0, 5, 0);
searchbox->addWidget(tb);
searchbox->addStretch(100);
searchbox->addWidget(m_foundNumber, Qt::AlignRight);
auto lay = new QVBoxLayout(this);
lay->setContentsMargins(1, 1, 1, 1);
lay->addLayout(searchbox);
lay->addWidget(m_tree);
lay->addWidget(m_values);
connect(m_searchBox, &QLineEdit::returnPressed, this, &This::onSeachBoxReturnPressed);
connect(&EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::connectionChanged, refreshButton, &QAction::setEnabled);
}
EasyDescWidget::~EasyDescWidget()
{
saveSettings();
}
void EasyDescWidget::loadSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("EasyDescWidget");
auto val = settings.value("case_sensitive");
if (!val.isNull())
m_bCaseSensitiveSearch = val.toBool();
settings.endGroup();
}
void EasyDescWidget::saveSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("EasyDescWidget");
settings.setValue("case_sensitive", m_bCaseSensitiveSearch);
settings.endGroup();
}
void EasyDescWidget::keyPressEvent(QKeyEvent* _event)
{
if (_event->key() == Qt::Key_F3)
{
if (_event->modifiers() & Qt::ShiftModifier)
findPrev(true);
else
findNext(true);
}
_event->accept();
}
void EasyDescWidget::contextMenuEvent(QContextMenuEvent* _event)
{
m_tree->contextMenuEvent(_event);
}
void EasyDescWidget::build()
{
m_tree->clearSilent(false);
m_foundNumber->setText(QString("Found 0 matches"));
m_tree->build();
m_values->rebuild();
}
void EasyDescWidget::clear()
{
m_tree->clearSilent(true);
m_foundNumber->setText(QString("Found 0 matches"));
m_values->clear();
}
void EasyDescWidget::onSeachBoxReturnPressed()
{
if (m_searchButton->data().toBool() == true)
findNext(true);
else
findPrev(true);
}
void EasyDescWidget::onSearchColumnChange(bool)
{
auto action = qobject_cast<QAction*>(sender());
if (action != nullptr)
m_tree->setSearchColumn(action->data().toInt());
}
void EasyDescWidget::findNext(bool)
{
auto matches = m_tree->findNext(m_searchBox->text(), m_bCaseSensitiveSearch ? Qt::MatchCaseSensitive : Qt::MatchFlags());
if (matches == 1)
m_foundNumber->setText(QString("Found 1 match"));
else
m_foundNumber->setText(QString("Found %1 matches").arg(matches));
}
void EasyDescWidget::findPrev(bool)
{
auto matches = m_tree->findPrev(m_searchBox->text(), m_bCaseSensitiveSearch ? Qt::MatchCaseSensitive : Qt::MatchFlags());
if (matches == 1)
m_foundNumber->setText(QString("Found 1 match"));
else
m_foundNumber->setText(QString("Found %1 matches").arg(matches));
}
void EasyDescWidget::findNextFromMenu(bool _checked)
{
if (!_checked)
return;
if (m_searchButton->data().toBool() == false)
{
m_searchButton->setData(true);
m_searchButton->setText(tr("Find next"));
m_searchButton->setIcon(QIcon(imagePath("find-next")));
disconnect(m_searchButton, &QAction::triggered, this, &This::findPrev);
connect(m_searchButton, &QAction::triggered, this, &This::findNext);
}
findNext(true);
}
void EasyDescWidget::findPrevFromMenu(bool _checked)
{
if (!_checked)
return;
if (m_searchButton->data().toBool() == true)
{
m_searchButton->setData(false);
m_searchButton->setText(tr("Find prev"));
m_searchButton->setIcon(QIcon(imagePath("find-prev")));
disconnect(m_searchButton, &QAction::triggered, this, &This::findNext);
connect(m_searchButton, &QAction::triggered, this, &This::findPrev);
}
findPrev(true);
}
//////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,234 @@
/************************************************************************
* file name : descriptors_tree_widget.h
* ----------------- :
* creation time : 2016/09/17
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of EasyDescTreeWidget and it's auxiliary classes
* : for displyaing EasyProfiler blocks descriptors tree.
* ----------------- :
* change log : * 2016/09/17 Victor Zarubkin: initial commit.
* :
* : *
* ----------------- :
* license : Lightweight profiler library for c++
* : Copyright(C) 2016-2017 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.
************************************************************************/
#ifndef EASY_DESCRIPTORS_WIDGET_H
#define EASY_DESCRIPTORS_WIDGET_H
#include <QTreeWidget>
#include <QStyledItemDelegate>
#include <QString>
#include <vector>
#include <unordered_set>
#include <easy/details/profiler_public_types.h>
//////////////////////////////////////////////////////////////////////////
class EasyDescWidgetItem : public QTreeWidgetItem
{
using Parent = QTreeWidgetItem;
using This = EasyDescWidgetItem;
public:
enum class Type : uint8_t
{
File,
Event,
Block,
Value
};
private:
::profiler::block_id_t m_desc;
Type m_type;
public:
explicit EasyDescWidgetItem(::profiler::block_id_t _desc, Parent* _parent = nullptr);
virtual ~EasyDescWidgetItem();
bool operator < (const Parent& _other) const override;
QVariant data(int _column, int _role) const override;
public:
// Public inline methods
inline ::profiler::block_id_t desc() const
{
return m_desc;
}
inline void setType(Type _type)
{
m_type = _type;
}
}; // END of class EasyDescWidgetItem.
//////////////////////////////////////////////////////////////////////////
class EasyDescTreeWidget : public QTreeWidget
{
Q_OBJECT
typedef QTreeWidget Parent;
typedef EasyDescTreeWidget This;
typedef ::std::vector<EasyDescWidgetItem*> Items;
typedef ::std::vector<QTreeWidgetItem*> TreeItems;
typedef ::std::unordered_set<::std::string> ExpandedFiles;
protected:
ExpandedFiles m_expandedFilesTemp;
Items m_items;
TreeItems m_highlightItems;
QString m_lastSearch;
QTreeWidgetItem* m_lastFound;
int m_lastSearchColumn;
int m_searchColumn;
bool m_bLocked;
public:
// Public virtual methods
explicit EasyDescTreeWidget(QWidget* _parent = nullptr);
virtual ~EasyDescTreeWidget();
void contextMenuEvent(QContextMenuEvent* _event) override;
public:
// Public non-virtual methods
int findNext(const QString& _str, Qt::MatchFlags _flags);
int findPrev(const QString& _str, Qt::MatchFlags _flags);
void setSearchColumn(int column);
int searchColumn() const;
public slots:
void clearSilent(bool _global = false);
void build();
private slots:
void onBlockStatusChangeClicked(bool);
void onCurrentItemChange(QTreeWidgetItem* _item, QTreeWidgetItem* _prev);
void onItemExpand(QTreeWidgetItem* _item);
void onDoubleClick(QTreeWidgetItem* _item, int _column);
void onSelectedBlockChange(uint32_t _block_index);
void onBlockStatusChange(::profiler::block_id_t _id, ::profiler::EasyBlockStatus _status);
void resizeColumnsToContents();
private:
// Private methods
void resetHighlight();
void loadSettings();
void saveSettings();
}; // END of class EasyDescTreeWidget.
//////////////////////////////////////////////////////////////////////////
class EasyDescWidget : public QWidget
{
Q_OBJECT
typedef QWidget Parent;
typedef EasyDescWidget This;
private:
EasyDescTreeWidget* m_tree;
class EasyArbitraryValuesWidget* m_values;
class QLineEdit* m_searchBox;
class QLabel* m_foundNumber;
class QAction* m_searchButton;
bool m_bCaseSensitiveSearch;
public:
// Public virtual methods
explicit EasyDescWidget(QWidget* _parent = nullptr);
virtual ~EasyDescWidget();
void keyPressEvent(QKeyEvent* _event) override;
void contextMenuEvent(QContextMenuEvent* _event) override;
public:
// Public non-virtual methods
void build();
void clear();
private slots:
void onSeachBoxReturnPressed();
void findNext(bool);
void findPrev(bool);
void findNextFromMenu(bool);
void findPrevFromMenu(bool);
void onSearchColumnChange(bool);
private:
// Private non-virtual slots
void loadSettings();
void saveSettings();
}; // END of class EasyDescWidget.
//////////////////////////////////////////////////////////////////////////
#endif // EASY_DESCRIPTORS_WIDGET_H

Some files were not shown because too many files have changed in this diff Show More