manafa.services package¶
Submodules¶
manafa.services.LogService module¶
- class manafa.services.LogService.LogService(boot_time=0, output_res_folder='hunter')[source]¶
Bases:
manafa.services.service.Service
Class that manages the device’s log.
- This class is responsible by cleaning the log before each execution of the framework, as well as dump the log
right after each execution.
- boot_time¶
timestamp of the device’s last boot.
- Type
float
- output_res_folder¶
folder where the logs will be stored after each profiling session.
- Type
float
- get_results_filename(run_id)[source]¶
returns the name of the output file. :returns: the name of the output file. :rtype: output_name
- init(boot_time=0, **kwargs)[source]¶
inits the class. :param boot_time: device boot timestamp. :param **kwargs:
manafa.services.batteryStatsService module¶
- class manafa.services.batteryStatsService.BatteryStatsService(boot_time=0, output_res_folder='batterystats')[source]¶
Bases:
manafa.services.service.Service
Class that manages the battery stats service state.
This class is responsible by cleaning the service state before each execution of the framework, as well as record its state right after each execution.
- boot_time¶
timestamp of the device’s last boot.
- Type
float
- output_res_folder¶
folder where the logs will be stored after each profiling session.
- Type
float
manafa.services.perfettoService module¶
- class manafa.services.perfettoService.PerfettoService(boot_time=0, output_res_folder='perfetto', default_out_dir='/data/misc/perfetto-traces', cfg_file='perfetto.config.bin')[source]¶
Bases:
manafa.services.service.Service
Class that manages the perfetto service.
This class is responsible by starting and stopping the perfetto service at the start and stop of the profiiling session. .. attribute:: boot_time
timestamp of the device’s last boot.
- type
float
- output_res_folder¶
folder where the logs will be stored after each profiling session.
- Type
str
- default_out_dir¶
device default results dir.
- Type
str
- cfg_file¶
perfetto config file.
- Type
str
- get_run_id_from_perfetto_file(perfetto_filepath: str)[source]¶
returns profiling session id given its filepath
- init(boot_time=0, **kwargs)[source]¶
inits the service. Resets boot time and cleans files from previous runs. :param boot_time: timestamp of the device’s last boot. :param **kwargs:
- start()[source]¶
start profiling session.
Starts perfetto service, using the config file cfg_file as input.
- stop(file_id)[source]¶
Stops the profiling session and exports results.
Stops the perfetto service and pulls the results from device. Afterwards, it exports the pulled results using traceconv, returning the path to the last exported file as result. :param file_id: run id.
- Returns
path of last exported file.
- Return type
last_exported
manafa.services.service module¶
- class manafa.services.service.Service(results_dir='')[source]¶
Bases:
abc.ABC
Reference class for managing the lifecycle of a task need during the profiling session.
This class is responsible by starting and stopping the perfetto service at the start and stop of the profiiling session.
- results_dir¶
folder where the logs will be stored after each profiling session.
- Type
str
Module contents¶
A one line summary of the module or program, terminated by a period.
Leave one blank line. The rest of this docstring should contain an overall description of the module or program. Optionally, it may also contain a brief description of exported classes and functions and/or usage examples.