aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cr2/__init__.py2
-rw-r--r--cr2/power.py8
-rw-r--r--tests/test_power.py16
-rw-r--r--tests/test_thermal.py4
-rw-r--r--tests/trace.datbin1609728 -> 1667072 bytes
5 files changed, 14 insertions, 16 deletions
diff --git a/cr2/__init__.py b/cr2/__init__.py
index 887bf7b..fd276a9 100644
--- a/cr2/__init__.py
+++ b/cr2/__init__.py
@@ -24,7 +24,7 @@ def summary_plots(**kwords):
kwords["height"] = 5
# XXX This needs to be made generic
- map_label = {0: "A7", 1: "A15"}
+ map_label = {"0000000f": "A7", "000000f0": "A15"}
gov_data.plot_temperature(**kwords)
inpower_data.plot_load(map_label, **kwords)
diff --git a/cr2/power.py b/cr2/power.py
index a8f84e5..871238c 100644
--- a/cr2/power.py
+++ b/cr2/power.py
@@ -99,10 +99,10 @@ class InPower(BaseThermal):
for col in load_cols[1:]:
load_series += dfr[col]
- load_dfr = pd.DataFrame({"cluster": dfr["cluster"], "load": load_series})
- cluster_numbers = set(dfr["cluster"])
+ load_dfr = pd.DataFrame({"cpus": dfr["cpus"], "load": load_series})
+ cluster_numbers = set(dfr["cpus"])
- return pivot_with_labels(load_dfr, "load", "cluster", mapping_label)
+ return pivot_with_labels(load_dfr, "load", "cpus", mapping_label)
def get_all_freqs(self, mapping_label):
"""get a DataFrame with the "in" frequencies as seen by the governor
@@ -112,7 +112,7 @@ class InPower(BaseThermal):
dfr = self.get_data_frame()
- return pivot_with_labels(dfr, "freq", "cluster", mapping_label) / 1000
+ return pivot_with_labels(dfr, "freq", "cpus", mapping_label) / 1000
def plot_load(self, mapping_label, title="", width=None, height=None):
"""plot the load of all the clusters, similar to how compare runs did it
diff --git a/tests/test_power.py b/tests/test_power.py
index 35fc964..51ea6a9 100644
--- a/tests/test_power.py
+++ b/tests/test_power.py
@@ -42,27 +42,25 @@ class TestPower(TestThermalBase):
"""Test InPower.get_data_frame()"""
df = InPower().get_data_frame()
- self.assertEquals(df["load0"].iloc[0], 2)
+ self.assertEquals(df["load0"].iloc[0], 5)
self.assertTrue("load0" in df.columns)
def test_inpower_get_all_freqs(self):
"""Test InPower.get_all_freqs()"""
- map_label = {1: "A15",
- 0: "A7"}
- dfr = InPower().get_all_freqs(map_label)
+ dfr = InPower().get_all_freqs(self.map_label)
self.assertEquals(dfr["A15"].iloc[0], 1900)
self.assertEquals(dfr["A7"].iloc[1], 500)
- self.assertEquals(dfr["A15"].iloc[18], 1800)
+ self.assertEquals(dfr["A7"].iloc[11], 1400)
def test_inpower_get_load_data(self):
"""Test InPower.get_load_data()"""
- load_data = InPower().get_load_data({0: "A7", 1: "A15"})
+ load_data = InPower().get_load_data(self.map_label)
- self.assertEquals(load_data["A15"].iloc[0], 2 + 6 + 0 + 1)
- self.assertEquals(load_data["A7"].iloc[3], 9 + 7 + 20 + 2)
+ self.assertEquals(load_data["A15"].iloc[0], 5 + 3 + 0 + 2)
+ self.assertEquals(load_data["A7"].iloc[3], 20 + 37 + 7 + 25)
self.assertEquals(load_data["A15"].iloc[0], load_data["A15"].iloc[1])
def test_inpower_plot_load(self):
"""Test that InPower.plot_load() doesn't explode"""
- InPower().plot_load({0: "A7", 1: "A15"}, title="Util")
+ InPower().plot_load(self.map_label, title="Util")
diff --git a/tests/test_thermal.py b/tests/test_thermal.py
index 100ed57..f752fa8 100644
--- a/tests/test_thermal.py
+++ b/tests/test_thermal.py
@@ -21,7 +21,7 @@ class TestThermal(TestThermalBase):
df = Thermal().get_data_frame()
self.assertTrue("thermal_zone" in df.columns)
- self.assertEquals(df["temp"].iloc[0], 45000)
+ self.assertEquals(df["temp"].iloc[0], 44000)
def test_post__plot_setup(self):
"""Test that post_plot_setup() doesn't bomb"""
@@ -64,7 +64,7 @@ class TestThermalGovernor(TestThermalBase):
def test_get_thermal_csv(self):
ThermalGovernor().write_thermal_csv()
- first_data_line = '1094.696946,0,112,12,124,2718,5036,756,8510,8511,8511,48000,9000\n'
+ first_data_line = '666.731837,3,124,10,137,2718,5036,755,8509,8511,8511,48000,9000\n'
with open("thermal.csv") as f:
first_line = f.readline()
diff --git a/tests/trace.dat b/tests/trace.dat
index 3ea303c..40acbc1 100644
--- a/tests/trace.dat
+++ b/tests/trace.dat
Binary files differ