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 | |
| 19 | from cr2.base import Base |
| 20 | from cr2.run import Run |
| 21 | |
| 22 | |
| 23 | class DevfreqInPower(Base): |
| 24 | """Process de devfreq cooling device data regarding get_power in an |
| 25 | ftrace 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 | |
| 44 | Run.register_class(DevfreqInPower, "thermal") |
| 45 | |
| 46 | |
| 47 | class DevfreqOutPower(Base): |
| 48 | """Process de devfreq cooling device data regarding power2state in an |
| 49 | ftrace 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 |
| 60 | device |
| 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 | |
| 69 | Run.register_class(DevfreqOutPower, "thermal") |