aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2016-01-27 18:12:01 +0000
committerJavi Merino <javi.merino@arm.com>2016-01-27 18:12:01 +0000
commit7881a53f3898b121e04de245a80f24976ae198b6 (patch)
treef1610ed5f39cd4e015f2da0f718af7990eb2e87d
parent79310bfbf0050de7330efbc84a5dc5d0834aa3eb (diff)
downloadbart-7881a53f3898b121e04de245a80f24976ae198b6.tar.gz
bart: Use trappy.FTrace instead of trappy.Run
As of c26a32321053 ("ftrace: rename Run to FTrace"), trappy deprecated trappy.Run in favour of trappy.FTrace. Move bart to use the new interface.
-rw-r--r--bart/common/Analyzer.py4
-rw-r--r--bart/common/Utils.py10
-rw-r--r--bart/common/signal.py4
-rwxr-xr-xbart/sched/SchedAssert.py24
-rwxr-xr-xbart/sched/SchedMatrix.py12
-rwxr-xr-xbart/sched/SchedMultiAssert.py30
-rw-r--r--bart/sched/functions.py54
-rw-r--r--bart/thermal/ThermalAssert.py14
-rw-r--r--docs/examples/thermal.py4
-rw-r--r--docs/notebooks/sched/SchedDeadline.ipynb12
-rw-r--r--docs/notebooks/thermal/Thermal.ipynb10
-rw-r--r--tests/test_sched_assert.py2
-rw-r--r--tests/test_signal.py26
13 files changed, 103 insertions, 103 deletions
diff --git a/bart/common/Analyzer.py b/bart/common/Analyzer.py
index d9dc74d..7bb55c9 100644
--- a/bart/common/Analyzer.py
+++ b/bart/common/Analyzer.py
@@ -30,8 +30,8 @@ import pandas as pd
class Analyzer(object):
"""
- :param data: TRAPpy Run Object
- :type data: :mod:`trappy.run.Run`
+ :param data: TRAPpy FTrace Object
+ :type data: :mod:`trappy.ftrace.FTrace`
:param config: A dictionary of variables, classes
and functions that can be used in the statements
diff --git a/bart/common/Utils.py b/bart/common/Utils.py
index 3ab99b6..fdfd1e0 100644
--- a/bart/common/Utils.py
+++ b/bart/common/Utils.py
@@ -31,18 +31,18 @@ def listify(to_select):
return to_select
-def init_run(trace):
- """Initialize the Run Object
+def init_ftrace(trace):
+ """Initialize the FTrace Object
:param trace: Path for the trace file
or a trace object
- :type trace: str, :mod:`trappy.run.Run`
+ :type trace: str, :mod:`trappy.ftrace.FTrace`
"""
if isinstance(trace, basestring):
- return trappy.Run(trace)
+ return trappy.FTrace(trace)
- elif isinstance(trace, trappy.Run):
+ elif isinstance(trace, trappy.FTrace):
return trace
raise ValueError("Invalid trace Object")
diff --git a/bart/common/signal.py b/bart/common/signal.py
index 6860144..acf7091 100644
--- a/bart/common/signal.py
+++ b/bart/common/signal.py
@@ -56,8 +56,8 @@ from bart.common.Utils import area_under_curve, interval_sum
class SignalCompare(object):
"""
- :param data: TRAPpy Run Object
- :type data: :mod:`trappy.run.Run`
+ :param data: TRAPpy FTrace Object
+ :type data: :mod:`trappy.ftrace.FTrace`
:param sig_a: The first signal
:type sig_a: str
diff --git a/bart/sched/SchedAssert.py b/bart/sched/SchedAssert.py
index bf141c7..e20aecb 100755
--- a/bart/sched/SchedAssert.py
+++ b/bart/sched/SchedAssert.py
@@ -35,9 +35,9 @@ class SchedAssert(object):
predefined scheduler scenarios. This does not compare parameters
across runs
- :param run: A single trappy.Run object
- or a path that can be passed to trappy.Run
- :type run: :mod:`trappy.run.Run`
+ :param ftrace: A single trappy.FTrace object
+ or a path that can be passed to trappy.FTrace
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param topology: A topology that describes the arrangement of
CPU's on a system. This is useful for multi-cluster systems
@@ -65,19 +65,19 @@ class SchedAssert(object):
there are more than one processes with the same execname
"""
- def __init__(self, run, topology, execname=None, pid=None):
+ def __init__(self, ftrace, topology, execname=None, pid=None):
- run = Utils.init_run(run)
+ ftrace = Utils.init_ftrace(ftrace)
if not execname and not pid:
raise ValueError("Need to specify at least one of pid or execname")
self.execname = execname
- self._run = run
+ self._ftrace = ftrace
self._pid = self._validate_pid(pid)
self._aggs = {}
self._topology = topology
- self._triggers = sched_funcs.sched_triggers(self._run, self._pid,
+ self._triggers = sched_funcs.sched_triggers(self._ftrace, self._pid,
trappy.sched.SchedSwitch)
self.name = "{}-{}".format(self.execname, self._pid)
@@ -85,7 +85,7 @@ class SchedAssert(object):
"""Validate the passed pid argument"""
if not pid:
- pids = sched_funcs.get_pids_for_process(self._run,
+ pids = sched_funcs.get_pids_for_process(self._ftrace,
self.execname)
if len(pids) != 1:
@@ -98,7 +98,7 @@ class SchedAssert(object):
elif self.execname:
- pids = sched_funcs.get_pids_for_process(self._run,
+ pids = sched_funcs.get_pids_for_process(self._ftrace,
self.execname)
if pid not in pids:
raise RuntimeError(
@@ -106,7 +106,7 @@ class SchedAssert(object):
pid,
self.execname))
else:
- self.execname = sched_funcs.get_task_name(self._run, pid)
+ self.execname = sched_funcs.get_task_name(self._ftrace, pid)
return pid
@@ -388,7 +388,7 @@ class SchedAssert(object):
begin, end = window
total_time = end - begin
else:
- total_time = self._run.get_duration()
+ total_time = self._ftrace.get_duration()
run_time = run_time * 100
run_time = run_time / total_time
@@ -638,7 +638,7 @@ class SchedAssert(object):
if not xlim:
if not window:
- xlim = [0, self._run.get_duration()]
+ xlim = [0, self._ftrace.get_duration()]
else:
xlim = list(window)
diff --git a/bart/sched/SchedMatrix.py b/bart/sched/SchedMatrix.py
index 3c0a4ca..4595469 100755
--- a/bart/sched/SchedMatrix.py
+++ b/bart/sched/SchedMatrix.py
@@ -82,13 +82,13 @@ POSITIVE_TOLERANCE = 0.80
class SchedMatrix(object):
"""
- :param reference_trace: The trace file path/run object
+ :param reference_trace: The trace file path/ftrace object
to be used as a reference
- :type reference_trace: str, :mod:`trappy.run.Run`
+ :type reference_trace: str, :mod:`trappy.ftrace.FTrace`
- :param trace: The trace file path/run object
+ :param trace: The trace file path/ftrace object
to be verified
- :type trace: str, :mod:`trappy.run.Run`
+ :type trace: str, :mod:`trappy.ftrace.FTrace`
:param topology: A topology that describes the arrangement of
CPU's on a system. This is useful for multi-cluster systems
@@ -152,8 +152,8 @@ class SchedMatrix(object):
execnames,
aggfunc=sched_funcs.csum):
- run = Utils.init_run(trace)
- reference_run = Utils.init_run(reference_trace)
+ run = Utils.init_ftrace(trace)
+ reference_run = Utils.init_ftrace(reference_trace)
self._execnames = Utils.listify(execnames)
self._reference_pids = self._populate_pids(reference_run)
diff --git a/bart/sched/SchedMultiAssert.py b/bart/sched/SchedMultiAssert.py
index 492590a..bc37798 100755
--- a/bart/sched/SchedMultiAssert.py
+++ b/bart/sched/SchedMultiAssert.py
@@ -27,9 +27,9 @@ class SchedMultiAssert(object):
"""This is vector assertion class built on top of
:mod:`bart.sched.SchedAssert.SchedAssert`
- :param run: A single trappy.Run object
- or a path that can be passed to trappy.Run
- :type run: :mod:`trappy.run.Run`
+ :param ftrace: A single trappy.FTrace object
+ or a path that can be passed to trappy.FTrace
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param topology: A topology that describes the arrangement of
CPU's on a system. This is useful for multi-cluster systems
@@ -64,17 +64,17 @@ class SchedMultiAssert(object):
- Using execname prefix match
::
- SchedMultiAssert(run, topology, execnames="task_")
+ SchedMultiAssert(ftrace, topology, execnames="task_")
- Individual Task names
::
- SchedMultiAssert(run, topology, execnames=["task_1", "task_2", "task_3"])
+ SchedMultiAssert(ftrace, topology, execnames=["task_1", "task_2", "task_3"])
- Using Process IDs
::
- SchedMultiAssert(run, topology, pids=[11, 22, 33])
+ SchedMultiAssert(ftrace, topology, pids=[11, 22, 33])
All the functionality provided in :mod:`bart.sched.SchedAssert.SchedAssert` is available
@@ -83,7 +83,7 @@ class SchedMultiAssert(object):
For example consider the use of :func:`getDutyCycle`
::
- >>> s = SchedMultiAssert(run, topology, execnames="task_")
+ >>> s = SchedMultiAssert(ftrace, topology, execnames="task_")
>>> s.getDutyCycle(window=(start, end))
{
"11": {
@@ -104,7 +104,7 @@ class SchedMultiAssert(object):
::
>>> import operator as op
- >>> s = SchedMultiAssert(run, topology, execnames="task_")
+ >>> s = SchedMultiAssert(ftrace, topology, execnames="task_")
>>> s.assertDutyCycle(15, op.ge, window=(start, end))
{
"11": {
@@ -127,7 +127,7 @@ class SchedMultiAssert(object):
::
>>> import operator as op
- >>> s = SchedMultiAssert(run, topology, execnames="task_")
+ >>> s = SchedMultiAssert(ftrace, topology, execnames="task_")
>>> s.assertDutyCycle(15, op.ge, window=(start, end), rank=2)
True
@@ -135,9 +135,9 @@ class SchedMultiAssert(object):
functionality
"""
- def __init__(self, run, topology, execnames=None, pids=None):
+ def __init__(self, ftrace, topology, execnames=None, pids=None):
- self._run = Utils.init_run(run)
+ self._ftrace = Utils.init_ftrace(ftrace)
self._topology = topology
if execnames and pids:
@@ -159,7 +159,7 @@ class SchedMultiAssert(object):
asserts = {}
for pid in self._pids:
- asserts[pid] = SchedAssert(self._run, self._topology, pid=pid)
+ asserts[pid] = SchedAssert(self._ftrace, self._topology, pid=pid)
return asserts
@@ -167,12 +167,12 @@ class SchedMultiAssert(object):
"""Map the input execnames to PIDs"""
if len(self._execnames) == 1:
- return sched_funcs.get_pids_for_process(self._run, self._execnames[0])
+ return sched_funcs.get_pids_for_process(self._ftrace, self._execnames[0])
pids = []
for proc in self._execnames:
- pids += sched_funcs.get_pids_for_process(self._run, proc)
+ pids += sched_funcs.get_pids_for_process(self._ftrace, proc)
return list(set(pids))
@@ -248,7 +248,7 @@ class SchedMultiAssert(object):
if not xlim:
if not window:
- xlim = [0, self._run.get_duration()]
+ xlim = [0, self._ftrace.get_duration()]
else:
xlim = list(window)
diff --git a/bart/sched/functions.py b/bart/sched/functions.py
index 7966f45..546e8fb 100644
--- a/bart/sched/functions.py
+++ b/bart/sched/functions.py
@@ -414,12 +414,12 @@ def binary_correlate(series_x, series_y):
return (agree - disagree) / float(len(series_x))
-def get_pids_for_process(run, execname, cls=None):
+def get_pids_for_process(ftrace, execname, cls=None):
"""Get the PIDs for a given process
- :param run: A run object with a sched_switch
+ :param ftrace: A ftrace object with a sched_switch
event
- :type run: :mod:`trappy.run.Run`
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param execname: The name of the process
:type execname: str
@@ -433,22 +433,22 @@ def get_pids_for_process(run, execname, cls=None):
if not cls:
try:
- df = run.sched_switch.data_frame
+ df = ftrace.sched_switch.data_frame
except AttributeError:
- raise ValueError("SchedSwitch event not found in run")
+ raise ValueError("SchedSwitch event not found in ftrace")
else:
- event = getattr(run, cls.name)
+ event = getattr(ftrace, cls.name)
df = event.data_frame
mask = df["next_comm"].apply(lambda x : True if x.startswith(execname) else False)
return list(np.unique(df[mask]["next_pid"].values))
-def get_task_name(run, pid, cls=None):
+def get_task_name(ftrace, pid, cls=None):
"""Returns the execname for pid
- :param run: A run object with a sched_switch
+ :param ftrace: A ftrace object with a sched_switch
event
- :type run: :mod:`trappy.run.Run`
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param pid: The PID of the process
:type pid: int
@@ -462,11 +462,11 @@ def get_task_name(run, pid, cls=None):
if not cls:
try:
- df = run.sched_switch.data_frame
+ df = ftrace.sched_switch.data_frame
except AttributeError:
- raise ValueError("SchedSwitch event not found in run")
+ raise ValueError("SchedSwitch event not found in ftrace")
else:
- event = getattr(run, cls.name)
+ event = getattr(ftrace, cls.name)
df = event.data_frame
df = df[df["next_pid"] == pid]
@@ -475,12 +475,12 @@ def get_task_name(run, pid, cls=None):
else:
return df["next_comm"].values[0]
-def sched_triggers(run, pid, sched_switch_class):
+def sched_triggers(ftrace, pid, sched_switch_class):
"""Returns the list of sched_switch triggers
- :param run: A run object with a sched_switch
+ :param ftrace: A ftrace object with a sched_switch
event
- :type run: :mod:`trappy.run.Run`
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param pid: The PID of the associated process
:type pid: int
@@ -495,19 +495,19 @@ def sched_triggers(run, pid, sched_switch_class):
triggers[1] = switch_out_trigger
"""
- if not hasattr(run, "sched_switch"):
- raise ValueError("SchedSwitch event not found in run")
+ if not hasattr(ftrace, "sched_switch"):
+ raise ValueError("SchedSwitch event not found in ftrace")
triggers = []
- triggers.append(sched_switch_in_trigger(run, pid, sched_switch_class))
- triggers.append(sched_switch_out_trigger(run, pid, sched_switch_class))
+ triggers.append(sched_switch_in_trigger(ftrace, pid, sched_switch_class))
+ triggers.append(sched_switch_out_trigger(ftrace, pid, sched_switch_class))
return triggers
-def sched_switch_in_trigger(run, pid, sched_switch_class):
+def sched_switch_in_trigger(ftrace, pid, sched_switch_class):
"""
- :param run: A run object with a sched_switch
+ :param ftrace: A ftrace object with a sched_switch
event
- :type run: :mod:`trappy.run.Run`
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param pid: The PID of the associated process
:type pid: int
@@ -522,17 +522,17 @@ def sched_switch_in_trigger(run, pid, sched_switch_class):
task_in = {}
task_in[NEXT_PID_FIELD] = pid
- return Trigger(run,
+ return Trigger(ftrace,
sched_switch_class, # trappy Event Class
task_in, # Filter Dictionary
SCHED_SWITCH_IN, # Trigger Value
CPU_FIELD) # Primary Pivot
-def sched_switch_out_trigger(run, pid, sched_switch_class):
+def sched_switch_out_trigger(ftrace, pid, sched_switch_class):
"""
- :param run: A run object with a sched_switch
+ :param ftrace: A ftrace object with a sched_switch
event
- :type run: :mod:`trappy.run.Run`
+ :type ftrace: :mod:`trappy.ftrace.FTrace`
:param pid: The PID of the associated process
:type pid: int
@@ -547,7 +547,7 @@ def sched_switch_out_trigger(run, pid, sched_switch_class):
task_out = {}
task_out[PREV_PID_FIELD] = pid
- return Trigger(run,
+ return Trigger(ftrace,
sched_switch_class, # trappy Event Class
task_out, # Filter Dictionary
SCHED_SWITCH_OUT, # Trigger Value
diff --git a/bart/thermal/ThermalAssert.py b/bart/thermal/ThermalAssert.py
index e7c3431..d0ffa78 100644
--- a/bart/thermal/ThermalAssert.py
+++ b/bart/thermal/ThermalAssert.py
@@ -25,17 +25,17 @@ import numpy as np
# pylint: disable=too-many-arguments
class ThermalAssert(object):
- """A class that accepts a TRAPpy Run object and
+ """A class that accepts a TRAPpy FTrace object and
provides assertions for thermal behaviours
- :param run: A path to the trace file or a TRAPpy Run object
- :type run: str, :mod:`trappy.run.Run`
+ :param ftrace: A path to the trace file or a TRAPpy FTrace object
+ :type ftrace: str, :mod:`trappy.ftrace.FTrace`
"""
- def __init__(self, run, config=None):
+ def __init__(self, ftrace, config=None):
- self._run = Utils.init_run(run)
- self._analyzer = Analyzer(self._run, config)
+ self._ftrace = Utils.init_ftrace(ftrace)
+ self._analyzer = Analyzer(self._ftrace, config)
def getThermalResidency(self, temp_range, window, percent=False):
"""Return the total time spent in a given temperature range
@@ -78,7 +78,7 @@ class ThermalAssert(object):
if percent:
result[pivot] = (
- result[pivot] * 100.0) / self._run.get_duration()
+ result[pivot] * 100.0) / self._ftrace.get_duration()
return result
diff --git a/docs/examples/thermal.py b/docs/examples/thermal.py
index 2b3e0bb..8fe3e95 100644
--- a/docs/examples/thermal.py
+++ b/docs/examples/thermal.py
@@ -30,7 +30,7 @@ class TestThermal(unittest.TestCase):
# Which then copies the required traces for analysis to
# the host.
trace_file = "update_a_trace_path_here"
- run = trappy.Run(trace_file, "test_run")
+ ftrace = trappy.FTrace(trace_file, "test_run")
# Define the parameters that you intend to use in the grammar
config = {}
@@ -48,7 +48,7 @@ class TestThermal(unittest.TestCase):
cls.BIG = '000000f0'
cls.LITTLE = '0000000f'
cls.tz = 0
- cls.analyzer = Analyzer(run, config)
+ cls.analyzer = Analyzer(ftrace, config)
def test_temperature_quartile(self):
"""Assert Temperature quartile"""
diff --git a/docs/notebooks/sched/SchedDeadline.ipynb b/docs/notebooks/sched/SchedDeadline.ipynb
index dac2890..95cd0e2 100644
--- a/docs/notebooks/sched/SchedDeadline.ipynb
+++ b/docs/notebooks/sched/SchedDeadline.ipynb
@@ -84,10 +84,10 @@
"collapsed": false,
"input": [
"TRACE_FILE = os.path.join(BASE_PATH, \"yield\")\n",
- "run = trappy.Run(TRACE_FILE, \"cpuhog\")\n",
+ "ftrace = trappy.FTrace(TRACE_FILE, \"cpuhog\")\n",
"\n",
"# Assert Period\n",
- "s = SchedMultiAssert(run, topology, execnames=\"periodic_yield\")\n",
+ "s = SchedMultiAssert(ftrace, topology, execnames=\"periodic_yield\")\n",
"if s.assertPeriod(30, between_threshold, rank=1):\n",
" print \"PASS: Period\"\n",
" print json.dumps(s.getPeriod(), indent=3)\n",
@@ -154,8 +154,8 @@
"collapsed": false,
"input": [
"TRACE_FILE = os.path.join(BASE_PATH, \"cpuhog\")\n",
- "run = trappy.Run(TRACE_FILE, \"cpuhog\")\n",
- "s = SchedMultiAssert(run, topology, execnames=\"cpuhog\")\n",
+ "ftrace = trappy.FTrace(TRACE_FILE, \"cpuhog\")\n",
+ "s = SchedMultiAssert(ftrace, topology, execnames=\"cpuhog\")\n",
"s.plot().view()\n",
"\n",
"# Assert DutyCycle\n",
@@ -381,8 +381,8 @@
"collapsed": false,
"input": [
"TRACE_FILE = os.path.join(BASE_PATH, \"cancel_dl_timer\")\n",
- "run = trappy.Run(TRACE_FILE, \"cpuhog\")\n",
- "s = SchedAssert(run, topology, execname=\"cpuhog\")\n",
+ "ftrace = trappy.FTrace(TRACE_FILE, \"cpuhog\")\n",
+ "s = SchedAssert(ftrace, topology, execname=\"cpuhog\")\n",
"s.plot().view()\n",
"\n",
"NUM_PHASES = 10\n",
diff --git a/docs/notebooks/thermal/Thermal.ipynb b/docs/notebooks/thermal/Thermal.ipynb
index 087d9b8..bf51929 100644
--- a/docs/notebooks/thermal/Thermal.ipynb
+++ b/docs/notebooks/thermal/Thermal.ipynb
@@ -106,7 +106,7 @@
"level": 1,
"metadata": {},
"source": [
- "Run Object"
+ "FTrace Object"
]
},
{
@@ -115,7 +115,7 @@
"input": [
"# Create a Trace object\n",
"\n",
- "run = trappy.Run(TRACE_FILE, \"SomeBenchMark\")"
+ "ftrace = trappy.FTrace(TRACE_FILE, \"SomeBenchMark\")"
],
"language": "python",
"metadata": {},
@@ -137,7 +137,7 @@
"# Create an Assertion Object\n",
"\n",
"from bart.common.Analyzer import Analyzer\n",
- "t = Analyzer(run, config)\n",
+ "t = Analyzer(ftrace, config)\n",
"\n",
"BIG = '000000f0'\n",
"LITTLE = '0000000f'"
@@ -349,8 +349,8 @@
"input": [
"from bart.thermal.ThermalAssert import ThermalAssert\n",
"\n",
- "t_assert = ThermalAssert(run)\n",
- "end = run.get_duration()\n",
+ "t_assert = ThermalAssert(ftrace)\n",
+ "end = ftrace.get_duration()\n",
"\n",
"LOW = 0\n",
"HIGH = 78000\n",
diff --git a/tests/test_sched_assert.py b/tests/test_sched_assert.py
index 485326d..f746a77 100644
--- a/tests/test_sched_assert.py
+++ b/tests/test_sched_assert.py
@@ -39,7 +39,7 @@ class TestSchedAssert(utils_tests.SetupDirectory):
def test_get_runtime(self):
- r = trappy.Run()
+ r = trappy.FTrace()
# The ls process is process we are
# testing against with pre calculated
# values
diff --git a/tests/test_signal.py b/tests/test_signal.py
index 746f86c..889eff3 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -35,11 +35,11 @@ class TestSignalCompare(TestBART):
A = [0, 0, 0, 3, 3, 0, 0, 0]
B = [0, 0, 2, 2, 2, 2, 1, 1]
- run = trappy.Run(".", events=["event"])
+ ftrace = trappy.FTrace(".", events=["event"])
df = pd.DataFrame({"A": A, "B": B})
- run.event.data_frame = df
+ ftrace.event.data_frame = df
- s = SignalCompare(run, "event:A", "event:B")
+ s = SignalCompare(ftrace, "event:A", "event:B")
expected = (1.5, 2.0 / 7)
self.assertEqual(
s.conditional_compare(
@@ -53,11 +53,11 @@ class TestSignalCompare(TestBART):
A = [0, 0, 0, 3, 3, 0, 0, 0]
B = [0, 0, 2, 2, 2, 2, 1, 1]
- run = trappy.Run(".", events=["event"])
+ ftrace = trappy.FTrace(".", events=["event"])
df = pd.DataFrame({"A": A, "B": B})
- run.event.data_frame = df
+ ftrace.event.data_frame = df
- s = SignalCompare(run, "event:A", "event:B")
+ s = SignalCompare(ftrace, "event:A", "event:B")
expected = (1.5, 2.0 / 7)
self.assertEqual(
s.get_overshoot(method="rect"),
@@ -67,8 +67,8 @@ class TestSignalCompare(TestBART):
B = [0, 0, 2, 2, 2, 2, 1, 1]
df = pd.DataFrame({"A": A, "B": B})
- run.event.data_frame = df
- s = SignalCompare(run, "event:A", "event:B")
+ ftrace.event.data_frame = df
+ s = SignalCompare(ftrace, "event:A", "event:B")
expected = (float("nan"), 0.0)
result = s.get_overshoot(method="rect")
@@ -81,11 +81,11 @@ class TestSignalCompare(TestBART):
A = [0, 0, 0, 1, 1, 1, 1, 1]
B = [2, 2, 2, 2, 2, 2, 2, 2]
- run = trappy.Run(".", events=["event"])
+ ftrace = trappy.FTrace(".", events=["event"])
df = pd.DataFrame({"A": A, "B": B})
- run.event.data_frame = df
+ ftrace.event.data_frame = df
- s = SignalCompare(run, "event:A", "event:B")
+ s = SignalCompare(ftrace, "event:A", "event:B")
expected = (4.0 / 14.0, 1.0)
self.assertEqual(
s.get_undershoot(method="rect"),
@@ -95,8 +95,8 @@ class TestSignalCompare(TestBART):
B = [2, 2, 2, 2, 2, 2, 1, 1]
df = pd.DataFrame({"A": A, "B": B})
- run.event.data_frame = df
- s = SignalCompare(run, "event:A", "event:B")
+ ftrace.event.data_frame = df
+ s = SignalCompare(ftrace, "event:A", "event:B")
expected = (float("nan"), 0.0)
result = s.get_undershoot(method="rect")