From b3bb374b4022cfe1459b0b15f1d0573c28e135fb Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 27 Mar 2026 16:26:57 +0900 Subject: [PATCH 1/5] fix(stack-analyzer): preserve diagnostics by removing implicit main-only filtering --- include/Config/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Config/config.hpp b/include/Config/config.hpp index 5db7afb..d369826 100644 --- a/include/Config/config.hpp +++ b/include/Config/config.hpp @@ -128,7 +128,7 @@ namespace ctrace std::vector specificTools; ///< List of specific tools to invoke. - std::string entry_points = "main"; ///< Entry points for analysis. + std::string entry_points = ""; ///< Entry points for analysis. std::string report_file = "ctrace-report.txt"; ///< Path to the report file. std::string output_file = "ctrace.out"; ///< Path to the output file. std::string config_file; ///< Path to the JSON config file. From 81c652e776cffacf107a0eee410d1876a12127d0 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 27 Mar 2026 17:50:29 +0900 Subject: [PATCH 2/5] build(deps): bump coretrace-stack-analyzer to v0.18.1 --- cmake/stackUsageAnalyzer.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stackUsageAnalyzer.cmake b/cmake/stackUsageAnalyzer.cmake index 0b27429..cae7a29 100644 --- a/cmake/stackUsageAnalyzer.cmake +++ b/cmake/stackUsageAnalyzer.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( stack_analyzer GIT_REPOSITORY https://github.com/CoreTrace/coretrace-stack-analyzer.git - GIT_TAG v0.17.0 + GIT_TAG v0.18.1 EXCLUDE_FROM_ALL ) From 8a8ed6421e4544c6d14da1a034466ff598e97c97 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 27 Mar 2026 17:51:07 +0900 Subject: [PATCH 3/5] feat(server): add diagnostics_summary_total to analysis responses --- include/Process/Ipc/HttpServer.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/Process/Ipc/HttpServer.hpp b/include/Process/Ipc/HttpServer.hpp index bada6da..367c300 100644 --- a/include/Process/Ipc/HttpServer.hpp +++ b/include/Process/Ipc/HttpServer.hpp @@ -564,6 +564,10 @@ class ApiHandler result["stack_analyzer_mode"] = config.global.stack_analyzer_mode; result["stack_analyzer_output_format"] = config.global.stack_analyzer_output_format; result["stack_analyzer_extra_args"] = config.global.stack_analyzer_extra_args; + const auto diagnosticsSummaryTotal = invoker.diagnosticsSummaryTotal(); + result["diagnostics_summary_total"] = {{"info", diagnosticsSummaryTotal.info}, + {"warning", diagnosticsSummaryTotal.warning}, + {"error", diagnosticsSummaryTotal.error}}; if (output_capture) { json outputs = json::object(); From 17cd660de013cbc821a4ac6b56843140295e6744 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 27 Mar 2026 17:51:28 +0900 Subject: [PATCH 4/5] feat(tools): accumulate diagnostics summaries across executed tools --- include/Process/Tools/ToolsInvoker.hpp | 33 ++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/include/Process/Tools/ToolsInvoker.hpp b/include/Process/Tools/ToolsInvoker.hpp index 49f968e..6b05815 100644 --- a/include/Process/Tools/ToolsInvoker.hpp +++ b/include/Process/Tools/ToolsInvoker.hpp @@ -188,6 +188,21 @@ namespace ctrace runToolList(deduplicateToolNames(tool_names), files); } + [[nodiscard]] DiagnosticSummary diagnosticsSummaryTotal() const + { + std::lock_guard lock(m_diagnosticsSummaryMutex); + + DiagnosticSummary total{}; + for (const auto& [_, summary] : m_diagnosticsSummaryByTool) + { + total.info += summary.info; + total.warning += summary.warning; + total.error += summary.error; + } + + return total; + } + private: void registerTool(const std::string& name, std::unique_ptr tool) { @@ -212,12 +227,12 @@ namespace ctrace { std::lock_guard lock(*lock_it->second); tool_it->second->execute(file, m_config); - logDiagnosticsSummary(tool_name, *tool_it->second); + recordDiagnosticsSummary(tool_name, *tool_it->second); return; } tool_it->second->execute(file, m_config); - logDiagnosticsSummary(tool_name, *tool_it->second); + recordDiagnosticsSummary(tool_name, *tool_it->second); } void executeBatchTool(const std::string& tool_name, const std::vector& files) @@ -242,12 +257,12 @@ namespace ctrace { std::lock_guard lock(*lock_it->second); tool_it->second->executeBatch(files, m_config); - logDiagnosticsSummary(tool_name, *tool_it->second); + recordDiagnosticsSummary(tool_name, *tool_it->second); return; } tool_it->second->executeBatch(files, m_config); - logDiagnosticsSummary(tool_name, *tool_it->second); + recordDiagnosticsSummary(tool_name, *tool_it->second); } void runToolList(const std::vector& tool_names, const std::string& file) @@ -393,12 +408,18 @@ namespace ctrace return tool_name == "ctrace_stack_analyzer"; } - static void logDiagnosticsSummary(const std::string& tool_name, const IAnalysisTool& tool) + void recordDiagnosticsSummary(const std::string& tool_name, const IAnalysisTool& tool) { const auto summary = tool.lastDiagnosticsSummary(); coretrace::log(coretrace::Level::Info, coretrace::Module(tool_name), "Diagnostics summary: info={}, warning={}, error={}\n", summary.info, summary.warning, summary.error); + + std::lock_guard lock(m_diagnosticsSummaryMutex); + auto& total = m_diagnosticsSummaryByTool[tool_name]; + total.info += summary.info; + total.warning += summary.warning; + total.error += summary.error; } std::unordered_map> tools; @@ -411,6 +432,8 @@ namespace ctrace std::shared_ptr m_ipc; std::shared_ptr m_output_capture; std::unique_ptr m_threadPool; + mutable std::mutex m_diagnosticsSummaryMutex; + std::unordered_map m_diagnosticsSummaryByTool; }; } // namespace ctrace From 0c6b57fd8651111865c6c312ebb2781d6876f784 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 27 Mar 2026 17:54:29 +0900 Subject: [PATCH 5/5] chore(style): format code with clang-format --- include/Config/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Config/config.hpp b/include/Config/config.hpp index d369826..631e0b6 100644 --- a/include/Config/config.hpp +++ b/include/Config/config.hpp @@ -128,7 +128,7 @@ namespace ctrace std::vector specificTools; ///< List of specific tools to invoke. - std::string entry_points = ""; ///< Entry points for analysis. + std::string entry_points = ""; ///< Entry points for analysis. std::string report_file = "ctrace-report.txt"; ///< Path to the report file. std::string output_file = "ctrace.out"; ///< Path to the output file. std::string config_file; ///< Path to the JSON config file.