blob: 23449cf825dee8235cc0e1de71f1564eeed119aa [file] [log] [blame]
Javi Merino766ed3f2015-04-22 17:07:42 +01001# $Copyright:
2# ----------------------------------------------------------------
3# This confidential and proprietary software may be used only as
4# authorised by a licensing agreement from ARM Limited
5# (C) COPYRIGHT 2015 ARM Limited
6# ALL RIGHTS RESERVED
7# The entire notice above must be reproduced on all authorised
8# copies and copies may only be made to the extent permitted
9# by a licensing agreement from ARM Limited.
10# ----------------------------------------------------------------
11# File: devfreq_power.py
12# ----------------------------------------------------------------
13# $
14#
15
16"""Process the output of the devfreq_cooling devices in the current
17directory's trace.dat"""
18
Javi Merino9c9867d2015-06-24 13:24:41 +010019import pandas as pd
20
Javi Merino766ed3f2015-04-22 17:07:42 +010021from cr2.base import Base
22from cr2.run import Run
23
24
25class DevfreqInPower(Base):
26 """Process de devfreq cooling device data regarding get_power in an
27ftrace dump"""
28
29 name = "devfreq_in_power"
30
31 def __init__(self):
32 super(DevfreqInPower, self).__init__(
33 unique_word="thermal_power_devfreq_get_power:",
34 )
35
36 def get_all_freqs(self):
Javi Merino9c9867d2015-06-24 13:24:41 +010037 """Return a pandas.DataFrame with the frequencies for the devfreq device
Javi Merino766ed3f2015-04-22 17:07:42 +010038
39 The format should be the same as the one for
40 CpuInPower().get_all_freqs(). Frequencies are in MHz.
41
42 """
43
Javi Merino9c9867d2015-06-24 13:24:41 +010044 return pd.DataFrame(self.data_frame["freq"] / 1000000)
Javi Merino766ed3f2015-04-22 17:07:42 +010045
46Run.register_class(DevfreqInPower, "thermal")
47
48
49class DevfreqOutPower(Base):
50 """Process de devfreq cooling device data regarding power2state in an
51ftrace dump"""
52
53 name = "devfreq_out_power"
54
55 def __init__(self):
56 super(DevfreqOutPower, self).__init__(
57 unique_word="thermal_power_devfreq_limit:",
58 )
59
60 def get_all_freqs(self):
Javi Merino9c9867d2015-06-24 13:24:41 +010061 """Return a pandas.DataFrame with the output frequencies for the devfreq
Javi Merino766ed3f2015-04-22 17:07:42 +010062device
63
64 The format should be the same that that of
65 CpuOutPower().get_all_freqs(). The frequencies are in MHz.
66
67 """
68
Javi Merino9c9867d2015-06-24 13:24:41 +010069 return pd.DataFrame(self.data_frame["freq"] / 1000000)
Javi Merino766ed3f2015-04-22 17:07:42 +010070
71Run.register_class(DevfreqOutPower, "thermal")