manafa.parsing.perfetto package¶
Submodules¶
manafa.parsing.perfetto.perfettoParser module¶
- class manafa.parsing.perfetto.perfettoParser.CPU_STATE(value)[source]¶
 Bases:
enum.EnumAn enumeration.
- ACTIVE = 'active'¶
 
- AWAKE = 'awake'¶
 
- IDLE = 'idle'¶
 
- SUSPEND = 'suspend'¶
 
- class manafa.parsing.perfetto.perfettoParser.PerfettoCPUEvent(time=0.0, values=[])[source]¶
 Bases:
objectStores information regarding each cpu frequency in a given time.
A perfetto cpufreq event information, corresponding to a line in an results output file in systrace format. .. attribute:: time
event_time.
- vals¶
 frequency for each cpu of device.
- calculate_CPUs_current(state, profile)[source]¶
 given a power profile and a cpu state, returns the instantaneous current being consumed by all cpu cores in that state. :param state: cpu state in CPU_STATE values :param profile: power profile class
- class manafa.parsing.perfetto.perfettoParser.PerfettoCPUfreqParser(power_profile=None, start_time=0.0, timezone='EST')[source]¶
 Bases:
objectParses cpu frequency updates from a log file obtained with perfetto. .. attribute:: power_profile
current device power profile.
- start_time¶
 lower timestamp bound to consider.
- timezone¶
 device timezone.
- add_event(time: float, cpu_id: int, cpu_freq: int)[source]¶
 add or update cpu freq event based on values passed as argument. :param time: timestamp of event. :param cpu_id: id of cpu. :param cpu_freq: frequency value.
- get_closest_pair(time)[source]¶
 return the closest indexes of samples to time. :param time: reference time.
- Returns
 before index. i(int): after index.
- Return type
 lasti(int)
- static load_power_profile(xml_profile)[source]¶
 Loads power profile from xml_profile filepath. :returns: power profile file. :rtype: object
- parse_event(ev_str)[source]¶
 parse frequency and cpu id from string. :param ev_str: string expecting to have the patttern.
- Returns
 id of the cpu. cpu_freq(int): frequency value.
- Return type
 cpu_id(int)