From 9a4f8eda1e3ee8cd0d7eeccca5b7ffd3c61dca7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Thu, 2 Aug 2018 14:44:20 +0200 Subject: [PATCH] Fix getThreads() in metrics script. Bug introduced by pull request #191. https://git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system/pull/191 Tests with refresh disabled made the bug evident. --- DRAMSys/traceAnalyzer/scripts/memUtil.py | 6 ++++++ DRAMSys/traceAnalyzer/scripts/metrics.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/scripts/memUtil.py b/DRAMSys/traceAnalyzer/scripts/memUtil.py index 3779a315..958aa0e1 100755 --- a/DRAMSys/traceAnalyzer/scripts/memUtil.py +++ b/DRAMSys/traceAnalyzer/scripts/memUtil.py @@ -90,3 +90,9 @@ def getMaxRefBurst(connection): cursor.execute(" SELECT MaxRefBurst FROM GeneralInfo ") result = cursor.fetchone() return result[0] + +def getControllerThread(connection): + cursor = connection.cursor() + cursor.execute("SELECT ControllerThread FROM GeneralInfo") + result = cursor.fetchone() + return result[0] diff --git a/DRAMSys/traceAnalyzer/scripts/metrics.py b/DRAMSys/traceAnalyzer/scripts/metrics.py index 191f6654..a06997af 100644 --- a/DRAMSys/traceAnalyzer/scripts/metrics.py +++ b/DRAMSys/traceAnalyzer/scripts/metrics.py @@ -18,8 +18,10 @@ def threadMetric(function): def getThreads(connection): + cthread = getControllerThread(connection) cursor = connection.cursor() - cursor.execute("SELECT DISTINCT(TThread) FROM transactions WHERE TThread != 0 ORDER BY TThread") + query = "SELECT DISTINCT(TThread) FROM transactions WHERE TThread != " + str(cthread) + " ORDER BY TThread" + cursor.execute(query) result = [] for currentRow in cursor: result.append(currentRow[0])