From 29dc3b153919f9286545efe37b728b9a17b0c3df Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Fri, 10 Oct 2025 15:21:41 +0200 Subject: [PATCH] Fix Python metrics in Trace Analyzer --- extensions/apps/traceAnalyzer/scripts/memUtil.py | 2 +- src/traceAnalyzer/businessObjects/pythoncaller.cpp | 9 ++++++--- src/traceAnalyzer/businessObjects/pythoncaller.h | 5 ----- src/traceAnalyzer/main.cpp | 4 +++- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/apps/traceAnalyzer/scripts/memUtil.py b/extensions/apps/traceAnalyzer/scripts/memUtil.py index 90824c46..da118ba4 100644 --- a/extensions/apps/traceAnalyzer/scripts/memUtil.py +++ b/extensions/apps/traceAnalyzer/scripts/memUtil.py @@ -112,7 +112,7 @@ def maximum_data_rate(connection): # Backwards compatibility for traces where clkMHz was not yet replaced with tCK clk = None try: - clk = 1000000 / memspec.getIntValue("memtimingspec", "tCK") + clk = 1000000 / memspec.jsonMemSpec['memspec']['memtimingspec']['tCK'] except: clk = memspec.getIntValue("memtimingspec", "clkMhz") diff --git a/src/traceAnalyzer/businessObjects/pythoncaller.cpp b/src/traceAnalyzer/businessObjects/pythoncaller.cpp index f55effed..953f8e7b 100644 --- a/src/traceAnalyzer/businessObjects/pythoncaller.cpp +++ b/src/traceAnalyzer/businessObjects/pythoncaller.cpp @@ -37,11 +37,14 @@ * Derek Christ */ -#include "pythoncaller.h" -#include -#include +// Has to come first. #include #include + +#include "pythoncaller.h" + +#include +#include #include std::string PythonCaller::generatePlots(std::string_view pathToTrace) diff --git a/src/traceAnalyzer/businessObjects/pythoncaller.h b/src/traceAnalyzer/businessObjects/pythoncaller.h index 06b0cf70..e7172b42 100644 --- a/src/traceAnalyzer/businessObjects/pythoncaller.h +++ b/src/traceAnalyzer/businessObjects/pythoncaller.h @@ -40,11 +40,6 @@ #ifndef PYTHONCALLER_H #define PYTHONCALLER_H -// Workaround for CMAKE and Python -#ifdef slots -#undef slots -#endif - #include "businessObjects/tracecalculatedmetrics.h" #include diff --git a/src/traceAnalyzer/main.cpp b/src/traceAnalyzer/main.cpp index 860f5a23..a3a8ffed 100644 --- a/src/traceAnalyzer/main.cpp +++ b/src/traceAnalyzer/main.cpp @@ -36,6 +36,9 @@ * Derek Christ */ +// Has to come first. +#include + #include "traceanalyzer.h" #include @@ -46,7 +49,6 @@ #include #include #include -#include int main(int argc, char* argv[]) {