.format(e.message)) # The second event is recognised as a cpu_frequency event and therefore # put under trace.cpu_frequency self.assertEqual(trace.tracing_mark_write.data_frame.iloc[0]["string"], "TRACE_MARKER_START") self.assertEqual(len(trace.tracing_mark_write.data_frame), 1) self.assertEqual(len(trace.cpu_frequency.data_frame), 1) def test_ftrace_metadata(self): """FTrace class correctly populates metadata""" trace = trappy.FTrace() self.assertEqual(int(trace._version), 6) self.assertEqual(int(trace._cpus), 6) @unittest.skipUnless(utils_tests.trace_cmd_installed(), "trace-cmd not installed") class TestFTraceRawDat(utils_tests.SetupDirectory): def __init__(self, *args, **kwargs): super(TestFTraceRawDat, self).__init__( [("raw_trace.dat", "trace.dat")], *args, **kwargs) def test_raw_dat(self): """Tests an event that relies on raw parsing""" trace = trappy.FTrace() self.assertTrue(hasattr(trace, "sched_switch")) self.assertTrue(len(trace.sched_switch.data_frame) > 0)
# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import trappy from trappy.stats.Topology import Topology import unittest import utils_tests from bart.sched.SchedAssert import SchedAssert @unittest.skipUnless(utils_tests.trace_cmd_installed(), "trace-cmd not installed") class TestSchedAssert(utils_tests.SetupDirectory): def __init__(self, *args, **kwargs): self.BIG = [1,2] self.LITTLE = [0, 3, 4, 5] self.clusters = [self.BIG, self.LITTLE] self.topology = Topology(clusters=self.clusters) super(TestSchedAssert, self).__init__( [("raw_trace.dat", "trace.dat")], *args, **kwargs) def test_get_runtime(self):