aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-06-13 14:33:55 -0700
committerJoel Fernandes <joelaf@google.com>2017-06-13 14:33:55 -0700
commit6dab7d29725d9a28b7dc7b645babe6b295439fd6 (patch)
tree11281ec970cdcacada9a235d5fcc793387a6bc1b
parentafa9ac7d749bedcedc9896de3bc8852f74538006 (diff)
downloadtrappy-6dab7d29725d9a28b7dc7b645babe6b295439fd6.tar.gz
Revert "Fixes to make normalize time proactive and make all tests pass"
This reverts commit afa9ac7d749bedcedc9896de3bc8852f74538006.
-rw-r--r--tests/test_baretrace.py2
-rw-r--r--tests/test_ftrace.py2
-rw-r--r--trappy/bare_trace.py1
-rw-r--r--trappy/base.py15
-rw-r--r--trappy/ftrace.py4
5 files changed, 1 insertions, 23 deletions
diff --git a/tests/test_baretrace.py b/tests/test_baretrace.py
index 0f5d5c2..33d872c 100644
--- a/tests/test_baretrace.py
+++ b/tests/test_baretrace.py
@@ -60,7 +60,6 @@ class TestBareTrace(unittest.TestCase):
def test_bare_trace_get_duration_normalized(self):
"""BareTrace.get_duration() works if the trace has been normalized"""
- return # HACK: Test no longer valid
trace = trappy.BareTrace()
trace.add_parsed_event("pmu_counter", self.dfr[0].copy())
@@ -74,7 +73,6 @@ class TestBareTrace(unittest.TestCase):
def test_bare_trace_normalize_time_accepts_basetime(self):
"""BareTrace().normalize_time() accepts an arbitrary basetime"""
- return # HACK: Test no longer valid
trace = trappy.BareTrace()
trace.add_parsed_event("pmu_counter", self.dfr[0].copy())
diff --git a/tests/test_ftrace.py b/tests/test_ftrace.py
index 021d70b..389d31f 100644
--- a/tests/test_ftrace.py
+++ b/tests/test_ftrace.py
@@ -183,8 +183,6 @@ class TestFTrace(BaseTestThermal):
def test_ftrace_normalize_time(self):
"""FTrace().normalize_time() works accross all classes"""
- return # HACK: Time normalization test no longer valid
-
trace = trappy.FTrace(normalize_time=False)
prev_inpower_basetime = trace.cpu_in_power.data_frame.index[0]
diff --git a/trappy/bare_trace.py b/trappy/bare_trace.py
index 4900e8a..9787f04 100644
--- a/trappy/bare_trace.py
+++ b/trappy/bare_trace.py
@@ -75,7 +75,6 @@ class BareTrace(object):
the time index
:type basetime: float
"""
- return # HACK: Since we're not normalizing anymore after the fact
if basetime is not None:
self.basetime = basetime
diff --git a/trappy/base.py b/trappy/base.py
index c0238cf..fa3345a 100644
--- a/trappy/base.py
+++ b/trappy/base.py
@@ -256,18 +256,3 @@ class Base(object):
:type fname: str
"""
self.data_frame.to_csv(fname)
-
- def normalize_time(self, basetime):
- """Substract basetime from the Time of the data frame
-
- :param basetime: The offset which needs to be subtracted from
- the time index
- :type basetime: float
- """
- # HACK: We don't normalize anymore after the fact
- return
-
- if basetime and not self.data_frame.empty:
- self.data_frame.reset_index(inplace=True)
- self.data_frame["Time"] = self.data_frame["Time"] - basetime
- self.data_frame.set_index("Time", inplace=True)
diff --git a/trappy/ftrace.py b/trappy/ftrace.py
index 07cb94b..b959b02 100644
--- a/trappy/ftrace.py
+++ b/trappy/ftrace.py
@@ -61,8 +61,6 @@ subclassed by FTrace (for parsing FTrace coming from trace-cmd) and SysTrace."""
abs_window=(0, None), build_df=True):
super(GenericFTrace, self).__init__(name, build_df)
- self.normalized_time = normalize_time
-
if not hasattr(self, "needs_raw_parsing"):
self.needs_raw_parsing = False
@@ -219,7 +217,7 @@ subclassed by FTrace (for parsing FTrace coming from trace-cmd) and SysTrace."""
except AttributeError:
continue
- if self.normalized_time:
+ if self.normalize_time:
timestamp = timestamp - self.basetime
data_str = line[data_start_idx:]