From d13096105db38325fdc4d68b5130d52e49a4fc2b Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:47:00 +0100 Subject: [PATCH 01/10] Create Build Thunder on Windows.yml --- .../workflows/Build Thunder on Windows.yml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/Build Thunder on Windows.yml diff --git a/.github/workflows/Build Thunder on Windows.yml b/.github/workflows/Build Thunder on Windows.yml new file mode 100644 index 000000000..e753c0530 --- /dev/null +++ b/.github/workflows/Build Thunder on Windows.yml @@ -0,0 +1,73 @@ +name: Build Thunder on Windows + +# CHANGE TO MASTER +on: + push: + branches: ["development/update-windows-build"] + pull_request: + branches: ["development/update-windows-build"] + workflow_call: + +env: + bridge: D:\a\Thunder\Thunder\Thunder\Source\WPEFramework\bridge.vcxproj + comProcess: D:\a\Thunder\Thunder\Thunder\Source\WPEProcess\comprocess.vcxproj + devEnv: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com + solution: D:\a\Thunder\Thunder\Thunder.sln + +jobs: + build: + runs-on: windows-latest + + strategy: + matrix: + build_type: ["Debug|x64", "Debug|x86", "Release|x64", "Release|x86"] + + steps: + - name: Checkout ThunderOnWindows + uses: actions/checkout@v3 + with: + repository: ${{github.repository_owner}}/ThunderOnWindows + + - name: Checkout Thunder + uses: actions/checkout@v3 + with: + path: Thunder + repository: ${{github.repository_owner}}/Thunder + + - name: Checkout ThunderClientLibraries + uses: actions/checkout@v3 + with: + path: ThunderClientLibraries + repository: ${{github.repository_owner}}/ThunderClientLibraries + + - name: Checkout ThunderInterfaces + uses: actions/checkout@v3 + with: + path: ThunderInterfaces + repository: ${{github.repository_owner}}/ThunderInterfaces + + - name: Checkout ThunderNanoServices + uses: actions/checkout@v3 + with: + path: ThunderNanoServices + repository: ${{github.repository_owner}}/ThunderNanoServices + +# CHANGE REPO OWNER + - name: Checkout ThunderNanoServicesRDK + uses: actions/checkout@v3 + with: + path: ThunderNanoServicesRDK + repository: VeithMetro/ThunderNanoServicesRDK + + - name: Install jsonref + run: pip install jsonref + + - name: Build Thunder + shell: cmd + run: | + "%devEnv%" /Build "${{matrix.build_type}}" "%solution%" +# - name: Build Thunder +# shell: cmd +# run: | +# "%devEnv%" /Build "Debug|x64" /Project "%bridge%" "%solution%" +# "%devEnv%" /Build "Debug|x64" /Project "%comProcess%" "%solution%" From 16dfa193d2660978d573fd78e6170ddca613a69a Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:52:16 +0100 Subject: [PATCH 02/10] Update plugins.vcxproj --- Source/plugins/plugins.vcxproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/plugins/plugins.vcxproj b/Source/plugins/plugins.vcxproj index 48566fc86..4a9e979b9 100644 --- a/Source/plugins/plugins.vcxproj +++ b/Source/plugins/plugins.vcxproj @@ -39,6 +39,7 @@ + @@ -229,4 +230,4 @@ - \ No newline at end of file + From 84c08fbfaa73d0069293c6a19906eedf85cb1a06 Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:54:40 +0100 Subject: [PATCH 03/10] Update tracing.vcxproj --- Source/tracing/tracing.vcxproj | 198 ++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 1 deletion(-) diff --git a/Source/tracing/tracing.vcxproj b/Source/tracing/tracing.vcxproj index ddd977f41..40a911ead 100644 --- a/Source/tracing/tracing.vcxproj +++ b/Source/tracing/tracing.vcxproj @@ -194,4 +194,200 @@ - \ No newline at end of file + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + 15.0 + {6838AFCB-D65D-443A-A435-2F1940790836} + Win32Proj + tracing + 10.0 + + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + false + $(SolutionDir)..\artifacts\$(Configuration)\ + $(OutDir)WebBridge\$(TargetName)\ + + + true + $(SolutionDir)..\artifacts\$(Configuration)\ + $(OutDir)WebBridge\$(TargetName)\ + + + true + $(SolutionDir)..\artifacts\$(Configuration)\ + $(OutDir)WebBridge\$(TargetName)\ + + + false + $(SolutionDir)..\artifacts\$(Configuration)\ + $(OutDir)WebBridge\$(TargetName)\ + + + + NotUsing + Level3 + MaxSpeed + true + true + true + _CRT_SECURE_NO_WARNINGS;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(FrameworkPath);$(WindowsPath) + true + + + Windows + true + true + true + $(OutDir) + $(IntDir)$(TargetName).pdb + + + + + NotUsing + Level3 + Disabled + true + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(FrameworkPath);$(WindowsPath) + true + + + Windows + true + $(OutDir) + $(IntDir)$(TargetName).pdb + + + + + NotUsing + Level3 + Disabled + true + _CRT_SECURE_NO_WARNINGS;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(FrameworkPath);$(WindowsPath) + true + + + Windows + true + $(OutDir) + $(IntDir)$(TargetName).pdb + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(FrameworkPath);$(WindowsPath) + true + + + Windows + true + true + true + $(OutDir) + $(IntDir)$(TargetName).pdb + + + + + + From dacb165005f74ebb349ccb63e0113cf7c4879d61 Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:55:35 +0100 Subject: [PATCH 04/10] Update tracing.vcxproj.filters --- Source/tracing/tracing.vcxproj.filters | 69 +++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/Source/tracing/tracing.vcxproj.filters b/Source/tracing/tracing.vcxproj.filters index 3b1dfe103..e85ea4308 100644 --- a/Source/tracing/tracing.vcxproj.filters +++ b/Source/tracing/tracing.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -63,4 +63,69 @@ Source Files - \ No newline at end of file + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + From 69eb4a7c6c2abe56a465026c55177d8c610e15ef Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 11:18:04 +0100 Subject: [PATCH 05/10] Update Build Thunder on Windows.yml --- .github/workflows/Build Thunder on Windows.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/Build Thunder on Windows.yml b/.github/workflows/Build Thunder on Windows.yml index e753c0530..d7d02db4b 100644 --- a/.github/workflows/Build Thunder on Windows.yml +++ b/.github/workflows/Build Thunder on Windows.yml @@ -22,34 +22,40 @@ jobs: matrix: build_type: ["Debug|x64", "Debug|x86", "Release|x64", "Release|x86"] +# CHANGE THE BRANCHES steps: - name: Checkout ThunderOnWindows uses: actions/checkout@v3 with: + ref: development/update-windows-build repository: ${{github.repository_owner}}/ThunderOnWindows - name: Checkout Thunder uses: actions/checkout@v3 with: path: Thunder + ref: development/update-windows-build repository: ${{github.repository_owner}}/Thunder - name: Checkout ThunderClientLibraries uses: actions/checkout@v3 with: path: ThunderClientLibraries + ref: development/update-windows-build repository: ${{github.repository_owner}}/ThunderClientLibraries - name: Checkout ThunderInterfaces uses: actions/checkout@v3 with: path: ThunderInterfaces + ref: development/update-windows-build repository: ${{github.repository_owner}}/ThunderInterfaces - name: Checkout ThunderNanoServices uses: actions/checkout@v3 with: path: ThunderNanoServices + ref: development/update-windows-build repository: ${{github.repository_owner}}/ThunderNanoServices # CHANGE REPO OWNER @@ -57,6 +63,7 @@ jobs: uses: actions/checkout@v3 with: path: ThunderNanoServicesRDK + ref: development/update-windows-build repository: VeithMetro/ThunderNanoServicesRDK - name: Install jsonref From a9e39f874e8992665109d56535f3fa84cf8a23d2 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Wed, 15 Feb 2023 13:20:57 +0100 Subject: [PATCH 06/10] Removing tracing --- Source/CMakeLists.txt | 4 +- Source/tracing/CMakeLists.txt | 75 --- Source/tracing/ITraceControl.h | 51 -- Source/tracing/ITraceMedia.h | 35 -- Source/tracing/Logging.cpp | 147 ------ Source/tracing/Logging.h | 425 ---------------- Source/tracing/Module.cpp | 22 - Source/tracing/Module.h | 32 -- Source/tracing/TraceCategories.cpp | 31 -- Source/tracing/TraceCategories.h | 641 ------------------------- Source/tracing/TraceControl.h | 222 --------- Source/tracing/TraceMedia.cpp | 162 ------- Source/tracing/TraceMedia.h | 115 ----- Source/tracing/TraceUnit.cpp | 363 -------------- Source/tracing/TraceUnit.h | 264 ---------- Source/tracing/tracing.h | 18 +- Source/tracing/tracing.vcxproj | 393 --------------- Source/tracing/tracing.vcxproj.filters | 131 ----- 18 files changed, 3 insertions(+), 3128 deletions(-) delete mode 100644 Source/tracing/CMakeLists.txt delete mode 100644 Source/tracing/ITraceControl.h delete mode 100644 Source/tracing/ITraceMedia.h delete mode 100644 Source/tracing/Logging.cpp delete mode 100644 Source/tracing/Logging.h delete mode 100644 Source/tracing/Module.cpp delete mode 100644 Source/tracing/Module.h delete mode 100644 Source/tracing/TraceCategories.cpp delete mode 100644 Source/tracing/TraceCategories.h delete mode 100644 Source/tracing/TraceControl.h delete mode 100644 Source/tracing/TraceMedia.cpp delete mode 100644 Source/tracing/TraceMedia.h delete mode 100644 Source/tracing/TraceUnit.cpp delete mode 100644 Source/tracing/TraceUnit.h delete mode 100644 Source/tracing/tracing.vcxproj delete mode 100644 Source/tracing/tracing.vcxproj.filters diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 64de50e18..067ac28bf 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -25,9 +25,9 @@ option(CRYPTALGO option(WEBSOCKET "Include the websocket library." ON) option(TRACING - "Include the tracing library." ON) + "Include the tracing library." OFF) option(MESSAGING - "Include the messaging library." OFF) + "Include the messaging library." ON) option(PROFILER "Include the profiler library." OFF) option(COM diff --git a/Source/tracing/CMakeLists.txt b/Source/tracing/CMakeLists.txt deleted file mode 100644 index d30e5df9d..000000000 --- a/Source/tracing/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ -# If not stated otherwise in this file or this component's license file the -# following copyright and licenses apply: -# -# Copyright 2020 Metrological -# -# Licensed under 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. - -set(TARGET ${NAMESPACE}Tracing) - -add_library(${TARGET} SHARED - Module.cpp - TraceCategories.cpp - TraceMedia.cpp - TraceUnit.cpp - Logging.cpp - ) - -set(PUBLIC_HEADERS - ITraceControl.h - ITraceMedia.h - TraceCategories.h - TraceControl.h - TraceMedia.h - TraceUnit.h - Logging.h - tracing.h - Module.h - ) - -target_compile_definitions(${TARGET} PRIVATE TRACING_EXPORTS) - -target_link_libraries(${TARGET} - PUBLIC - ${NAMESPACE}Core::${NAMESPACE}Core - PRIVATE - CompileSettingsDebug::CompileSettingsDebug - ) - -set_target_properties(${TARGET} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED YES - FRAMEWORK FALSE - PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR} - ) - -target_include_directories( ${TARGET} - PUBLIC - $ - $ - $ - ) - -install( - TARGETS ${TARGET} EXPORT ${TARGET}Targets # for downstream dependencies - ARCHIVE DESTINATION lib COMPONENT libs # static lib - LIBRARY DESTINATION lib COMPONENT libs # shared lib - RUNTIME DESTINATION bin COMPONENT libs # binaries - FRAMEWORK DESTINATION bin COMPONENT libs # for mac - PUBLIC_HEADER DESTINATION include/${NAMESPACE}/tracing COMPONENT devel # headers for mac (note the different component -> different package) - INCLUDES DESTINATION include/${NAMESPACE} # default include path -) - -InstallCMakeConfig(TARGETS ${TARGET}) diff --git a/Source/tracing/ITraceControl.h b/Source/tracing/ITraceControl.h deleted file mode 100644 index 958fcaed6..000000000 --- a/Source/tracing/ITraceControl.h +++ /dev/null @@ -1,51 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __ITRACECONTROL_H -#define __ITRACECONTROL_H - -// ---- Include system wide include files ---- - -// ---- Include local include files ---- -#include "Module.h" - -namespace WPEFramework { -namespace Trace { - const uint16_t TRACINGBUFFERSIZE = 1024; - - struct ITraceControl { - virtual ~ITraceControl() = default; - virtual void Destroy() = 0; - virtual const char* Category() const = 0; - virtual const char* Module() const = 0; - virtual bool Enabled() const = 0; - virtual void Enabled(const bool enabled) = 0; - }; - - struct ITrace { - virtual ~ITrace() = default; - virtual const char* Category() const = 0; - virtual const char* Module() const = 0; - virtual const char* Data() const = 0; - virtual uint16_t Length() const = 0; - }; -} -} - -#endif // __ITRACECONTROL_H diff --git a/Source/tracing/ITraceMedia.h b/Source/tracing/ITraceMedia.h deleted file mode 100644 index 7c362ee00..000000000 --- a/Source/tracing/ITraceMedia.h +++ /dev/null @@ -1,35 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __ITRACEMEDIA_H -#define __ITRACEMEDIA_H - -#include "ITraceControl.h" -#include "Module.h" - -namespace WPEFramework { -namespace Trace { - struct EXTERNAL ITraceMedia { - virtual ~ITraceMedia() = default; - virtual void Output(const char fileName[], const uint32_t lineNumber, const char className[], const ITrace* information) = 0; - }; -} -} // namespace Trace - -#endif // __ITRACEMEDIA_H diff --git a/Source/tracing/Logging.cpp b/Source/tracing/Logging.cpp deleted file mode 100644 index e75f203df..000000000 --- a/Source/tracing/Logging.cpp +++ /dev/null @@ -1,147 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 "Logging.h" - -#ifndef __WINDOWS__ -#include -#endif - -#include - -namespace WPEFramework { -namespace Logging { - - template<> - /* static */ LoggingType::template LoggingControl LoggingType::s_LogControl; - template<> - /* static */ LoggingType::template LoggingControl LoggingType::s_LogControl; - template<> - /* static */ LoggingType::template LoggingControl LoggingType::s_LogControl; - - static const string LoggingToConsole(_T("LOGGING_TO_CONSOLE")); - - static bool DetectLoggingOutput() - { - string result; - - if (Core::SystemInfo::GetEnvironment(LoggingToConsole, result) == true) { - return (result[0] != '1'); - } - return (true); - } - - /* static */ const char* MODULE_LOGGING = _T("SysLog"); - static uint64_t _baseTime(Core::Time::Now().Ticks()); - static bool _syslogging = DetectLoggingOutput(); - - void SysLog(const bool toConsole) - { - _syslogging = !toConsole; - Core::SystemInfo::SetEnvironment(LoggingToConsole, (toConsole ? _T("1") : nullptr)); - } - - void SysLog(const char fileName[], const uint32_t lineNumber, const Trace::ITrace* information) - { - // Time to printf... - Core::Time now(Core::Time::Now()); - -#ifndef __WINDOWS__ - if (_syslogging == true) { - string time(now.ToRFC1123(true)); - syslog(LOG_NOTICE, "[%s]:[%s:%d]: %s: %s\n", time.c_str(), Core::FileNameOnly(fileName), lineNumber, information->Category(), information->Data()); - } else -#endif - { - printf("[%11ju us] %s\n", static_cast(now.Ticks() - _baseTime), information->Data()); - } - } - - static const TCHAR* UnknownCallsign = _T("NoTLSCallsign"); - - void DumpException(const string& exceptionType) { - uint8_t counter = 0; - std::list stack; - DumpCallStack(Core::Thread::ThreadId(), stack); - - #if defined(__CORE_EXCEPTION_CATCHING__) || defined(__CORE_WARNING_REPORTING__) - const TCHAR* callsign = Core::CallsignTLS::CallsignAccess<&UnknownCallsign>::Callsign(); - #else - const TCHAR* callsign = UnknownCallsign; - #endif - SYSLOG (Logging::Crash, (_T("-== Unhandled exception in: %s [%s] ==-\n"), callsign, exceptionType.c_str())); - for (const Core::callstack_info& entry : stack) { - if (entry.line != static_cast(~0)) { - SYSLOG(Logging::Crash, (Core::Format(_T("[%03d] [%p] %.30s %s [%d]"), counter, entry.address, entry.module.c_str(), entry.function.c_str(), entry.line))); - } - else { - SYSLOG(Logging::Crash, (Core::Format(_T("[%03d] [%p] %.30s %s"), counter, entry.address, entry.module.c_str(), entry.function.c_str()))); - } - counter++; - } - } - - void DumpSystemFiles(const Core::process_t pid) - { - static auto logProcPath = [](const std::string& path) - { - std::ifstream fileStream(path); - if (fileStream.is_open()) { - SYSLOG (Logging::Crash, ("-== %s ==-\n", path.c_str())); - std::string line; - while (std::getline(fileStream, line)) - { - SYSLOG (Logging::Crash, (line)); - } - } - }; - - logProcPath("/proc/meminfo"); - logProcPath("/proc/loadavg"); - - if (pid > 0) { - std::string procPath = std::string("/proc/") + std::to_string(pid) + "/status"; - logProcPath(procPath); - } - } - - #ifdef __CORE_EXCEPTION_CATCHING__ - namespace { - class ExceptionCatcher : Core::Thread::IExceptionCallback { - public: - ExceptionCatcher() - { - Core::Thread::ExceptionCallback(this); - } - ~ExceptionCatcher() override { - Core::Thread::ExceptionCallback(nullptr); - } - - void Exception(const string& message) override - { - DumpException(message); - } - }; - - static ExceptionCatcher exceptionCatcher; - - } - #endif -} -} // namespace PluginHost diff --git a/Source/tracing/Logging.h b/Source/tracing/Logging.h deleted file mode 100644 index b34b15512..000000000 --- a/Source/tracing/Logging.h +++ /dev/null @@ -1,425 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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. - */ - -#pragma once - -#include "ITraceControl.h" -#include "Module.h" -#include "TraceCategories.h" -#include "TraceUnit.h" - -#include - -namespace WPEFramework { -namespace Logging { - -#define SYSLOG(CATEGORY, PARAMETERS) \ - if (Logging::LoggingType::IsEnabled() == true) { \ - Logging::LoggingType __data__ PARAMETERS; \ - Logging::SysLog(__FILE__, __LINE__, &__data__); \ - } - -// Forward compatibility with messaging -#define SYSLOG_GLOBAL(CATEGORY, PARAMETERS) SYSLOG(CATEGORY, PARAMETERS) - - void EXTERNAL DumpException(const string& exceptionType); - void EXTERNAL DumpSystemFiles(const Core::process_t pid); - void EXTERNAL SysLog(const char filename[], const uint32_t line, const Trace::ITrace* data); - void EXTERNAL SysLog(const bool toConsole); - extern EXTERNAL const char* MODULE_LOGGING; - - class EXTERNAL Startup { - private: - Startup() = delete; - Startup(const Startup& a_Copy) = delete; - Startup& operator=(const Startup& a_RHS) = delete; - - public: - Startup(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Startup(const string& text) - : _text(Core::ToString(text)) - { - } - ~Startup() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Shutdown { - private: - Shutdown() = delete; - Shutdown(const Shutdown& a_Copy) = delete; - Shutdown& operator=(const Shutdown& a_RHS) = delete; - - public: - Shutdown(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Shutdown(const string& text) - : _text(Core::ToString(text)) - { - } - ~Shutdown() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Notification { - private: - Notification() = delete; - Notification(const Notification& a_Copy) = delete; - Notification& operator=(const Notification& a_RHS) = delete; - - public: - Notification(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Notification(const string& text) - : _text(Core::ToString(text)) - { - } - ~Notification() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Crash { - public: - Crash() = delete; - Crash(const Crash& a_Copy) = delete; - Crash& operator=(const Crash& a_RHS) = delete; - - Crash(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Crash(const string& text) - : _text(Core::ToString(text)) - { - } - ~Crash() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL ParsingError { - private: - ParsingError() = delete; - ParsingError(const ParsingError& a_Copy) = delete; - ParsingError& operator=(const ParsingError& a_RHS) = delete; - - public: - ParsingError(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit ParsingError(const string& text) - : _text(Core::ToString(text)) - { - } - ~ParsingError() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Error { - private: - Error() = delete; - Error(const Error& a_Copy) = delete; - Error& operator=(const Error& a_RHS) = delete; - - public: - Error(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Error(const string& text) - : _text(Core::ToString(text)) - { - } - ~Error() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Fatal { - private: - Fatal() = delete; - Fatal(const Fatal& a_Copy) = delete; - Fatal& operator=(const Fatal& a_RHS) = delete; - - public: - Fatal(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Fatal(const string& text) - : _text(Core::ToString(text)) - { - } - ~Fatal() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - template - class LoggingType : public Trace::ITrace { - private: - template - class LoggingControl : public Trace::ITraceControl { - private: - LoggingControl(const LoggingControl&) = delete; - LoggingControl& operator=(const LoggingControl&) = delete; - - public: - LoggingControl() - : m_CategoryName(Core::ClassNameOnly(typeid(CONTROLCATEGORY).name()).Text()) - , m_Enabled(0x02) - { - // Register Our trace control unit, so it can be influenced from the outside - // if nessecary.. - Trace::TraceUnit::Instance().Announce(*this); - - // Logs, by default, are enabled. - m_Enabled |= 0x01; - } - ~LoggingControl() override - { - Destroy(); - } - - public: - inline bool IsEnabled() const - { - return ((m_Enabled & 0x01) != 0); - } - virtual const char* Category() const - { - return (m_CategoryName.c_str()); - } - virtual const char* Module() const - { - return (Logging::MODULE_LOGGING); - } - virtual bool Enabled() const - { - return (IsEnabled()); - } - virtual void Enabled(const bool enabled) - { - m_Enabled = (m_Enabled & 0xFE) | (enabled ? 0x01 : 0x00); - } - virtual void Destroy() - { - if ((m_Enabled & 0x02) != 0) { - // Register Our trace control unit, so it can be influenced from the outside - // if nessecary.. - Trace::TraceUnit::Instance().Revoke(*this); - m_Enabled = 0; - } - } - - protected: - const string m_CategoryName; - uint8_t m_Enabled; - }; - - public: - LoggingType(const LoggingType&) = delete; - LoggingType& operator=(const LoggingType&) = delete; - - template - LoggingType(Args... args) - : _traceInfo(args...) - { - } - virtual ~LoggingType() = default; - - public: - // No dereference etc.. 1 straight line to enabled or not... Quick method.. - inline static bool IsEnabled() - { - return (s_LogControl.IsEnabled()); - } - - inline static void Enable(const bool status) - { - s_LogControl.Enabled(status); - } - - virtual const char* Category() const - { - return (s_LogControl.Category()); - } - - virtual const char* Module() const - { - return (s_LogControl.Module()); - } - - virtual bool Enabled() const - { - return (s_LogControl.Enabled()); - } - - virtual void Enabled(const bool enabled) - { - s_LogControl.Enabled(enabled); - } - - virtual void Destroy() - { - s_LogControl.Destroy(); - } - - virtual const char* Data() const - { - return (_traceInfo.Data()); - } - virtual uint16_t Length() const - { - return (_traceInfo.Length()); - } - - private: - CATEGORY _traceInfo; - static LoggingControl s_LogControl; - }; - - template - typename LoggingType::template LoggingControl LoggingType::s_LogControl; -} -} // namespace Logging diff --git a/Source/tracing/Module.cpp b/Source/tracing/Module.cpp deleted file mode 100644 index f68190136..000000000 --- a/Source/tracing/Module.cpp +++ /dev/null @@ -1,22 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 "Module.h" - -MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/Source/tracing/Module.h b/Source/tracing/Module.h deleted file mode 100644 index 14ec2612c..000000000 --- a/Source/tracing/Module.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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. - */ - -#pragma once - -#ifndef MODULE_NAME -#define MODULE_NAME Tracing -#endif - -#include - -#if defined(__WINDOWS__) && defined(TRACING_EXPORTS) -#undef EXTERNAL -#define EXTERNAL EXTERNAL_EXPORT -#endif - diff --git a/Source/tracing/TraceCategories.cpp b/Source/tracing/TraceCategories.cpp deleted file mode 100644 index 94a254a26..000000000 --- a/Source/tracing/TraceCategories.cpp +++ /dev/null @@ -1,31 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 "TraceCategories.h" - -// ---- Class Definition ---- -namespace WPEFramework { -namespace Trace { - - /* static */ const std::string Constructor::_text("Constructor called"); - /* static */ const std::string Destructor::_text("Destructor called"); - /* static */ const std::string CopyConstructor::_text("Copy Constructor called"); - /* static */ const std::string AssignmentOperator::_text("Assignment Operator called"); -} -} // namespace Trace diff --git a/Source/tracing/TraceCategories.h b/Source/tracing/TraceCategories.h deleted file mode 100644 index a316c469d..000000000 --- a/Source/tracing/TraceCategories.h +++ /dev/null @@ -1,641 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __TRACECATEGORIES_H -#define __TRACECATEGORIES_H - -// ---- Include local include files ---- -#include "Module.h" -#include "TraceControl.h" - -// ---- Referenced classes and types ---- - -// ---- Helper types and constants ---- -// ---- Helper functions ---- - -// ---- Class Definition ---- -namespace WPEFramework { -namespace Trace { - - // for backwards compatibility - template - inline void Format(string& dst, Args&&... args) { Core::Format(dst, std::forward(args)...); } - template - inline string Format(Args&&... args) { return Core::Format(std::forward(args)...); } - - class EXTERNAL Text { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Text(const Text& a_Copy) = delete; - Text& operator=(const Text& a_RHS) = delete; - - public: - inline Text() - { - } - inline Text(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - inline Text(const std::string& text) - : _text(Core::ToString(text.c_str())) - { - } - inline Text(const char text[]) - : _text(Core::ToString(text)) - { - } -#ifndef __CORE_NO_WCHAR_SUPPORT__ - inline Text(const std::wstring& text) - : _text(Core::ToString(text.c_str())) - { - } - inline Text(const wchar_t text[]) - : _text(Core::ToString(text)) - { - } -#endif - ~Text() - { - } - - inline void Set(const string& text) - { - _text = Core::ToString(text.c_str()); - } - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Constructor { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Constructor(const Constructor& a_Copy) = delete; - Constructor& operator=(const Constructor& a_RHS) = delete; - - public: - Constructor() - { - } - ~Constructor() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - static const std::string _text; - }; - - class EXTERNAL Destructor { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Destructor(const Destructor& a_Copy) = delete; - Destructor& operator=(const Destructor& a_RHS) = delete; - - public: - Destructor() - { - } - ~Destructor() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - static const std::string _text; - }; - - class EXTERNAL CopyConstructor { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - CopyConstructor(const CopyConstructor& a_Copy) = delete; - CopyConstructor& operator=(const CopyConstructor& a_RHS) = delete; - - public: - CopyConstructor() - { - } - ~CopyConstructor() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - static const std::string _text; - }; - - class EXTERNAL AssignmentOperator { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - AssignmentOperator(const AssignmentOperator& a_Copy) = delete; - AssignmentOperator& operator=(const AssignmentOperator& a_RHS) = delete; - - public: - AssignmentOperator() - { - } - ~AssignmentOperator() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - static const std::string _text; - }; - - class EXTERNAL MethodEntry { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - MethodEntry() = delete; - MethodEntry(const MethodEntry& a_Copy) = delete; - MethodEntry& operator=(const MethodEntry& a_RHS) = delete; - - public: -#ifndef __CORE_NO_WCHAR_SUPPORT__ - MethodEntry(const wchar_t MethodName[]) - : _text("Entered Method: ") - { - std::string secondPart; - Core::ToString(MethodName, secondPart); - _text += secondPart; - } -#endif - MethodEntry(const char MethodName[]) - : _text(std::string("Entered Method: ") + std::string(MethodName)) - { - } - ~MethodEntry() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL MethodExit { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - MethodExit() = delete; - MethodExit(const MethodExit& a_Copy) = delete; - MethodExit& operator=(const MethodExit& a_RHS) = delete; - - public: -#ifndef __CORE_NO_WCHAR_SUPPORT__ - MethodExit(const wchar_t MethodName[]) - : _text("Exit Method: ") - { - std::string secondPart; - Core::ToString(MethodName, secondPart); - _text += secondPart; - } -#endif - MethodExit(const char MethodName[]) - : _text(std::string("Exit Method: ") + std::string(MethodName)) - { - } - ~MethodExit() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Information { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Information() = delete; - Information(const Information& a_Copy) = delete; - Information& operator=(const Information& a_RHS) = delete; - - public: - Information(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Information(const string& text) - : _text(Core::ToString(text)) - { - } - ~Information() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Warning { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Warning() = delete; - Warning(const Warning& a_Copy) = delete; - Warning& operator=(const Warning& a_RHS) = delete; - - public: - Warning(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Warning(const string& text) - : _text(Core::ToString(text)) - { - } - ~Warning() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Error { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Error() = delete; - Error(const Error& a_Copy) = delete; - Error& operator=(const Error& a_RHS) = delete; - - public: - Error(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Error(const string& text) - : _text(Core::ToString(text)) - { - } - ~Error() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Fatal { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Fatal() = delete; - Fatal(const Fatal& a_Copy) = delete; - Fatal& operator=(const Fatal& a_RHS) = delete; - - public: - Fatal(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Fatal(const string& text) - : _text(Core::ToString(text)) - { - } - ~Fatal() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Initialisation { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Initialisation() = delete; - Initialisation(const Initialisation& a_Copy) = delete; - Initialisation& operator=(const Initialisation& a_RHS) = delete; - - public: - Initialisation(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Initialisation(const string& text) - : _text(Core::ToString(text)) - { - } - ~Initialisation() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Assert { - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statments. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - Assert(const Assert& a_Copy) = delete; - Assert& operator=(const Assert& a_RHS) = delete; - - public: - Assert() - : _text("Assertion: <>") - { - } - Assert(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - explicit Assert(const string& text) - : _text(std::string("Assertion: ") + (Core::ToString(text))) - { - } - ~Assert() - { - } - - public: - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - - private: - std::string _text; - }; - - class EXTERNAL Duration { - public: - Duration() = delete; - Duration(const Duration& a_Copy) = delete; - Duration& operator=(const Duration& a_RHS) = delete; - - Duration(const Core::Time& startTime, const TCHAR formatter[], ...) - : _text() - { - uint64_t duration(Core::Time::Now().Ticks() - startTime.Ticks()); - - std::string message; - - va_list ap; - va_start(ap, formatter); - Core::Format(message, formatter, ap); - va_end(ap); - - Message(_T("%" PRIu64 "us, %s"), duration, message.c_str()); - } - explicit Duration(const Core::Time& startTime) - : _text() - { - uint64_t duration(Core::Time::Now().Ticks() - startTime.Ticks()); - Message(_T("%" PRIu64 "us"), duration); - } - ~Duration() - { - } - inline const char* Data() const - { - return (_text.c_str()); - } - inline uint16_t Length() const - { - return (static_cast(_text.length())); - } - private: - void Message(const TCHAR formatter[], ...) - { - va_list ap; - va_start(ap, formatter); - Core::Format(_text, formatter, ap); - va_end(ap); - } - std::string _text; - }; -} -} // namespace Trace - -#endif // __TRACECATEGORIES_H diff --git a/Source/tracing/TraceControl.h b/Source/tracing/TraceControl.h deleted file mode 100644 index 85e1633bd..000000000 --- a/Source/tracing/TraceControl.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __TRACECONTROL_H -#define __TRACECONTROL_H - -// ---- Include system wide include files ---- -#include - -// ---- Include local include files ---- -#include "ITraceControl.h" -#include "Module.h" -#include "TraceUnit.h" - -// ---- Referenced classes and types ---- - -// ---- Helper types and constants ---- - -#ifdef _THUNDER_PRODUCTION - -#define TRACE_ENABLED(CATEGORY) -#define TRACE(CATEGORY, PARAMETERS) -#define TRACE_GLOBAL(CATEGORY, PARAMETERS) -#define TRACE_DURATION(CODE, ...) -#define TRACE_DURATION_GLOBAL(CODE, ...) - -#else - -#define TRACE_ENABLED(CATEGORY) \ - WPEFramework::Trace::TraceType::IsEnabled() - -#define TRACE(CATEGORY, PARAMETERS) \ - if (WPEFramework::Trace::TraceType::IsEnabled() == true) { \ - CATEGORY __data__ PARAMETERS; \ - WPEFramework::Trace::TraceType __message__(__data__); \ - WPEFramework::Trace::TraceUnit::Instance().Trace( \ - __FILE__, \ - __LINE__, \ - typeid(*this).name(), \ - &__message__); \ - } - -#define TRACE_GLOBAL(CATEGORY, PARAMETERS) \ - if (WPEFramework::Trace::TraceType::IsEnabled() == true) { \ - CATEGORY __data__ PARAMETERS; \ - WPEFramework::Trace::TraceType __message__(__data__); \ - WPEFramework::Trace::TraceUnit::Instance().Trace( \ - __FILE__, \ - __LINE__, \ - __FUNCTION__, \ - &__message__); \ - } - -#define TRACE_DURATION(CODE, ...) \ - WPEFramework::Core::Time start = WPEFramework::Core::Time::Now(); \ - CODE \ - TRACE(WPEFramework::Trace::Duration, (start, ##__VA_ARGS__)); - -#define TRACE_DURATION_GLOBAL(CODE, ...) \ - WPEFramework::Core::Time start = WPEFramework::Core::Time::Now(); \ - CODE \ - TRACE_GLOBAL(WPEFramework::Trace::Duration, (start, ##__VA_ARGS__)); - -#endif -// ---- Helper functions ---- - -// ---- Class Definition ---- -namespace WPEFramework { -namespace Trace { - template - class TraceType : public ITrace { - private: - template - class TraceControl : public ITraceControl { - private: - - public: - TraceControl(const TraceControl&) = delete; - TraceControl& operator=(const TraceControl&) = delete; - - TraceControl() - : m_CategoryName(Core::ClassNameOnly(typeid(CONTROLCATEGORY).name()).Text()) - , m_Enabled(0x02) - { - // Register Our trace control unit, so it can be influenced from the outside - // if nessecary.. - TraceUnit::Instance().Announce(*this); - - bool enabled = false; - if (TraceUnit::Instance().IsDefaultCategory(*CONTROLMODULE, m_CategoryName, enabled)) { - if (enabled) { - // Better not to use virtual Enabled(...), because derived classes aren't finished yet. - m_Enabled = m_Enabled | 0x01; - } - } - } - ~TraceControl() override - { - Destroy(); - } - - public: - inline bool IsEnabled() const - { - return ((m_Enabled & 0x01) != 0); - } - virtual const char* Category() const - { - return (m_CategoryName.c_str()); - } - virtual const char* Module() const - { - return (*CONTROLMODULE); - } - virtual bool Enabled() const - { - return (IsEnabled()); - } - virtual void Enabled(const bool enabled) - { - m_Enabled = (m_Enabled & 0xFE) | (enabled ? 0x01 : 0x00); - } - virtual void Destroy() - { - if ((m_Enabled & 0x02) != 0) { - // Register Our trace control unit, so it can be influenced from the outside - // if nessecary.. - TraceUnit::Instance().Revoke(*this); - m_Enabled = 0; - } - } - - protected: - const string m_CategoryName; - uint8_t m_Enabled; - }; - - - public: - TraceType(const TraceType&) = delete; - TraceType& operator=(const TraceType&) = delete; - - TraceType(CATEGORY& category) - : _traceInfo(category) - { - } - ~TraceType() override = default; - - public: - // No dereference etc.. 1 straight line to enabled or not... Quick method.. - inline static bool IsEnabled() - { - return (s_TraceControl.IsEnabled()); - } - - inline static void Enable(const bool status) - { - s_TraceControl.Enabled(status); - } - - virtual const char* Category() const - { - return (s_TraceControl.Category()); - } - - virtual const char* Module() const - { - return (s_TraceControl.Module()); - } - - virtual bool Enabled() const - { - return (s_TraceControl.Enabled()); - } - - virtual void Enabled(const bool enabled) - { - s_TraceControl.Enabled(enabled); - } - - virtual void Destroy() - { - s_TraceControl.Destroy(); - } - - virtual const char* Data() const - { - return (_traceInfo.Data()); - } - virtual uint16_t Length() const - { - return (_traceInfo.Length()); - } - - private: - CATEGORY& _traceInfo; - static TraceControl s_TraceControl; - }; - - template - EXTERNAL_HIDDEN typename TraceType::template TraceControl TraceType::s_TraceControl; -} - -} // namespace Trace - -#endif // __TRACECONTROL_H diff --git a/Source/tracing/TraceMedia.cpp b/Source/tracing/TraceMedia.cpp deleted file mode 100644 index e8c39ae5b..000000000 --- a/Source/tracing/TraceMedia.cpp +++ /dev/null @@ -1,162 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 "TraceMedia.h" -#include "TraceControl.h" -#include "TraceUnit.h" - -namespace WPEFramework { -namespace Trace { - // Allow runtime enabling of the reaces, using the same channel as the trace information is send over: - // This is done, using a simple protocol: - // - // - // The first byte of the UDP message determines the type of message: - // [T] => Trace line - // [C] => Command - // [R] => Response - -PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) - - TraceMedia::TraceMedia(const Core::NodeId& nodeId) - : m_Output(*this, nodeId) - { - m_Output.Open(0); - } -POP_WARNING() - - TraceMedia::~TraceMedia() - { - } - - /* virtual */ void TraceMedia::Output( - const char fileName[], - const uint32_t lineNumber, - const char className[], - const ITrace* information) - { - uint64_t current = Core::Time::Now().Ticks(); - Core::TextFragment cleanClassName(Core::ClassNameOnly(className)); - - m_Output._traceBuffer[0] = 'T'; - m_Output._traceBuffer[1] = (current >> 56) & 0xFF; - m_Output._traceBuffer[2] = (current >> 48) & 0xFF; - m_Output._traceBuffer[3] = (current >> 40) & 0xFF; - m_Output._traceBuffer[4] = (current >> 32) & 0xFF; - m_Output._traceBuffer[5] = (current >> 24) & 0xFF; - m_Output._traceBuffer[6] = (current >> 16) & 0xFF; - m_Output._traceBuffer[7] = (current >> 8) & 0xFF; - m_Output._traceBuffer[8] = (current >> 0) & 0xFF; - m_Output._traceBuffer[9] = (lineNumber >> 24) & 0xFF; - m_Output._traceBuffer[10] = (lineNumber >> 16) & 0xFF; - m_Output._traceBuffer[11] = (lineNumber >> 8) & 0xFF; - m_Output._traceBuffer[12] = (lineNumber >> 0) & 0xFF; - - char* result = CopyText(&m_Output._traceBuffer[13], fileName, sizeof(m_Output._traceBuffer) - 13); - - ASSERT(cleanClassName.Length() < (sizeof(m_Output._traceBuffer) - static_cast(result - m_Output._traceBuffer))); - - memcpy(result, cleanClassName.Data(), cleanClassName.Length()); - result = &(result[cleanClassName.Length()]); - *result++ = '\0'; - - uint16_t length = static_cast(result - m_Output._traceBuffer); - uint16_t bufferRemaining = sizeof(m_Output._traceBuffer) - length; - uint16_t copiedBytes = (bufferRemaining > information->Length()) ? information->Length() : bufferRemaining; - - memcpy(result, information->Data(), copiedBytes); - - m_Output._loaded = length + copiedBytes; - - m_Output.Trigger(); - } - - void TraceMedia::HandleMessage(const uint8_t* dataFrame, const uint16_t receivedSize) - { - if ((receivedSize >= 6) && (dataFrame[0] == 'C')) { - static char response[TRACINGBUFFERSIZE]; - - response[0] = 'R'; - response[1] = dataFrame[1]; - response[2] = dataFrame[2]; - response[3] = dataFrame[3]; - response[4] = dataFrame[4]; - - switch (dataFrame[5]) { - case 0: { // List all trace categories !! - TraceUnit::Iterator index = TraceUnit::Instance().GetCategories(); - - response[5] = dataFrame[5]; - - // Send out all categories/modules - while (index.Next() == true) { - uint32_t size = sizeof(response) - 8; - - response[6] = ((*index)->Enabled() == true ? '1' : '0'); - response[7] = '\0'; - - // Add line - char* last = CopyText(&response[8], (*index)->Category(), size); - last = CopyText(last, (*index)->Module(), size); - - // Give 1s per line to send ;-) - Write(reinterpret_cast(response), static_cast(sizeof(response)) - size); - } - break; - } - case 1: { // Toggle tracing - const char* module = reinterpret_cast(::memchr(&dataFrame[8], '\0', receivedSize - 8)); - if (module != nullptr) { - uint32_t count = TraceUnit::Instance().SetCategories((dataFrame[6] == '1'), &module[1], reinterpret_cast(&dataFrame[8])); - - // affter the command we get the the change count - response[6] = (count >> 24) & 0xFF; - response[7] = (count >> 16) & 0xFF; - response[8] = (count >> 8) & 0xFF; - response[9] = (count >> 0) & 0xFF; - - Write(reinterpret_cast(response), 10); - } - break; - } - } - } - } - - void TraceMedia::Write(const uint8_t* dataFrame VARIABLE_IS_NOT_USED, const uint16_t receivedSize VARIABLE_IS_NOT_USED) - { - } - - char* TraceMedia::CopyText(char* destination, const char* source, uint32_t maxSize) - { - uint32_t size = maxSize - 1; - const char* end = reinterpret_cast(::memchr(source, '\0', size)); - - if (end != nullptr) { - size = static_cast(end - source); - } - - ::memcpy(destination, source, size); - destination = &destination[size]; - *destination++ = '\0'; - - return (destination); - } -} -} // namespace Trace diff --git a/Source/tracing/TraceMedia.h b/Source/tracing/TraceMedia.h deleted file mode 100644 index 49e440830..000000000 --- a/Source/tracing/TraceMedia.h +++ /dev/null @@ -1,115 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __TRACEMEDIA_H -#define __TRACEMEDIA_H - -// ---- Include system wide include files ---- - -// ---- Include local include files ---- -#include "ITraceMedia.h" -#include "Module.h" - -// ---- Referenced classes and types ---- - -// ---- Helper functions ---- - -// ---- Class Definition ---- -namespace WPEFramework { -namespace Trace { - // ---- Helper types and constants ---- - struct ITrace; - - class EXTERNAL TraceMedia : public ITraceMedia { - private: - class Channel : public Core::SocketDatagram { - public: - Channel(TraceMedia& parent, const Core::NodeId& remoteNode) - : Core::SocketDatagram(false, remoteNode.Origin(), remoteNode, 2048, TRACINGBUFFERSIZE + 512) - , _loaded(0) - , // 32 bytes for preamble - _parent(parent) - { - } - virtual ~Channel() - { - Close(Core::infinite); - } - - public: - // Methods to extract and insert data into the socket buffers - virtual uint16_t SendData(uint8_t* dataFrame, const uint16_t maxSendSize) - { - // We used it all up.. - // TODO: make thread safe. - - uint16_t actualByteCount = _loaded > maxSendSize ? maxSendSize : _loaded; - memcpy(dataFrame, _traceBuffer, actualByteCount); - _loaded = 0; - - return (actualByteCount); - } - virtual uint16_t ReceiveData(uint8_t* dataFrame, const uint16_t receivedSize) - { - _parent.HandleMessage(dataFrame, receivedSize); - - return (receivedSize); - } - // Signal a state change, Opened, Closed or Accepted - virtual void StateChange() - { - } - - // TODO: lock to keep this consistent - char _traceBuffer[1500]; - uint16_t _loaded; - - // TODO: create message here, not in parent - - private: - TraceMedia& _parent; - }; - - private: - TraceMedia(); - TraceMedia(const TraceMedia&); - TraceMedia& operator=(const TraceMedia&); - - public: - TraceMedia(const Core::NodeId& nodeId); - ~TraceMedia(); - - virtual void Output( - const char fileName[], - const uint32_t lineNumber, - const char className[], - const ITrace* information); - - private: - char* CopyText(char* destination, const char* source, uint32_t maxSize); - void HandleMessage(const uint8_t* dataFrame, const uint16_t receivedSize); - void Write(const uint8_t* dataFrame, const uint16_t receivedSize); - - private: - Channel m_Output; - }; -} -} // namespace Trace - -#endif // __TRACEMEDIA_H diff --git a/Source/tracing/TraceUnit.cpp b/Source/tracing/TraceUnit.cpp deleted file mode 100644 index 5b2d09107..000000000 --- a/Source/tracing/TraceUnit.cpp +++ /dev/null @@ -1,363 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 "TraceUnit.h" -#include "TraceCategories.h" -#include "Logging.h" - -#define TRACE_CYCLIC_BUFFER_FILENAME _T("TRACE_FILENAME") -#define TRACE_CYCLIC_BUFFER_DOORBELL _T("TRACE_DOORBELL") - -namespace WPEFramework { -namespace Trace { - - /* static */ const TCHAR* CyclicBufferName = _T("tracebuffer"); - - TraceUnit::TraceUnit() - : m_Categories() - , m_Admin() - , m_OutputChannel(nullptr) - , m_DirectOut(false) - { - } - - TraceUnit::TraceBuffer::TraceBuffer(const string& doorBell, const string& name) - : Core::CyclicBuffer(name, - Core::File::USER_READ | - Core::File::USER_WRITE | - Core::File::USER_EXECUTE | - Core::File::GROUP_READ | - Core::File::GROUP_WRITE | - Core::File::SHAREABLE, - CyclicBufferSize, true) - , _doorBell(doorBell.c_str()) - { - // Make sure the trace file opened proeprly. - TRACE_L1("Opened a file to stash my traces at: %s [%d] and doorbell: %s", name.c_str(), CyclicBufferSize, doorBell.c_str()); - ASSERT (IsValid() == true); - } - - TraceUnit::TraceBuffer::~TraceBuffer() - { - } - - /* virtual */ uint32_t TraceUnit::TraceBuffer::GetOverwriteSize(Cursor& cursor) - { - while (cursor.Offset() < cursor.Size()) { - uint16_t chunkSize = 0; - cursor.Peek(chunkSize); - - TRACE_L1("Flushing TRACE data !!! %d", __LINE__); - - cursor.Forward(chunkSize); - } - return cursor.Offset(); - } - - /* virtual */ void TraceUnit::TraceBuffer::DataAvailable() - { - _doorBell.Ring(); - } - - /* static */ TraceUnit& TraceUnit::Instance() - { - return (Core::SingletonType::Instance()); - } - - TraceUnit::~TraceUnit() - { - m_Admin.Lock(); - - if (m_OutputChannel != nullptr) { - Close(); - } - - while (m_Categories.size() != 0) { - m_Categories.front()->Destroy(); - } - - m_Admin.Unlock(); - } - - uint32_t TraceUnit::Open(const uint32_t identifier) - { - uint32_t result = Core::ERROR_UNAVAILABLE; - - string fileName; - string doorBell; - Core::SystemInfo::GetEnvironment(TRACE_CYCLIC_BUFFER_FILENAME, fileName); - Core::SystemInfo::GetEnvironment(TRACE_CYCLIC_BUFFER_DOORBELL, doorBell); - - ASSERT(fileName.empty() == false); - ASSERT(doorBell.empty() == false); - - if (fileName.empty() == false) { - - fileName += '.' + Core::NumberType(identifier).Text(); - result = Open(doorBell, fileName); - } - - return (result); - } - - uint32_t TraceUnit::Open(const string& pathName) - { - string fileName(Core::Directory::Normalize(pathName) + CyclicBufferName); - #ifdef __WINDOWS__ - string doorBell("127.0.0.1:62001"); - #else - string doorBell(Core::Directory::Normalize(pathName) + CyclicBufferName + ".doorbell" ); - #endif - - Core::SystemInfo::SetEnvironment(TRACE_CYCLIC_BUFFER_FILENAME, fileName); - Core::SystemInfo::SetEnvironment(TRACE_CYCLIC_BUFFER_DOORBELL, doorBell); - - return (Open(doorBell, fileName)); - } - - uint32_t TraceUnit::Close() - { - m_Admin.Lock(); - - ASSERT(m_OutputChannel != nullptr); - - if (m_OutputChannel != nullptr) { - delete m_OutputChannel; - } - - m_OutputChannel = nullptr; - - m_Admin.Unlock(); - - return (Core::ERROR_NONE); - } - - void TraceUnit::Announce(ITraceControl& Category) - { - m_Admin.Lock(); - - m_Categories.push_back(&Category); - - m_Admin.Unlock(); - } - - void TraceUnit::Revoke(ITraceControl& Category) - { - m_Admin.Lock(); - - std::list::iterator index(std::find(m_Categories.begin(), m_Categories.end(), &Category)); - - if (index != m_Categories.end()) { - m_Categories.erase(index); - } - - m_Admin.Unlock(); - } - - TraceUnit::Iterator TraceUnit::GetCategories() - { - return (Iterator(m_Categories)); - } - - uint32_t TraceUnit::SetCategories(const bool enable, const char* module, const char* category) - { - uint32_t modifications = 0; - - TraceControlList::iterator index(m_Categories.begin()); - - while (index != m_Categories.end()) { - const char* thisModule = (*index)->Module(); - const char* thisCategory = (*index)->Category(); - - if ((module != nullptr) && (category != nullptr)) { - if ((::strcmp(module, thisModule) == 0) && (::strcmp(category, thisCategory) == 0)) { - modifications++; - (*index)->Enabled(enable); - } - } - else if ((module != nullptr) && (category == nullptr)) { - if ((::strcmp(module, thisModule) == 0)) { - //Disable/Enable traces for selected module - modifications++; - (*index)->Enabled(enable); - } - } - else { - //Disable/Enable traces for all modules - modifications++; - (*index)->Enabled(enable); - } - - index++; - } - - return (modifications); - } - - string TraceUnit::Defaults() const - { - string result; - Core::JSON::ArrayType serialized; - Settings::const_iterator index = m_EnabledCategories.begin(); - - while (index != m_EnabledCategories.end()) { - serialized.Add(Setting::JSON(*index)); - index++; - } - - serialized.ToString(result); - return (result); - } - - void TraceUnit::Defaults(const string& jsonCategories) - { - Core::JSON::ArrayType serialized; - Core::OptionalType error; - serialized.FromString(jsonCategories, error); - if (error.IsSet() == true) { - SYSLOG(Logging::ParsingError, (_T("Parsing failed with %s"), ErrorDisplayMessage(error.Value()).c_str())); - } - - // Deal with existing categories that might need to be enable/disabled. - UpdateEnabledCategories(serialized); - } - - void TraceUnit::Defaults(Core::File& file) { - Core::JSON::ArrayType serialized; - Core::OptionalType error; - serialized.IElement::FromFile(file, error); - if (error.IsSet() == true) { - SYSLOG(WPEFramework::Logging::ParsingError, (_T("Parsing failed with %s"), ErrorDisplayMessage(error.Value()).c_str())); - } - - // Deal with existing categories that might need to be enable/disabled. - UpdateEnabledCategories(serialized); - } - - void TraceUnit::UpdateEnabledCategories(const Core::JSON::ArrayType& info) - { - Core::JSON::ArrayType::ConstIterator index = info.Elements(); - - m_EnabledCategories.clear(); - - while (index.Next()) { - m_EnabledCategories.emplace_back(Setting(index.Current())); - } - - for (ITraceControl* traceControl : m_Categories) { - Settings::const_iterator index = m_EnabledCategories.begin(); - while (index != m_EnabledCategories.end()) { - const Setting& setting = *index; - - if ( ((setting.HasModule() == false) || (setting.Module() == traceControl->Module()) ) && - ((setting.HasCategory() == false) || (setting.Category() == traceControl->Category()) ) ) { - if (setting.Enabled() != traceControl->Enabled()) { - traceControl->Enabled(setting.Enabled()); - } - } - - index++; - } - } - } - - bool TraceUnit::IsDefaultCategory(const string& module, const string& category, bool& enabled) const - { - bool isDefaultCategory = false; - - Settings::const_iterator index = m_EnabledCategories.begin(); - while (index != m_EnabledCategories.end()) { - const Setting& setting = *index; - - if ( ((module.empty() == true) || (setting.HasModule() == false) || (setting.Module() == module) ) && - ((category.empty() == true) || (setting.HasCategory() == false) || (setting.Category() == category) ) ) { - // Register match of category and update enabled flag. - isDefaultCategory = true; - enabled = setting.Enabled(); - } - index++; - } - - return isDefaultCategory; - } - - void TraceUnit::Trace(const char file[], const uint32_t lineNumber, const char className[], const ITrace* const information) - { - const char* fileName(Core::FileNameOnly(file)); - - m_Admin.Lock(); - - if (m_OutputChannel != nullptr) { - - const char* category(information->Category()); - const char* module(information->Module()); - const uint64_t current = Core::Time::Now().Ticks(); - const uint16_t fileNameLength = static_cast(strlen(fileName) + 1); // File name. - const uint16_t moduleLength = static_cast(strlen(module) + 1); // Module. - const uint16_t categoryLength = static_cast(strlen(category) + 1); // Cateogory. - const uint16_t classNameLength = static_cast(strlen(className) + 1); // Class name. - const uint16_t informationLength = information->Length(); // Actual data (no '\0' needed). - - // Trace entry has been simplified: 16 bit size followed by fields: - // length(2 bytes) - clock ticks (8 bytes) - line number (4 bytes) - file/module/category/className - const uint16_t headerLength = 2 + 8 + 4 + fileNameLength + moduleLength + categoryLength + classNameLength; - - const uint32_t fullLength = informationLength + headerLength; // Actual data (no '\0' needed). - - // Tell the buffer how much we are going to write. - const uint32_t actualLength = m_OutputChannel->Reserve(fullLength); - - if (actualLength >= headerLength) { - const uint16_t convertedLength = static_cast(actualLength); - m_OutputChannel->Write(reinterpret_cast(&convertedLength), 2); - m_OutputChannel->Write(reinterpret_cast(¤t), 8); - m_OutputChannel->Write(reinterpret_cast(&lineNumber), 4); - m_OutputChannel->Write(reinterpret_cast(fileName), fileNameLength); - m_OutputChannel->Write(reinterpret_cast(module), moduleLength); - m_OutputChannel->Write(reinterpret_cast(category), categoryLength); - m_OutputChannel->Write(reinterpret_cast(className), classNameLength); - - if (actualLength >= fullLength) { - // We can write the whole information. - m_OutputChannel->Write(reinterpret_cast(information->Data()), informationLength); - } else { - // Can only write information partially - const uint16_t dropLength = actualLength - headerLength; - - m_OutputChannel->Write(reinterpret_cast(information->Data()), dropLength); - } - } - } - - if (m_DirectOut == true) { - string time(Core::Time::Now().ToRFC1123(true)); - Core::TextFragment cleanClassName(Core::ClassNameOnly(className)); - - fprintf(stdout, "[%s]:[%s:%d]:[%s] %s: %s\n", time.c_str(), fileName, lineNumber, cleanClassName.Data(), information->Category(), information->Data()); - fflush(stdout); - } - - m_Admin.Unlock(); - } - -} -} // namespace WPEFramework::Trace - -// explicit instantation as on some yocto builds not all externally required methods were instantiated otherwise -template class WPEFramework::Core::IteratorType; diff --git a/Source/tracing/TraceUnit.h b/Source/tracing/TraceUnit.h deleted file mode 100644 index 1b629e9e0..000000000 --- a/Source/tracing/TraceUnit.h +++ /dev/null @@ -1,264 +0,0 @@ - /* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under 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 __TRACEUNIT_H -#define __TRACEUNIT_H - -// ---- Include system wide include files ---- - -// ---- Include local include files ---- -#include "ITraceMedia.h" -#include "Module.h" - -// ---- Helper types and constants ---- - -// ---- Helper functions ---- -namespace WPEFramework { -namespace Trace { - // ---- Referenced classes and types ---- - struct ITraceControl; - struct ITrace; - - constexpr uint32_t CyclicBufferSize = ((16 * 1024) - (sizeof(struct Core::CyclicBuffer::control))); /* 16Kb */ - extern EXTERNAL const TCHAR* CyclicBufferName; - - // ---- Class Definition ---- - class EXTERNAL TraceUnit { - public: - class Setting { - public: - class JSON : public Core::JSON::Container { - public: - JSON& operator=(const JSON&) = delete; - JSON() - : Core::JSON::Container() - , Module() - , Category() - , Enabled(false) - { - Add(_T("module"), &Module); - Add(_T("category"), &Category); - Add(_T("enabled"), &Enabled); - } - JSON(const JSON& copy) - : Core::JSON::Container() - , Module(copy.Module) - , Category(copy.Category) - , Enabled(copy.Enabled) - { - Add(_T("module"), &Module); - Add(_T("category"), &Category); - Add(_T("enabled"), &Enabled); - } - JSON(const Setting& rhs) - : Core::JSON::Container() - , Module() - , Category() - , Enabled() - { - Add(_T("module"), &Module); - Add(_T("category"), &Category); - Add(_T("enabled"), &Enabled); - - if (rhs.HasModule()) { - Module = rhs.Module(); - } - if (rhs.HasCategory()) { - Category = rhs.Category(); - } - Enabled = rhs.Enabled(); - } - ~JSON() override = default; - - public: - Core::JSON::String Module; - Core::JSON::String Category; - Core::JSON::Boolean Enabled; - }; - - public: - Setting(const JSON& source) - : _module() - , _category() - , _enabled(source.Enabled.Value()) { - if (source.Module.IsSet()) { - _module = source.Module.Value(); - } - if (source.Category.IsSet()) { - _category = source.Category.Value(); - } - } - Setting(const Setting& copy) - : _module(copy._module) - , _category(copy._category) - , _enabled(copy._enabled) { - } - ~Setting() { - } - - public: - bool HasModule() const { - return (_module.IsSet()); - } - bool HasCategory() const { - return (_category.IsSet()); - } - const string& Module() const { - return (_module); - } - const string& Category() const { - return (_category); - } - bool Enabled() const { - return (_enabled); - } - - private: - Core::OptionalType _module; - Core::OptionalType _category; - bool _enabled; - }; - - public: - typedef std::list Settings; - typedef std::list TraceControlList; - typedef Core::IteratorType Iterator; - - private: - // ------------------------------------------------------------------- - // This object should not be copied or assigned. Prevent the copy - // constructor and assignment constructor from being used. Compiler - // generated assignment and copy methods will be blocked by the - // following statements. - // Define them but do not implement them, compile error/link error. - // ------------------------------------------------------------------- - TraceUnit(const TraceUnit&) = delete; - TraceUnit& operator=(const TraceUnit&) = delete; - - class EXTERNAL TraceBuffer : public Core::CyclicBuffer { - private: - TraceBuffer() = delete; - TraceBuffer(const TraceBuffer&) = delete; - TraceBuffer& operator=(const TraceBuffer&) = delete; - - public: - TraceBuffer(const string& doorBell, const string& name); - ~TraceBuffer(); - - public: - virtual uint32_t GetOverwriteSize(Cursor& cursor) override; - inline void Ring() { - _doorBell.Ring(); - } - inline void Acknowledge() { - _doorBell.Acknowledge(); - } - inline uint32_t Wait (const uint32_t waitTime) { - return (_doorBell.Wait(waitTime)); - } - inline void Relinquish() - { - return (_doorBell.Relinquish()); - } - - private: - virtual void DataAvailable() override; - - private: - Core::DoorBell _doorBell; - }; - - protected: - TraceUnit(); - - public: - virtual ~TraceUnit(); - - public: - static TraceUnit& Instance(); - - uint32_t Open(const uint32_t identifier); - uint32_t Open(const string& pathName); - uint32_t Close(); - - void Announce(ITraceControl& Category); - void Revoke(ITraceControl& Category); - Iterator GetCategories(); - uint32_t SetCategories(const bool enable, const char* module, const char* category); - - // Default enabled/disabled categories: set via config.json. - bool IsDefaultCategory(const string& module, const string& category, bool& enabled) const; - string Defaults() const; - void Defaults(const string& jsonCategories); - void Defaults(Core::File& file); - - void Trace(const char fileName[], const uint32_t lineNumber, const char className[], const ITrace* const information); - - inline Core::CyclicBuffer* CyclicBuffer() - { - return (m_OutputChannel); - } - inline bool HasDirectOutput() const - { - return (m_DirectOut); - } - inline void DirectOutput(const bool enabled) - { - m_DirectOut = enabled; - } - inline void Announce() { - ASSERT (m_OutputChannel != nullptr); - m_OutputChannel->Ring(); - } - inline void Acknowledge() { - ASSERT (m_OutputChannel != nullptr); - m_OutputChannel->Acknowledge(); - } - inline uint32_t Wait (const uint32_t waitTime) { - ASSERT (m_OutputChannel != nullptr); - return (m_OutputChannel->Wait(waitTime)); - } - inline void Relinquish() { - ASSERT(m_OutputChannel != nullptr); - return (m_OutputChannel->Relinquish()); - } - - private: - inline uint32_t Open(const string& doorBell, const string& fileName) - { - ASSERT(m_OutputChannel == nullptr); - - m_OutputChannel = new TraceBuffer(doorBell, fileName); - - ASSERT(m_OutputChannel->IsValid() == true); - - return (m_OutputChannel->IsValid() ? Core::ERROR_NONE : Core::ERROR_UNAVAILABLE); - } - void UpdateEnabledCategories(const Core::JSON::ArrayType& info); - - TraceControlList m_Categories; - Core::CriticalSection m_Admin; - TraceBuffer* m_OutputChannel; - Settings m_EnabledCategories; - bool m_DirectOut; - }; -} -} // namespace Trace - -#endif // __TRACEUNIT_H diff --git a/Source/tracing/tracing.h b/Source/tracing/tracing.h index 7c27027ef..b73494e94 100644 --- a/Source/tracing/tracing.h +++ b/Source/tracing/tracing.h @@ -17,20 +17,4 @@ * limitations under the License. */ -#pragma once - -#ifndef MODULE_NAME -#error "Please define a MODULE_NAME that describes the binary/library you are building." -#endif - -#include "ITraceControl.h" -#include "ITraceMedia.h" -#include "Logging.h" -#include "TraceCategories.h" -#include "TraceControl.h" -#include "TraceMedia.h" -#include "TraceUnit.h" - -#ifdef __WINDOWS__ -#pragma comment(lib, "tracing.lib") -#endif +#include \ No newline at end of file diff --git a/Source/tracing/tracing.vcxproj b/Source/tracing/tracing.vcxproj deleted file mode 100644 index 40a911ead..000000000 --- a/Source/tracing/tracing.vcxproj +++ /dev/null @@ -1,393 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - 15.0 - {6838AFCB-D65D-443A-A435-2F1940790836} - Win32Proj - tracing - 10.0 - - - - DynamicLibrary - true - v143 - MultiByte - - - DynamicLibrary - false - v143 - true - MultiByte - - - DynamicLibrary - true - v143 - MultiByte - - - DynamicLibrary - false - v143 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - false - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - true - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - true - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - false - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - - NotUsing - Level3 - MaxSpeed - true - true - true - _CRT_SECURE_NO_WARNINGS;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - true - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - Disabled - true - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - Disabled - true - _CRT_SECURE_NO_WARNINGS;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - true - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - 15.0 - {6838AFCB-D65D-443A-A435-2F1940790836} - Win32Proj - tracing - 10.0 - - - - DynamicLibrary - true - v143 - MultiByte - - - DynamicLibrary - false - v143 - true - MultiByte - - - DynamicLibrary - true - v143 - MultiByte - - - DynamicLibrary - false - v143 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - false - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - true - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - true - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - false - $(SolutionDir)..\artifacts\$(Configuration)\ - $(OutDir)WebBridge\$(TargetName)\ - - - - NotUsing - Level3 - MaxSpeed - true - true - true - _CRT_SECURE_NO_WARNINGS;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - true - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - Disabled - true - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - Disabled - true - _CRT_SECURE_NO_WARNINGS;_DEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;TRACING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(FrameworkPath);$(WindowsPath) - true - - - Windows - true - true - true - $(OutDir) - $(IntDir)$(TargetName).pdb - - - - - - diff --git a/Source/tracing/tracing.vcxproj.filters b/Source/tracing/tracing.vcxproj.filters deleted file mode 100644 index e85ea4308..000000000 --- a/Source/tracing/tracing.vcxproj.filters +++ /dev/null @@ -1,131 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - From 05ea49d47d461ee0ea5453802919e772e1f7dd62 Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 13:25:43 +0100 Subject: [PATCH 07/10] Deleting tracing and messaging options Also checking Linux build after Windows changes --- .github/workflows/Build Thunder.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build Thunder.yml b/.github/workflows/Build Thunder.yml index 5e5b6afa5..06f1b59be 100644 --- a/.github/workflows/Build Thunder.yml +++ b/.github/workflows/Build Thunder.yml @@ -1,10 +1,11 @@ name: CMake Thunder +# CHANGE TO MASTER on: push: - branches: ["master"] + branches: ["development/update-windows-build"] pull_request: - branches: ["master"] + branches: ["development/update-windows-build"] workflow_call: jobs: @@ -50,12 +51,10 @@ jobs: -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \ -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \ -DDATA_PATH="${PWD}/${{matrix.build_type}}/install/usr/share/WPEFramework" \ - -DMESSAGING=ON \ -DPERSISTENT_PATH="${PWD}/${{matrix.build_type}}/install/var/wpeframework" \ -DPORT="55555" \ -DPROXYSTUB_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/proxystubs" \ -DSYSTEM_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/plugins" \ - -DTRACING=OFF \ -DVOLATILE_PATH="tmp" cmake --build ${{matrix.build_type}}/build/Thunder --target install From 8188c7660ff43cce6af447c2f1b03eaf5f78bd41 Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 13:32:56 +0100 Subject: [PATCH 08/10] Checking if Linux builds after changes for Windows --- .github/workflows/Build Thunder.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Build Thunder.yml b/.github/workflows/Build Thunder.yml index 06f1b59be..f61815e1b 100644 --- a/.github/workflows/Build Thunder.yml +++ b/.github/workflows/Build Thunder.yml @@ -18,10 +18,12 @@ jobs: name: Build type - ${{matrix.build_type}} steps: +# CHANGE TO MASTER - name: Checkout uses: actions/checkout@v3 with: path: Thunder + ref: development/update-windows-build repository: ${{github.repository_owner}}/Thunder - name: Install necessary packages From ee420e16fc2f04e1614f458bb9cb4db7780930e9 Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:21:29 +0100 Subject: [PATCH 09/10] Reverting Linux build to master before PR --- .../{Build Thunder.yml => Build Thunder on Linux.yml} | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) rename .github/workflows/{Build Thunder.yml => Build Thunder on Linux.yml} (91%) diff --git a/.github/workflows/Build Thunder.yml b/.github/workflows/Build Thunder on Linux.yml similarity index 91% rename from .github/workflows/Build Thunder.yml rename to .github/workflows/Build Thunder on Linux.yml index f61815e1b..daf0f7148 100644 --- a/.github/workflows/Build Thunder.yml +++ b/.github/workflows/Build Thunder on Linux.yml @@ -1,11 +1,10 @@ -name: CMake Thunder +name: Build Thunder on Linux -# CHANGE TO MASTER on: push: - branches: ["development/update-windows-build"] + branches: ["master"] pull_request: - branches: ["development/update-windows-build"] + branches: ["master"] workflow_call: jobs: @@ -18,12 +17,10 @@ jobs: name: Build type - ${{matrix.build_type}} steps: -# CHANGE TO MASTER - name: Checkout uses: actions/checkout@v3 with: path: Thunder - ref: development/update-windows-build repository: ${{github.repository_owner}}/Thunder - name: Install necessary packages From 8189347b125d2090476021f219c2d28fe81da71e Mon Sep 17 00:00:00 2001 From: VeithMetro <121170681+VeithMetro@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:26:23 +0100 Subject: [PATCH 10/10] Delete Build Thunder on Windows for now --- .../workflows/Build Thunder on Windows.yml | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 .github/workflows/Build Thunder on Windows.yml diff --git a/.github/workflows/Build Thunder on Windows.yml b/.github/workflows/Build Thunder on Windows.yml deleted file mode 100644 index d7d02db4b..000000000 --- a/.github/workflows/Build Thunder on Windows.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Build Thunder on Windows - -# CHANGE TO MASTER -on: - push: - branches: ["development/update-windows-build"] - pull_request: - branches: ["development/update-windows-build"] - workflow_call: - -env: - bridge: D:\a\Thunder\Thunder\Thunder\Source\WPEFramework\bridge.vcxproj - comProcess: D:\a\Thunder\Thunder\Thunder\Source\WPEProcess\comprocess.vcxproj - devEnv: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com - solution: D:\a\Thunder\Thunder\Thunder.sln - -jobs: - build: - runs-on: windows-latest - - strategy: - matrix: - build_type: ["Debug|x64", "Debug|x86", "Release|x64", "Release|x86"] - -# CHANGE THE BRANCHES - steps: - - name: Checkout ThunderOnWindows - uses: actions/checkout@v3 - with: - ref: development/update-windows-build - repository: ${{github.repository_owner}}/ThunderOnWindows - - - name: Checkout Thunder - uses: actions/checkout@v3 - with: - path: Thunder - ref: development/update-windows-build - repository: ${{github.repository_owner}}/Thunder - - - name: Checkout ThunderClientLibraries - uses: actions/checkout@v3 - with: - path: ThunderClientLibraries - ref: development/update-windows-build - repository: ${{github.repository_owner}}/ThunderClientLibraries - - - name: Checkout ThunderInterfaces - uses: actions/checkout@v3 - with: - path: ThunderInterfaces - ref: development/update-windows-build - repository: ${{github.repository_owner}}/ThunderInterfaces - - - name: Checkout ThunderNanoServices - uses: actions/checkout@v3 - with: - path: ThunderNanoServices - ref: development/update-windows-build - repository: ${{github.repository_owner}}/ThunderNanoServices - -# CHANGE REPO OWNER - - name: Checkout ThunderNanoServicesRDK - uses: actions/checkout@v3 - with: - path: ThunderNanoServicesRDK - ref: development/update-windows-build - repository: VeithMetro/ThunderNanoServicesRDK - - - name: Install jsonref - run: pip install jsonref - - - name: Build Thunder - shell: cmd - run: | - "%devEnv%" /Build "${{matrix.build_type}}" "%solution%" -# - name: Build Thunder -# shell: cmd -# run: | -# "%devEnv%" /Build "Debug|x64" /Project "%bridge%" "%solution%" -# "%devEnv%" /Build "Debug|x64" /Project "%comProcess%" "%solution%"