blob: e09bbd641ac5cfd9c26f2d68e08d2ca2ddd7d175 [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
19from cr2.base import Base
20from cr2.run import Run
21
22
23class DevfreqInPower(Base):
24 """Process de devfreq cooling device data regarding get_power in an
25ftrace dump"""
26
27 name = "devfreq_in_power"
28
29 def __init__(self):
30 super(DevfreqInPower, self).__init__(
31 unique_word="thermal_power_devfreq_get_power:",
32 )
33
34 def get_all_freqs(self):
35 """Return a pandas.Series with the frequencies for the devfreq device
36
37 The format should be the same as the one for
38 CpuInPower().get_all_freqs(). Frequencies are in MHz.
39
40 """
41
42 return self.data_frame["freq"] / 1000000
43
44Run.register_class(DevfreqInPower, "thermal")
45
46
47class DevfreqOutPower(Base):
48 """Process de devfreq cooling device data regarding power2state in an
49ftrace dump"""
50
51 name = "devfreq_out_power"
52
53 def __init__(self):
54 super(DevfreqOutPower, self).__init__(
55 unique_word="thermal_power_devfreq_limit:",
56 )
57
58 def get_all_freqs(self):
59 """Return a pandas.Series with the output frequencies for the devfreq
60device
61
62 The format should be the same that that of
63 CpuOutPower().get_all_freqs(). The frequencies are in MHz.
64
65 """
66
67 return self.data_frame["freq"] / 1000000
68
69Run.register_class(DevfreqOutPower, "thermal")