diff options
author | Javi Merino <javi.merino@arm.com> | 2016-03-07 18:32:21 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2016-03-07 18:32:21 +0000 |
commit | d9cdc2b52f69d47529b86de41c7cc8e9ef53745a (patch) | |
tree | 9435fb5b4064ce2a077d87d8c033156f930721e1 /tests/test_base.py | |
parent | 416e23442c484b09bfda2704fdea73a148fc6a67 (diff) | |
download | trappy-d9cdc2b52f69d47529b86de41c7cc8e9ef53745a.tar.gz |
test: use existing timestamp in test_parse_special_field
Calculating our the timestamp for the index of events is not needed. Tell
trappy to not normalize the time and that way we don't need to do the
error-prone calculation ourselves.
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 5fa3d78..5d3b716 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -123,17 +123,16 @@ class TestBase(utils_tests.SetupDirectory): fout.write(in_data) ftrace_parser = trappy.register_dynamic_ftrace("Event0", "event0", scope="sched") - trace = trappy.FTrace() + trace = trappy.FTrace(normalize_time=False) dfr = trace.event0.data_frame self.assertEquals(set(dfr.columns), expected_columns) - for idx in range(len(events)): - timestamp = str( dfr.index[idx]+float(events.keys()[0])) - self.assertTrue(timestamp in events) - self.assertEquals(dfr["__comm"].iloc[idx], events[timestamp]['task']) - self.assertEquals(dfr["__pid"].iloc[idx], events[timestamp]['pid']) - self.assertEquals(dfr["__cpu"].iloc[idx], events[timestamp]['cpu']) + for timestamp, event in events.iteritems(): + timestamp = float(timestamp) + self.assertEquals(dfr["__comm"].loc[timestamp], event['task']) + self.assertEquals(dfr["__pid"].loc[timestamp], event['pid']) + self.assertEquals(dfr["__cpu"].loc[timestamp], event['cpu']) trappy.unregister_dynamic_ftrace(ftrace_parser) |