(self)
| 247 | ) |
| 248 | |
| 249 | def run(self): |
| 250 | logging.info("Arm Kernel Benchmark Task Start...") |
| 251 | benchmark_targets = self.config["benchmark_targets"] |
| 252 | for target in benchmark_targets: |
| 253 | file_name = os.path.basename(target) |
| 254 | |
| 255 | subcommand = [ |
| 256 | self.export_ld_path, |
| 257 | target, |
| 258 | "--benchmark_out_format=json", |
| 259 | f"--benchmark_out={os.path.join(self.config['remote_results_path'], file_name + '.json')}", |
| 260 | ] |
| 261 | command = [ |
| 262 | "adb", |
| 263 | "shell", |
| 264 | f"'{self.make_command_str(subcommand)}'", |
| 265 | ] |
| 266 | logging.info(self.make_command_str(command)) |
| 267 | throw_error_if_failed(os.system(self.make_command_str(command))) |
| 268 | logging.info("Waiting 16 seconds for device to calm down...") |
| 269 | time.sleep(16) |
| 270 | |
| 271 | if not os.path.exists(PROJECT_ROOT_PATH / Path("temp")): |
| 272 | os.mkdir(PROJECT_ROOT_PATH / Path("temp")) |
| 273 | |
| 274 | for target in benchmark_targets: |
| 275 | file_name = os.path.basename(target) |
| 276 | |
| 277 | command = [ |
| 278 | "adb", |
| 279 | "pull", |
| 280 | f"{os.path.join(self.config['remote_results_path'], file_name + '.json')}", |
| 281 | (PROJECT_ROOT_PATH / Path("temp")).as_posix(), |
| 282 | ] |
| 283 | logging.info(self.make_command_str(command)) |
| 284 | throw_error_if_failed(os.system(self.make_command_str(command))) |
| 285 | |
| 286 | md_headers = [ |
| 287 | "Name", |
| 288 | "Run Name", |
| 289 | "Run Type", |
| 290 | "Iterations", |
| 291 | "Real Time", |
| 292 | "CPU Time", |
| 293 | "Time Unit", |
| 294 | ] |
| 295 | with open( |
| 296 | os.path.join(PROJECT_ROOT_PATH / Path("temp"), file_name + ".json"), "r" |
| 297 | ) as file: |
| 298 | data = json.load(file) |
| 299 | rows = [] |
| 300 | for item in data["benchmarks"]: |
| 301 | rows.append( |
| 302 | [ |
| 303 | item["name"], |
| 304 | item["run_name"], |
| 305 | item["run_type"], |
| 306 | item["iterations"], |
nothing calls this directly
no test coverage detected