def compute_rtapp_capacities(conf): """ Compute the capacities that will be used for rtapp. If the CPU capacities are not writeable on the target, the orig capacities will be used, otherwise the capacities adjusted with rtapp calibration will be used. """ writeable = conf['writeable'] orig_capacities = conf['orig'] rtapp_calib = conf['..']['rtapp']['calib'] rtapp_capacities = RTA.get_cpu_capacities_from_calibrations(orig_capacities, rtapp_calib) return rtapp_capacities if writeable else orig_capacities
def correct_expected_pelt(cls, plat_info, cpu, signal_value): """ Correct an expected PELT signal from ``rt-app`` based on the calibration values. Since the instruction mix of ``rt-app`` might not be the same as the benchmark that was used to establish CPU capacities, the duty cycle of ``rt-app`` will only be accurate on big CPUs. When we know on which CPU the task actually executed, we can correct the expected value based on the ratio of calibration values and CPU capacities. """ calib = plat_info['rtapp']['calib'] cpu_capacities = plat_info['cpu-capacities'] # Correct the signal mean to what it should have been if rt-app # workload was exactly the same as the one used to establish CPU # capacities true_capacities = RTA.get_cpu_capacities_from_calibrations(calib) return signal_value * cpu_capacities[cpu] / true_capacities[cpu]