Stop (and pop) a perf subprocess.
(self, profile_name)
| 535 | return subp |
| 536 | |
| 537 | def _stop_perf(self, profile_name): |
| 538 | """Stop (and pop) a perf subprocess.""" |
| 539 | subp = self.perf_subprocesses.pop(profile_name) |
| 540 | output_path = subp.args[subp.args.index('-o') + 1] |
| 541 | |
| 542 | subp.terminate() |
| 543 | subp.wait(timeout=10) |
| 544 | |
| 545 | stderr = subp.stderr.read().decode() |
| 546 | if 'Consider tweaking /proc/sys/kernel/perf_event_paranoid' in stderr: |
| 547 | self.log.warning( |
| 548 | "perf couldn't collect data! Try " |
| 549 | "'sudo sysctl -w kernel.perf_event_paranoid=-1'") |
| 550 | else: |
| 551 | report_cmd = "perf report -i {}".format(output_path) |
| 552 | self.log.info("See perf output by running '{}'".format(report_cmd)) |
| 553 | |
| 554 | def assert_start_raises_init_error(self, extra_args=None, expected_msg=None, match=ErrorMatch.FULL_TEXT, *args, **kwargs): |
| 555 | """Attempt to start the node and expect it to raise an error. |