manafa.parsing.perfetto package

Submodules

manafa.parsing.perfetto.perfettoParser module

class manafa.parsing.perfetto.perfettoParser.CPU_STATE(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVE = 'active'
AWAKE = 'awake'
IDLE = 'idle'
SUSPEND = 'suspend'
class manafa.parsing.perfetto.perfettoParser.PerfettoCPUEvent(time=0.0, values=[])[source]

Bases: object

Stores 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

init_all(default_len=8, val=0)[source]

inits values for each cpu. :param default_len: number of cores. :param val: default value.

update(cpu_id, cpu_freq)[source]

update/insert cpufreq val for each cpu id

class manafa.parsing.perfetto.perfettoParser.PerfettoCPUfreqParser(power_profile=None, start_time=0.0, timezone='EST')[source]

Bases: object

Parses 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)

parse_file(filename)[source]

parses filename. :param filename: path of log file resultant of a profiling session with perfetto.

parse_history(lines)[source]

parses event from lines. :param lines: list of lines from file.

manafa.parsing.perfetto.perfettoParser.interpolate(x1: float, x2: float, y1: float, y2: float, x: float)[source]

Performs linear interpolation for x between (x1,y1) and (x2,y2)

Module contents