Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 1 | # $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 |
| 17 | directory's trace.dat""" |
| 18 | |
Javi Merino | 9c9867d | 2015-06-24 13:24:41 +0100 | [diff] [blame^] | 19 | import pandas as pd |
| 20 | |
Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 21 | from cr2.base import Base |
| 22 | from cr2.run import Run |
| 23 | |
| 24 | |
| 25 | class DevfreqInPower(Base): |
| 26 | """Process de devfreq cooling device data regarding get_power in an |
| 27 | ftrace 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 Merino | 9c9867d | 2015-06-24 13:24:41 +0100 | [diff] [blame^] | 37 | """Return a pandas.DataFrame with the frequencies for the devfreq device |
Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 38 | |
| 39 | The format should be the same as the one for |
| 40 | CpuInPower().get_all_freqs(). Frequencies are in MHz. |
| 41 | |
| 42 | """ |
| 43 | |
Javi Merino | 9c9867d | 2015-06-24 13:24:41 +0100 | [diff] [blame^] | 44 | return pd.DataFrame(self.data_frame["freq"] / 1000000) |
Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 45 | |
| 46 | Run.register_class(DevfreqInPower, "thermal") |
| 47 | |
| 48 | |
| 49 | class DevfreqOutPower(Base): |
| 50 | """Process de devfreq cooling device data regarding power2state in an |
| 51 | ftrace 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 Merino | 9c9867d | 2015-06-24 13:24:41 +0100 | [diff] [blame^] | 61 | """Return a pandas.DataFrame with the output frequencies for the devfreq |
Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 62 | device |
| 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 Merino | 9c9867d | 2015-06-24 13:24:41 +0100 | [diff] [blame^] | 69 | return pd.DataFrame(self.data_frame["freq"] / 1000000) |
Javi Merino | 766ed3f | 2015-04-22 17:07:42 +0100 | [diff] [blame] | 70 | |
| 71 | Run.register_class(DevfreqOutPower, "thermal") |