MCPcopy Create free account
hub / github.com/ElementsProject/elements / _stop_perf

Method _stop_perf

test/functional/test_framework/test_node.py:537–552  ·  view source on GitHub ↗

Stop (and pop) a perf subprocess.

(self, profile_name)

Source from the content-addressed store, hash-verified

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.

Callers 2

stop_nodeMethod · 0.95
profile_with_perfMethod · 0.95

Calls 6

waitMethod · 0.80
formatMethod · 0.80
infoMethod · 0.80
indexMethod · 0.45
decodeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected