In [4]:
import sys,os
import tempfile
import shutil
sys.path.append("..")
%pylab inline
import trappy
trace_thermal = "./trace.txt"
trace_sched = "../tests/trace_sched.txt"
TEMP_BASE = "/tmp"
In [5]:
def setup_thermal():
tDir = tempfile.mkdtemp(dir="/tmp", prefix="trappy_doc", suffix = ".tempDir")
shutil.copyfile(trace_thermal, os.path.join(tDir, "trace.txt"))
return tDir
def setup_sched():
tDir = tempfile.mkdtemp(dir="/tmp", prefix="trappy_doc", suffix = ".tempDir")
shutil.copyfile(trace_sched, os.path.join(tDir, "trace.txt"))
return tDir
In [6]:
temp_thermal_location = setup_thermal()
run1 = trappy.Run(temp_thermal_location)
run2 = trappy.Run(temp_thermal_location)
run2.thermal.data_frame["temp"] = run1.thermal.data_frame["temp"] * 2
run2.cpu_out_power.data_frame["power"] = run1.cpu_out_power.data_frame["power"] * 2
In [7]:
l = trappy.LinePlot(run1, trappy.thermal.Thermal, column="temp")
l.view()
In [8]:
l = trappy.LinePlot(
[run1, run2], trappy.thermal.Thermal, column="temp")
l.view()
In [9]:
l = trappy.LinePlot([run1,
run2],
[trappy.thermal.Thermal,
trappy.thermal.ThermalGovernor],
column=["temp",
"power_range"])
l.view()
In [10]:
l = trappy.LinePlot([run1,
run2],
[trappy.cpu_power.CpuOutPower],
column="power",
filters={"cdev_state": [0]})
l.view()
In [11]:
l = trappy.LinePlot(
run1,
trappy.thermal.Thermal,
column="temp",
pivot="thermal_zone")
l.view()
In [12]:
l = trappy.LinePlot(
[run1, run2], trappy.cpu_power.CpuOutPower, column="power", pivot="cpus")
l.view()
In [13]:
l = trappy.LinePlot([run1,
run2],
[trappy.cpu_power.CpuInPower,
trappy.cpu_power.CpuOutPower],
column=["dynamic_power", "power"],
pivot="cpus")
l.view()
In [14]:
l = trappy.LinePlot(
run1,
trappy.cpu_power.CpuInPower,
column=[
"dynamic_power",
"load1"],
filters={
"cdev_state": [
1,
0]},
pivot="cpus")
l.view()